From: SnickerSun Date: Thu, 2 May 2024 16:16:47 +0000 (+0800) Subject: 【补丁名称】sdk_602_patch_0425 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~435 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F120%2F1;p=mirrors%2FFD230.git 【补丁名称】sdk_602_patch_0425 【基础版本】b602 【修复问题】收编补丁 【修改影响】NA 【使用方法】 1、手动删除sdk_602版本以下文件: code\sdk\application\wearable\nativeapp\nativeui\main\src\dial\parser\DialBinTypes.h code\sdk\application\wearable\nativeapp\nativeui\main\src\dial\parser\DialBinParser.h code\sdk\open_source\openharmony\third_party\jerryscript 2、使用补丁覆盖sdk_602版本目录 3、离线表盘工具、js开发配套工具存放在tools,视频表盘制作变更具体参考tools\dial_converter_tool\视频表盘制作变更.txt 4、nativeapp新增资源存放在res目录 【自测情况】自验证符合要求 【是否合入版本】根据测试结果确定 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..0313d221c --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +code/sdk/deveco/** +code/sdk/vscode/** +code/sdk/output/** +code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg +release/** +build.log +.vscode/** +code/sdk/interim_binary/brandy/libs/gpu/evb_recovery/libgpu.a +code/sdk/build/config/target_config/brandy/mk_fs_image/evb4/file.bin +code/sdk/build/config/target_config/brandy/mk_fs_image/evb4/file_tmp.bin +code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/file.bin +code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/file_tmp.bin +code/sdk/drivers/peripheral/cywee/doc/~$CWM lib Sensor Info_Gnt_Fd230_20240222.xlsx +code/sdk/drivers/peripheral/cywee/doc/~$Cwm_Dml_Info__LIS2DOC__20230816.xlsx diff --git a/SDK_1.1.10.602_0425patch.txt b/SDK_1.1.10.602_0425patch.txt new file mode 100644 index 000000000..142fdcf3d --- /dev/null +++ b/SDK_1.1.10.602_0425patch.txt @@ -0,0 +1,16 @@ +SDK version: +1.1.10.522【补丁名称】sdk_602_patch_0425 +【基础版本】b602 +【修复问题】收编补丁 + +【修改影响】NA +【使用方法】 + 1、手动删除sdk_602版本以下文件: + code\sdk\application\wearable\nativeapp\nativeui\main\src\dial\parser\DialBinTypes.h + code\sdk\application\wearable\nativeapp\nativeui\main\src\dial\parser\DialBinParser.h + code\sdk\open_source\openharmony\third_party\jerryscript + 2、使用补丁覆盖sdk_602版本目录 + 3、离线表盘工具、js开发配套工具存放在tools,视频表盘制作变更具体参考tools\dial_converter_tool\视频表盘制作变更.txt + 4、nativeapp新增资源存放在res目录 +【自测情况】自验证符合要求 +【是否合入版本】根据测试结果确定 diff --git a/autobuild.sh b/autobuild.sh new file mode 100644 index 000000000..2b5334b3c --- /dev/null +++ b/autobuild.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +version=HEAD +DATE=$(date +%Y%m%d_%H%M%S) +HOMEDIR=$PWD +DEFAULT_BUILD_TYPE=release +DEFAULT_TARGET_PACK_NAME=pack_brandy_native_js + +TARGET_PACK_NAME=$DEFAULT_TARGET_PACK_NAME +RELEASE_BUILD=$DEFAULT_BUILD_TYPE +CLEAN= + +checkarguments() +{ +if [ "$1" == "clean" ] +then +CLEAN=-c +fi + +if [[ "$1" == *"brandy"* ]] +then +echo $1 has brandy should be target_pack_name +TARGET_PACK_NAME=$1 +fi + +if [ "$1" == "debug" ] +then +RELEASE_BUILD=debug +fi + +if [ "$1" == "release" ] +then +RELEASE_BUILD=release +fi +} +CURRENT_BRANCH=`git branch |awk '$1=="*"{print $2}'` +COMMIT_ID=`git rev-parse HEAD` +SOURCE_MODIFIED=`git status --short` +cp_releasepackage() +{ + #code/sdk/output/brandy/acore/brandy-native-js/package/brandy/ + package_dir=$HOMEDIR/code/sdk/output/package/brandy/$TARGET_PACK_NAME + filename=${TARGET_PACK_NAME}_${RELEASE_BUILD}_${DATE}_${USER}.fwpkg + releasedir=$HOMEDIR/release/$TARGET_PACK_NAME/$RELEASE_BUILD/${DATE} + packsource=$HOMEDIR/code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg + echo do release copy + mkdir -p $releasedir + cp -r $HOMEDIR/build.log $package_dir $releasedir/ + cp $packsource $releasedir/$filename + echo $filename > $releasedir/readme.txt + echo branch name $CURRENT_BRANCH >> $releasedir/readme.txt + echo commit $COMMIT_ID >> $releasedir/readme.txt + if [ "$SOURCE_MODIFIED" == "" ] + then + echo no source changed >> $releasedir/readme.txt + else + echo source changed >> $releasedir/readme.txt + echo $SOURCE_MODIFIED >> $releasedir/readme.txt + fi + echo release to $releasedir/$filename + cat $releasedir/readme.txt +} +build_target() +{ + + cd $HOMEDIR/code/sdk/ + echo ./build.py -nhso $CLEAN -$RELEASE_BUILD -build_time=$DATE $TARGET_PACK_NAME 2>&1 + python ./build.py -nhso $CLEAN -$RELEASE_BUILD -build_time=$DATE $TARGET_PACK_NAME 2>&1 + ret_code=$? + if [ $ret_code == 0 ] + then + #code/sdk/output/currentbuild.txt + if [ -e "$HOMEDIR/code/sdk/output/currentbuild.txt" ] + then + TARGET_PACK_NAME=`cat $HOMEDIR/code/sdk/output/currentbuild.txt` + fi + cp_releasepackage + echo build done at $(date +%Y%m%d_%H%M%S) + else + echo build failed at $(date +%Y%m%d_%H%M%S) + fi + cd $HOMEDIR +} + +checkarguments $1 +checkarguments $2 +checkarguments $3 +if [ "$CLEAN" == "-c" ] +then +echo $0 $TARGET_PACK_NAME $RELEASE_BUILD clean +else +echo $0 $TARGET_PACK_NAME $RELEASE_BUILD +fi + +read -n 1 -p "Press any key to continue..." + +build_target | tee $HOMEDIR/build.log diff --git a/build.log b/build.log index afbd18601..7a18c7b36 100644 --- a/build.log +++ b/build.log @@ -1,3 +1,5 @@ +./build.py -nhso -release -build_time=20240503_001315 pack_brandy_native_js +Not searching for unused variables given on the command line. -- BUILD_PLATFORM: linux audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/vendor/../../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4_liteos_cfg.mak audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4_liteos_cfg.mak @@ -7,104 +9,356 @@ TARGET_INCLUDE = /home/snicker/hiwatch/code/sdk/middleware/chips/brandy/nv/nv_co -- Configuring done -- Generating done -- Build files have been written to: /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb -[ 0%] Built target irmalloc -[ 0%] Built target osal -[ 0%] Built target cpu_trace -[ 1%] Built target boot_nandflash -[ 6%] Built target libboundscheck -[ 6%] Built target non_os -[ 6%] Built target flash_boot_brandy -[ 7%] Built target flash -[ 7%] Built target memory_core -[ 7%] Built target gpio -[ 7%] Built target pinctrl -[ 9%] Built target lpc -[ 10%] Built target ipc_old -[ 11%] Built target pmp -[ 12%] Built target otp -[ 12%] Built target psram -[ 15%] Built target hash -[ 15%] Built target spi -[ 16%] Built target qspi +Scanning dependencies of target non_os +[ 0%] Built target boot_ulp +Scanning dependencies of target irmalloc +[ 3%] Built target libboundscheck +Scanning dependencies of target cpu_trace +Scanning dependencies of target osal +[ 3%] Building C object kernel/non_os/irmalloc/CMakeFiles/irmalloc.dir/chip_mem/chip_mem.c.obj +[ 5%] Building C object kernel/non_os/non_os/CMakeFiles/non_os.dir/non_os_utils.c.obj +[ 5%] Building C object kernel/osal/CMakeFiles/osal.dir/adapt/non-os/pal_non_os_interface.c.obj +Scanning dependencies of target flash +Scanning dependencies of target boot_nandflash +[ 6%] Building C object driver/cpu_trace/CMakeFiles/cpu_trace.dir/cpu_trace.c.obj +[ 6%] Building C object driver/flash/CMakeFiles/flash.dir/flash.c.obj +[ 6%] Built target gpio +[ 7%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/nandflash_ds35x1g.c.obj +[ 9%] Building C object kernel/non_os/irmalloc/CMakeFiles/irmalloc.dir/chip_mem/irmalloc.c.obj +[ 9%] Linking C static library libcpu_trace.a +[ 9%] Linking C static library libnon_os.a +[ 9%] Building C object kernel/osal/CMakeFiles/osal.dir/adapt/non-os/pal_print.c.obj +[ 9%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/nandflash_w25n01g.c.obj +Scanning dependencies of target ipc_old +Scanning dependencies of target flash_boot_brandy +[ 10%] Linking C static library libflash.a +[ 11%] Linking C static library libosal.a +[ 11%] Linking C static library libirmalloc.a +[ 11%] Building C object bootloader/flashboot/brandy/CMakeFiles/flash_boot_brandy.dir/main.c.obj +[ 12%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/acore/ipc_irq.c.obj +[ 12%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/nandflash_config.c.obj +[ 12%] Built target cpu_trace +[ 12%] Built target non_os +[ 12%] Built target flash +[ 12%] Built target osal +[ 12%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/shared/ipc.c.obj +[ 12%] Linking C static library libflash_boot_brandy.a +Scanning dependencies of target otp +Scanning dependencies of target lpc +[ 12%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/hal_nandflash.c.obj +Scanning dependencies of target memory_core +[ 12%] Building C object driver/otp/CMakeFiles/otp.dir/otp.c.obj +[ 12%] Building C object driver/memory_core/CMakeFiles/memory_core.dir/shared/memory_core.c.obj +[ 12%] Built target irmalloc +[ 12%] Building C object driver/lpc/CMakeFiles/lpc.dir/acore/lpc_core.c.obj +[ 12%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/nandflash_qspi.c.obj +[ 12%] Linking C static library libipc_old.a +[ 14%] Built target pinctrl +[ 14%] Linking C static library libmemory_core.a +[ 14%] Built target flash_boot_brandy +[ 15%] Building C object driver/lpc/CMakeFiles/lpc.dir/shared/lpc.c.obj +[ 15%] Linking C static library libotp.a +[ 16%] Building C object bootloader/flashboot/brandy/nandflash/CMakeFiles/boot_nandflash.dir/nandflash.c.obj +[ 16%] Built target pmp +[ 16%] Linking C static library liblpc.a +Scanning dependencies of target qspi +[ 16%] Built target ipc_old +[ 16%] Linking C static library libboot_nandflash.a +Scanning dependencies of target psram [ 19%] Built target cipher -[ 20%] Built target trng -[ 22%] Built target pke -[ 24%] Built target km -[ 25%] Built target systick +[ 19%] Building C object driver/qspi/CMakeFiles/qspi.dir/qspi.c.obj +[ 19%] Building C object driver/psram/CMakeFiles/psram.dir/psram_drv.c.obj +[ 19%] Built target memory_core +[ 20%] Built target hash +[ 20%] Built target otp +[ 20%] Built target lpc +[ 22%] Built target km +[ 22%] Linking C static library libqspi.a +Scanning dependencies of target trng +[ 23%] Linking C static library libpsram.a +[ 23%] Built target boot_nandflash +[ 23%] Built target pke +Scanning dependencies of target systick +[ 23%] Building C object driver/security/trng/CMakeFiles/trng.dir/drv_trng.c.obj +[ 23%] Building C object driver/systick/CMakeFiles/systick.dir/systick.c.obj +[ 23%] Built target spi +Scanning dependencies of target uart +[ 24%] Built target tcxo +[ 24%] Linking C static library libtrng.a +[ 25%] Linking C static library libsystick.a +[ 25%] Built target psram +[ 25%] Built target qspi [ 27%] Built target drv_timer -[ 27%] Built target uart -[ 27%] Built target ulp_aon -[ 28%] Built target tcxo -[ 29%] Built target watchdog -[ 31%] Built target rtc_unified -[ 31%] Built target hal_cpu_core -[ 31%] Built target efuse -[ 32%] Built target hal_cpu_trace -[ 32%] Built target hal_lpc -[ 33%] Built target hal_gpio_v100 -[ 33%] Built target hal_mips -[ 35%] Built target hal_l2ram -[ 35%] Built target hal_ipc_old +[ 27%] Building C object driver/uart/CMakeFiles/uart.dir/uart.c.obj +Scanning dependencies of target ulp_aon +[ 28%] Built target watchdog +[ 28%] Linking C static library libuart.a +Scanning dependencies of target efuse +[ 28%] Building C object driver/ulp_aon/CMakeFiles/ulp_aon.dir/ulp_aon_control.c.obj +[ 28%] Built target hal_cpu_core +Scanning dependencies of target rtc_unified +[ 28%] Built target trng +[ 28%] Built target systick +Scanning dependencies of target hal_cpu_trace +[ 28%] Building C object driver/efuse/CMakeFiles/efuse.dir/efuse.c.obj +[ 28%] Building C object driver/rtc_unified/CMakeFiles/rtc_unified.dir/rtc.c.obj +[ 28%] Linking C static library libulp_aon.a +[ 28%] Built target uart +Scanning dependencies of target hal_lpc +Scanning dependencies of target hal_ipc_old +[ 28%] Building C object hal/cpu_trace/CMakeFiles/hal_cpu_trace.dir/hal_cpu_trace.c.obj +[ 29%] Built target hal_gpio_v100 +[ 31%] Building C object hal/ipc/CMakeFiles/hal_ipc_old.dir/hal_ipc_old/hal_ipc.c.obj +[ 31%] Building C object hal/lpc/CMakeFiles/hal_lpc.dir/hal_lpc.c.obj +Scanning dependencies of target hal_l2ram +[ 31%] Linking C static library librtc_unified.a +[ 31%] Linking C static library libefuse.a +[ 32%] Linking C static library libhal_cpu_trace.a +[ 32%] Built target ulp_aon +[ 32%] Building C object hal/l2ram/CMakeFiles/hal_l2ram.dir/hal_l2ram_private.c.obj +[ 32%] Built target hal_mips +[ 32%] Linking C static library libhal_ipc_old.a +[ 33%] Linking C static library libhal_lpc.a +Scanning dependencies of target hal_otp +[ 33%] Built target efuse +[ 33%] Linking C static library libhal_l2ram.a +[ 33%] Built target rtc_unified +[ 33%] Building C object hal/otp/CMakeFiles/hal_otp.dir/brandy/hal_otp.c.obj +[ 33%] Built target hal_cpu_trace +[ 33%] Built target hal_ipc_old +[ 35%] Linking C static library libhal_otp.a +[ 36%] Built target hal_pmp +[ 36%] Built target hal_pinctrl +Scanning dependencies of target hal_qspi +[ 36%] Built target hal_l2ram +[ 36%] Built target hal_lpc +Scanning dependencies of target hal_reg_config +Scanning dependencies of target hal_sectors +Scanning dependencies of target hal_reboot +[ 36%] Building C object hal/qspi/CMakeFiles/hal_qspi.dir/hal_qspi.c.obj [ 36%] Built target hal_otp -[ 37%] Built target hal_pinctrl -[ 38%] Built target hal_pmp -[ 38%] Built target hal_reg_config -[ 38%] Built target hal_qspi -[ 40%] Built target hal_sectors -[ 41%] Built target hal_reboot -[ 42%] Built target hal_cipher -[ 44%] Built target hal_hash -[ 45%] Built target hal_km -[ 46%] Built target hal_pke -[ 48%] Built target hal_efuse_v100 -[ 49%] Built target hal_trng -[ 51%] Built target hal_systick -[ 51%] Built target hal_spi -[ 53%] Built target hal_tcxo -[ 54%] Built target hal_timer -[ 55%] Built target hal_watchdog -[ 57%] Built target hal_rtc_unified -[ 58%] Built target hal_uart -[ 58%] Built target hal_xip -[ 62%] Built target pmu_brandy -[ 67%] Built target brandy_clocks -[ 67%] Built target cipher_port -[ 68%] Built target gpio_port +[ 36%] Building C object hal/sectors/CMakeFiles/hal_sectors.dir/hal_sectors.c.obj +[ 36%] Building C object hal/reg_config/CMakeFiles/hal_reg_config.dir/hal_reg_config.c.obj +[ 37%] Built target hal_km +[ 37%] Building C object hal/reboot/CMakeFiles/hal_reboot.dir/hal_reboot.c.obj +[ 38%] Built target hal_cipher +[ 40%] Built target hal_hash +[ 40%] Linking C static library libhal_qspi.a +[ 42%] Built target hal_pke +[ 42%] Linking C static library libhal_reg_config.a +[ 42%] Linking C static library libhal_sectors.a +[ 44%] Linking C static library libhal_reboot.a +Scanning dependencies of target hal_efuse_v100 +[ 45%] Built target hal_trng +[ 46%] Built target hal_spi +[ 46%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/hal_efuse.c.obj +[ 46%] Built target hal_qspi +Scanning dependencies of target hal_systick +[ 46%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100.c.obj +[ 48%] Built target hal_timer +[ 49%] Built target hal_reboot +[ 49%] Built target hal_tcxo +[ 49%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150.c.obj +[ 49%] Built target hal_sectors +[ 49%] Built target hal_reg_config +Scanning dependencies of target hal_uart +[ 49%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100_reg_op.c.obj +[ 50%] Building C object hal/uart/CMakeFiles/hal_uart.dir/hal_uart.c.obj +[ 50%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150_regs_op.c.obj +Scanning dependencies of target hal_xip +Scanning dependencies of target hal_rtc_unified +[ 50%] Linking C static library libhal_efuse_v100.a +[ 51%] Built target hal_watchdog +[ 51%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/hal_rtc.c.obj +[ 51%] Linking C static library libhal_systick.a +[ 51%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/v100/hal_rtc_v100.c.obj +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:13:11: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_comm_regs = NULL; +^ ~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:14:45: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_regs[CONFIG_RTC_MAX_NUM] = {NULL}; +^~~~ +/home/snicker/hiwatch/code/sdk/tools/bin/compiler/linx/linx_170/linx-llvm-binary-debug/linx-llvm-binary-release-musl/lib/clang/12.0.1/include/stddef.h:89:16: note: expanded from macro 'NULL' +# define NULL ((void*)0) +^~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:31:23: warning: incompatible pointer to integer conversion assigning to 'uintptr_t' (aka 'unsigned int') from 'void *' [-Wint-conversion] +g_rtc_regs[index] = NULL; +^ ~~~~ +3 warnings generated. +[ 51%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120.c.obj +[ 51%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120_regs_op.c.obj +Scanning dependencies of target brandy_clocks +[ 51%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip.c.obj +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/xip/hal_xip.c:24:13: warning: unused function 'hal_xip_auto' [-Wunused-function] +static void hal_xip_auto(bool en) +^ +1 warning generated. +Scanning dependencies of target pmu_brandy +[ 51%] Linking C static library libhal_rtc_unified.a +[ 51%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks_config_priv.c.obj +[ 53%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip_v150_regs_op.c.obj +[ 54%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks.c.obj +[ 54%] Linking C static library libhal_uart.a +[ 54%] Built target hal_efuse_v100 +[ 54%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_cmu.c.obj +[ 54%] Linking C static library libhal_xip.a +[ 54%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app.c.obj +[ 55%] Built target hal_rtc_unified +Scanning dependencies of target gpio_port +Scanning dependencies of target chip_brandy +[ 55%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app_priv.c.obj +[ 55%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_interrupt.c.obj +[ 57%] Built target hal_systick +[ 57%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt.c.obj +[ 57%] Building C object drivers/chips/brandy/porting/gpio/CMakeFiles/gpio_port.dir/gpio_porting.c.obj +[ 57%] Built target hal_xip +[ 57%] Built target hal_uart +[ 57%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_glb.c.obj +[ 57%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_ldo.c.obj +[ 57%] Built target cipher_port +[ 57%] Built target hash_port +[ 57%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_cmu.c.obj +[ 57%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/shared/pmu.c.obj +[ 58%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt_handler.c.obj +[ 59%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_sdio.c.obj +[ 61%] Linking C static library libgpio_port.a +[ 62%] Built target km_port +[ 63%] Built target pke_port +[ 63%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/interrupt/vectors.c.obj +[ 63%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_interrupt.c.obj +[ 63%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks.c.obj +[ 63%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_peripheral_app.c.obj +[ 64%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/config/pmp_config.c.obj +[ 66%] Built target trng_port +[ 66%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_cpu_clocks.c.obj +Scanning dependencies of target efuse_porting +[ 66%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_core.c.obj +[ 67%] Linking C static library libpmu_brandy.a +[ 67%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch_priv.c.obj +[ 67%] Built target gpio_port +[ 67%] Linking C static library libchip_brandy.a +[ 68%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch.c.obj +Scanning dependencies of target uart_port +[ 68%] Building C object drivers/chips/brandy/porting/security/efuse/CMakeFiles/efuse_porting.dir/efuse_porting.c.obj +[ 68%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clock_calibration.c.obj +Scanning dependencies of target systick_port +[ 68%] Building C object drivers/chips/brandy/porting/uart/CMakeFiles/uart_port.dir/uart_porting.c.obj +[ 70%] Built target timer_port +[ 71%] Linking C static library libefuse_porting.a +[ 71%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clocks_core_common.c.obj +[ 71%] Building C object drivers/chips/brandy/porting/systick/CMakeFiles/systick_port.dir/systick_porting.c.obj [ 71%] Built target chip_brandy -[ 72%] Built target km_port -[ 72%] Built target pke_port -[ 72%] Built target hash_port -[ 74%] Built target trng_port -[ 75%] Built target efuse_porting -[ 76%] Built target uart_port -[ 76%] Built target timer_port +[ 72%] Linking C static library libuart_port.a +[ 74%] Linking C static library libbrandy_clocks.a +[ 74%] Linking C static library libsystick_port.a +[ 76%] Built target pmu_brandy +Scanning dependencies of target watchdog_port [ 76%] Built target tcxo_port +[ 76%] Built target efuse_porting +[ 76%] Built target port_pinctrl +[ 76%] Building C object drivers/chips/brandy/porting/watchdog/CMakeFiles/watchdog_port.dir/watchdog_porting.c.obj +[ 76%] Built target uart_port +Scanning dependencies of target xip_port [ 76%] Built target systick_port -[ 77%] Built target xip_port -[ 79%] Built target port_pinctrl -[ 79%] Built target pmp_port -[ 79%] Built target watchdog_port -[ 80%] Built target spi_porting -[ 80%] Built target rtc_unified_port -[ 81%] Built target flash_porting -[ 83%] Built target partition_brandy -[ 83%] Built target dfx_exception -[ 84%] Built target algorithm -[ 85%] Built target bootloader -[ 85%] Built target build_version -[ 87%] Built target codeloader_ssb -[ 88%] Built target app_version -[ 88%] Built target dfx_preserve -[ 89%] Built target cpu_utils -[ 93%] Built target connectivity_ssb -[ 96%] Built target dfx_panic -[ 96%] Built target codeloader -[ 96%] Built target reboot -[ 96%] Built target error_code -[ 96%] Built target lib_utils -[ 96%] Built target partition -[ 97%] Generating NV_SRC +[ 77%] Built target pmp_port +Scanning dependencies of target spi_porting +Scanning dependencies of target rtc_unified_port +Scanning dependencies of target flash_porting +[ 77%] Linking C static library libwatchdog_port.a +[ 79%] Building C object drivers/chips/brandy/porting/spi/CMakeFiles/spi_porting.dir/spi_porting.c.obj +[ 79%] Building C object drivers/chips/brandy/porting/rtc_unified/CMakeFiles/rtc_unified_port.dir/rtc_porting.c.obj +[ 79%] Built target partition_brandy +[ 79%] Building C object drivers/chips/brandy/porting/xip/CMakeFiles/xip_port.dir/xip_porting.c.obj +[ 79%] Building C object drivers/chips/brandy/porting/flash/CMakeFiles/flash_porting.dir/flash_porting.c.obj +/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/spi/spi_porting.c:468:47: warning: unused parameter 'clk_in_mhz' [-Wunused-parameter] +bool hal_opi_set_freq(spi_bus_t bus, uint32_t clk_in_mhz) +^ +1 warning generated. +Scanning dependencies of target dfx_exception +[ 79%] Built target brandy_clocks +[ 80%] Linking C static library libxip_port.a +[ 80%] Built target watchdog_port +[ 80%] Linking C static library libspi_porting.a +[ 80%] Linking C static library librtc_unified_port.a +[ 80%] Building C object middleware/chips/brandy/exception/CMakeFiles/dfx_exception.dir/exception_riscv.c.obj +Scanning dependencies of target algorithm +[ 81%] Linking C static library libflash_porting.a +Scanning dependencies of target app_version +Scanning dependencies of target bootloader +[ 81%] Linking C static library libdfx_exception.a +[ 81%] Building C object utils/algorithm/CMakeFiles/algorithm.dir/sec_random/sec_random.c.obj +[ 81%] Building C object utils/app_version/CMakeFiles/app_version.dir/private/application_version.c.obj +[ 83%] Building C object utils/bootloader/CMakeFiles/bootloader.dir/private/bootloader_configuration.c.obj +[ 83%] Built target xip_port +[ 83%] Linking C static library libalgorithm.a +[ 83%] Built target flash_porting +[ 83%] Built target spi_porting +[ 83%] Built target rtc_unified_port +[ 83%] Linking C static library libapp_version.a +[ 83%] Building C object utils/bootloader/CMakeFiles/bootloader.dir/private/bootloader_utils.c.obj +[ 84%] Built target dfx_exception +Scanning dependencies of target build_version +[ 84%] Building C object utils/build_version/CMakeFiles/build_version.dir/private/build_version.c.obj +[ 84%] Linking C static library libbootloader.a +[ 85%] Built target codeloader_ssb +Scanning dependencies of target dfx_preserve +[ 85%] Building C object utils/dfx/CMakeFiles/dfx_preserve.dir/preserve/private/preserve.c.obj +Scanning dependencies of target connectivity_ssb +[ 85%] Linking C static library libbuild_version.a +[ 85%] Built target app_version +[ 88%] Built target algorithm +Scanning dependencies of target codeloader +Scanning dependencies of target dfx_panic +[ 88%] Built target bootloader +[ 88%] Building C object utils/connectivity/CMakeFiles/connectivity_ssb.dir/common/acore/connectivity_calibration.c.obj +[ 88%] Linking C static library libdfx_preserve.a +[ 88%] Building C object utils/dfx/CMakeFiles/dfx_panic.dir/panic/private/panic.c.obj +[ 88%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader.c.obj +Scanning dependencies of target cpu_utils +[ 88%] Building C object utils/dfx/dfx_reboot/cpu_utils/CMakeFiles/cpu_utils.dir/private/cpu_utils.c.obj +[ 88%] Built target build_version +Scanning dependencies of target reboot +Scanning dependencies of target error_code +[ 89%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_configuration.c.obj +[ 89%] Linking C static library libdfx_panic.a +[ 89%] Building C object utils/connectivity/CMakeFiles/connectivity_ssb.dir/common/acore/identity.c.obj +[ 89%] Building C object utils/error_code/CMakeFiles/error_code.dir/private/error_code.c.obj +[ 89%] Building C object utils/dfx/dfx_reboot/reboot/CMakeFiles/reboot.dir/shared/non_os_reboot.c.obj +[ 89%] Built target dfx_preserve +[ 90%] Built target lib_utils +[ 90%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_execute_command_authentication_commands.c.obj +[ 90%] Linking C static library liberror_code.a +[ 90%] Building C object utils/connectivity/CMakeFiles/connectivity_ssb.dir/common/acore/los_status.c.obj +[ 90%] Linking C static library libcpu_utils.a +[ 92%] Built target dfx_panic +[ 93%] Linking C static library libreboot.a +[ 93%] Linking C static library libconnectivity_ssb.a +[ 94%] Built target partition +[ 94%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_execute_command_control_commands.c.obj +[ 94%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_execute_command_flash_writing_commands.c.obj +Scanning dependencies of target sec_boot +[ 94%] Built target cpu_utils +/home/snicker/hiwatch/code/sdk/middleware/utils/codeloader/private/codeloader_execute_command_flash_writing_commands.c:882:57: warning: incompatible pointer to integer conversion assigning to 'uint32_t' (aka 'unsigned int') from 'uint8_t [16384]' [-Wint-conversion] +g_codeloader_data_save_position.load_start_addr = g_puya_sha256; +^ ~~~~~~~~~~~~~ +1 warning generated. +[ 94%] Generating NV_SRC +[ 94%] Built target connectivity_ssb +[ 96%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_execute_command_memory_commands.c.obj +[ 97%] Building C object utils/sec_boot/CMakeFiles/sec_boot.dir/src/sec_boot_fota.c.obj +[ 97%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_line_layer.c.obj +[ 97%] Building C object utils/sec_boot/CMakeFiles/sec_boot.dir/src/sec_boot_image_sign_validate.c.obj +[ 97%] Built target error_code +[ 97%] Built target reboot +[ 97%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_message_layer.c.obj +[ 97%] Building C object utils/sec_boot/CMakeFiles/sec_boot.dir/src/sec_boot_otp_write.c.obj +[ 97%] Building C object utils/sec_boot/CMakeFiles/sec_boot.dir/src/sec_boot_public.c.obj +[ 98%] Building C object utils/codeloader/CMakeFiles/codeloader.dir/private/codeloader_uart.c.obj +[100%] Building C object utils/sec_boot/CMakeFiles/sec_boot.dir/src/sec_boot_subkey_cert_validate.c.obj +[100%] Linking C static library libsec_boot.a +[100%] Linking C static library libcodeloader.a [100%] Built target sec_boot +[100%] Built target codeloader Scanning dependencies of target ssb [100%] Building C object CMakeFiles/ssb.dir/temp/__null___.c.obj [100%] Linking C executable ssb.elf @@ -114,33 +368,28 @@ Memory region Used Size Region Size %age Used BOOTUP_RAM: 184 B 348 B 52.87% VERSION: 88 B 88 B 100.00% CHANGE_ID: 8 B 16 B 50.00% -PROGRAM: 104576 B 130620 B 80.06% +PROGRAM: 73688 B 130620 B 56.41% SYSTEM_CLOCKS: 4 B 48 B 8.33% -DTCM: 85168 B 448 KB 18.57% +DTCM: 75240 B 448 KB 16.40% PRESERVE_RAM: 252 B 252 B 100.00% RSA_PUBLIC_KEY: 1 KB 1 KB 100.00% RSA_SIGNATURE: 512 B 512 B 100.00% RSA_RESULT: 512 B 512 B 100.00% [100%] Built target ssb -Scanning dependencies of target GENERAT_BIN -Scanning dependencies of target GENERAT_LST [100%] post_build:gen bin file [100%] Built target GENERAT_LST [100%] Built target GENERAT_BIN -Scanning dependencies of target ADD_SHA_TO_SSB [100%] add ssb length and sha256 info into ssb.bin [100%] Built target ADD_SHA_TO_SSB ######### Build target:brandy_ssb success -brandy-ssb takes 1.441368 s -output_path /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb -Start pack target pack_brandy_native_js -pack_target_path /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-ssb -current_target_file /home/snicker/hiwatch/code/sdk/output/currentbuild.txt +brandy-ssb takes 1.886285 s +Start pack target brandy-ssb copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.lst -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-ssb/ssb.lst copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.elf -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-ssb/ssb.elf copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.map -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-ssb/ssb.map copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-ssb/ssb.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/ssb.bin +Not searching for unused variables given on the command line. -- BUILD_PLATFORM: linux audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/vendor/../../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4_liteos_cfg.mak audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4_liteos_cfg.mak @@ -175,7 +424,7 @@ LOSCFG_TASK_JOINABLE is set to y LOSCFG_BASE_CORE_TSK_MONITOR is set to y LOSCFG_TASK_STACK_STATIC_ALLOCATION is set to y LOSCFG_TASK_STACK_DYNAMIC_ALLOCATION is set to y -LOSCFG_BASE_CORE_TSK_LIMIT is set to 48 +LOSCFG_BASE_CORE_TSK_LIMIT is set to 40 LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE is set to 1024 LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE is set to 2048 LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE is set to 2048 @@ -249,182 +498,676 @@ LOS_INTF_DEP_TARGETS:riscv_intf_pub;targets_intf_pub;base_intf_pub;init_intf_pub GEN_TARGET_SRC = /home/snicker/hiwatch/code/sdk/output/brandy/acore/acore.c PRECOMPILE_TARGET = /home/snicker/hiwatch/code/sdk/output/brandy/acore/acore.etypes TARGET_INCLUDE = /home/snicker/hiwatch/code/sdk/middleware/chips/brandy/nv/nv_config/include;/home/snicker/hiwatch/code/sdk/middleware/utils/common_headers/native +-- /home/snicker/hiwatch/code/sdk/middleware/services/gpu/api/rm/src/vau_stroke_dash.c is not found, finding libgfx_rm.a in /home/snicker/hiwatch/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-r -- /home/snicker/hiwatch/code/sdk/middleware/utils/fs/vfs/bcache/src/bcache.c is not found, finding libx_vfs_private.a in /home/snicker/hiwatch/code/sdk/middleware/utils/fs/vfs/brandy-native-js-r -- /home/snicker/hiwatch/code/sdk/middleware/utils/fs/yaffs2/os_adapt/mtd_nandcfg.c is not found, finding libfs_yaffs2.a in /home/snicker/hiwatch/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-r -- Configuring done -- Generating done -- Build files have been written to: /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r -[ 0%] Built target non_os +Scanning dependencies of target non_os [ 0%] Built target lzma_21.07 -[ 0%] Built target init [ 0%] Built target targets +[ 0%] Building C object kernel/non_os/non_os/CMakeFiles/non_os.dir/non_os_utils.c.obj +[ 0%] Built target init [ 1%] Built target riscv -[ 1%] Built target brandy_app_recovery [ 3%] Built target base -[ 3%] Built target csysdeps -[ 6%] Built target sec -[ 7%] Built target posix -[ 7%] Built target interrupt -[ 7%] Built target cmsis -[ 7%] Built target driverbase -[ 25%] Built target m -[ 26%] Built target linux -[ 26%] Built target x_dpal -[ 26%] Built target cpu_trace -[ 26%] Built target dma -[ 28%] Built target osal -[ 29%] Built target gpio -[ 29%] Built target flash -[ 29%] Built target i2c -[ 36%] Built target mbedtls -[ 36%] Built target memory_core -[ 36%] Built target lpc -[ 55%] Built target c -[ 55%] Built target ipc_old -[ 55%] Built target mipi_tx -[ 55%] Built target otp -[ 55%] Built target pmp -[ 56%] Built target nand_flash -[ 58%] Built target drv_mmc -[ 58%] Built target psram -[ 59%] Built target pinctrl -[ 60%] Built target qspi -[ 61%] Built target cipher -[ 61%] Built target km -[ 61%] Built target hash -[ 61%] Built target pke -[ 61%] Built target spi -[ 61%] Built target trng -[ 61%] Built target tcxo -[ 61%] Built target systick -[ 61%] Built target drv_timer -[ 61%] Built target uart +[ 3%] Linking C static library libnon_os.a +Scanning dependencies of target brandy_app_recovery +[ 5%] Built target posix +[ 6%] Built target csysdeps +[ 6%] Building C object application/brandy/brandy_recovery/CMakeFiles/brandy_app_recovery.dir/main.c.obj +[ 9%] Built target sec +[ 9%] Built target non_os +[ 9%] Building C object application/brandy/brandy_recovery/CMakeFiles/brandy_app_recovery.dir/app_os_init.c.obj +[ 9%] Built target interrupt +[ 27%] Built target m +[ 28%] Built target driverbase +[ 34%] Built target mbedtls +/home/snicker/hiwatch/code/sdk/application/brandy/brandy_recovery/app_os_init.c:111:13: warning: unused function 'emmc_init' [-Wunused-function] +static void emmc_init(void) +^ +1 warning generated. +[ 34%] Building C object application/brandy/brandy_recovery/CMakeFiles/brandy_app_recovery.dir/input_app.c.obj +[ 35%] Built target cmsis +[ 35%] Building C object application/brandy/brandy_recovery/CMakeFiles/brandy_app_recovery.dir/recovery_display.c.obj +[ 35%] Built target linux +/home/snicker/hiwatch/code/sdk/application/brandy/brandy_recovery/recovery_display.c:43:18: warning: unused function 'recovery_dispay_read_image_and_savein_surface' [-Wunused-function] +static errcode_t recovery_dispay_read_image_and_savein_surface(const char *path, ext_dpu_surface *surface) +^ +1 warning generated. +/home/snicker/hiwatch/code/sdk/application/brandy/brandy_recovery/input_app.c:502:13: warning: implicit declaration of function 'touch_info_process' is invalid in C99 [-Wimplicit-function-declaration] +touch_info_process(); +^ +/home/snicker/hiwatch/code/sdk/application/brandy/brandy_recovery/input_app.c:503:13: warning: implicit declaration of function 'uapi_pm_add_sleep_veto_with_timeout' is invalid in C99 [-Wimplicit-function-declaration] +uapi_pm_add_sleep_veto_with_timeout(PM_ID_TOUCH, TOUCH_VETO_SLEEP_MS); +^ +2 warnings generated. +[ 35%] Built target x_dpal +[ 35%] Built target dma +Scanning dependencies of target cpu_trace +Scanning dependencies of target osal +[ 35%] Linking C static library libbrandy_app_recovery.a +[ 53%] Built target c +[ 53%] Building C object driver/cpu_trace/CMakeFiles/cpu_trace.dir/cpu_trace.c.obj +Scanning dependencies of target flash +[ 54%] Built target gpio +[ 54%] Building C object kernel/osal/CMakeFiles/osal.dir/adapt/liteos/oal_onetrack.c.obj +[ 54%] Building C object driver/flash/CMakeFiles/flash.dir/flash.c.obj +[ 54%] Linking C static library libcpu_trace.a +[ 54%] Built target brandy_app_recovery +Scanning dependencies of target ipc_old +Scanning dependencies of target i2c +[ 54%] Linking C static library libosal.a +Scanning dependencies of target memory_core +[ 54%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/acore/ipc_irq.c.obj +[ 54%] Building C object driver/memory_core/CMakeFiles/memory_core.dir/shared/memory_core.c.obj +[ 54%] Building C object driver/i2c/CMakeFiles/i2c.dir/i2c.c.obj +Scanning dependencies of target lpc +[ 55%] Linking C static library libmemory_core.a +[ 55%] Linking C static library libflash.a +[ 55%] Building C object driver/lpc/CMakeFiles/lpc.dir/acore/lpc_core.c.obj +[ 55%] Built target cpu_trace +Scanning dependencies of target lcd +[ 55%] Linking C static library libi2c.a +[ 55%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/shared/ipc.c.obj +[ 55%] Building C object driver/lpc/CMakeFiles/lpc.dir/shared/lpc.c.obj +Scanning dependencies of target mipi_tx +[ 55%] Built target memory_core +[ 56%] Built target osal +[ 56%] Built target i2c +[ 56%] Built target flash +[ 56%] Linking C static library libipc_old.a +[ 56%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_bus.c.obj +[ 56%] Linking C static library liblpc.a +[ 56%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_qspi.c.obj +[ 56%] Building C object driver/mipi/CMakeFiles/mipi_tx.dir/shared/mipi_tx.c.obj +[ 56%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_mipi.c.obj +[ 56%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_common.c.obj +Scanning dependencies of target otp +[ 56%] Linking C static library libmipi_tx.a +[ 56%] Built target lpc +[ 56%] Built target ipc_old +[ 57%] Building C object driver/otp/CMakeFiles/otp.dir/otp.c.obj +Scanning dependencies of target drv_mmc +[ 57%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_config.c.obj +[ 57%] Built target pmp +Scanning dependencies of target nand_flash +[ 57%] Built target mipi_tx +[ 57%] Linking C static library libotp.a +Scanning dependencies of target psram +[ 57%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_ds35x1g.c.obj +Scanning dependencies of target qspi +[ 57%] Building C object driver/mmc/CMakeFiles/drv_mmc.dir/core/block.c.obj +[ 57%] Building C object driver/lcd/CMakeFiles/lcd.dir/soc_lcd_api.c.obj +[ 57%] Building C object driver/psram/CMakeFiles/psram.dir/psram_drv.c.obj +[ 57%] Built target pinctrl +[ 57%] Built target otp +[ 57%] Building C object driver/qspi/CMakeFiles/qspi.dir/qspi.c.obj +[ 57%] Building C object driver/mmc/CMakeFiles/drv_mmc.dir/host/sdhci/brandy/mmc_sdhci.c.obj +[ 58%] Linking C static library liblcd.a +[ 58%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_tc58cyg.c.obj +[ 58%] Linking C static library libpsram.a +[ 58%] Built target cipher +[ 58%] Linking C static library libqspi.a +[ 58%] Built target hash +[ 58%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_w25n01g.c.obj +[ 59%] Built target km +[ 59%] Built target lcd +[ 59%] Built target psram +[ 59%] Linking C static library libdrv_mmc.a +[ 59%] Built target qspi +[ 59%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_config.c.obj +[ 59%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/hal_nandflash.c.obj +Scanning dependencies of target trng +[ 59%] Built target pke +[ 59%] Building C object driver/security/trng/CMakeFiles/trng.dir/drv_trng.c.obj +Scanning dependencies of target systick +[ 59%] Built target spi +[ 59%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_to_os.c.obj +[ 59%] Built target tcxo +[ 59%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_qspi.c.obj +[ 60%] Building C object driver/systick/CMakeFiles/systick.dir/systick.c.obj +[ 60%] Linking C static library libtrng.a +[ 60%] Built target drv_timer +[ 61%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash.c.obj +[ 61%] Linking C static library libsystick.a +[ 61%] Linking C static library libnand_flash.a +Scanning dependencies of target ulp_aon +[ 61%] Building C object driver/ulp_aon/CMakeFiles/ulp_aon.dir/ulp_aon_control.c.obj +Scanning dependencies of target uart +[ 63%] Built target drv_mmc +[ 63%] Built target trng +[ 63%] Building C object driver/uart/CMakeFiles/uart.dir/uart.c.obj +[ 63%] Linking C static library libulp_aon.a +[ 63%] Built target systick +[ 63%] Linking C static library libuart.a +Scanning dependencies of target qspi_display [ 63%] Built target watchdog -[ 64%] Built target ulp_aon -[ 64%] Built target rtc_unified -[ 64%] Built target qspi_display -[ 64%] Built target efuse +Scanning dependencies of target touch +[ 63%] Built target mtd_com +[ 63%] Building C object driver/qspi_display/CMakeFiles/qspi_display.dir/qspi_display.c.obj +[ 63%] Built target nand_flash +Scanning dependencies of target button +[ 63%] Building C object driver/touch/CMakeFiles/touch.dir/touch_screen_drv.c.obj +[ 63%] Built target uart +[ 63%] Building C object driver/touch/CMakeFiles/touch.dir/touch_screen_queue1.c.obj +[ 63%] Built target ulp_aon +[ 63%] Linking C static library libqspi_display.a [ 64%] Built target hal_cpu_core -[ 64%] Built target hal_cpu_trace -[ 64%] Built target mtd_com -[ 64%] Built target hal_l2ram +[ 64%] Building C object driver/button/CMakeFiles/button.dir/button.c.obj +Scanning dependencies of target efuse +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:431:5: warning: implicit declaration of function 'uapi_gpio_disable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:436:5: warning: implicit declaration of function 'uapi_gpio_disable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:448:5: warning: implicit declaration of function 'uapi_gpio_enable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_enable_interrupt(TOUCH_INT_GPIO); // open tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:472:5: warning: implicit declaration of function 'uapi_gpio_enable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_enable_interrupt(TOUCH_INT_GPIO); // open tp_int gpio interrupt +^ +4 warnings generated. +Scanning dependencies of target hal_cpu_trace +[ 64%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_ctrl.c.obj +Scanning dependencies of target rtc_unified +[ 64%] Building C object driver/efuse/CMakeFiles/efuse.dir/efuse.c.obj +[ 64%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_drv1.c.obj +[ 64%] Linking C static library libbutton.a +[ 64%] Built target qspi_display +[ 64%] Building C object hal/cpu_trace/CMakeFiles/hal_cpu_trace.dir/hal_cpu_trace.c.obj [ 64%] Built target hal_dma_v100 -[ 64%] Built target hal_ipc_old -[ 64%] Built target hal_gpio_v100 +[ 64%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_touch1.c.obj +[ 64%] Linking C static library libefuse.a +[ 64%] Building C object driver/rtc_unified/CMakeFiles/rtc_unified.dir/rtc.c.obj +[ 64%] Linking C static library libhal_cpu_trace.a +[ 65%] Built target hal_gpio_v100 +Scanning dependencies of target hal_ipc_old +[ 65%] Linking C static library libtouch.a +[ 65%] Built target button +[ 65%] Linking C static library librtc_unified.a +[ 65%] Building C object hal/ipc/CMakeFiles/hal_ipc_old.dir/hal_ipc_old/hal_ipc.c.obj +[ 65%] Built target hal_i2c +Scanning dependencies of target hal_lpc +[ 65%] Built target efuse +[ 65%] Built target hal_cpu_trace +Scanning dependencies of target hal_l2ram +[ 65%] Building C object hal/lpc/CMakeFiles/hal_lpc.dir/hal_lpc.c.obj +[ 65%] Linking C static library libhal_ipc_old.a +[ 65%] Built target touch +[ 65%] Building C object hal/l2ram/CMakeFiles/hal_l2ram.dir/hal_l2ram_private.c.obj +[ 65%] Linking C static library libhal_lpc.a +[ 65%] Built target hal_pinctrl +[ 65%] Built target rtc_unified +Scanning dependencies of target hal_otp +Scanning dependencies of target hal_mipi +[ 65%] Built target hal_ipc_old +[ 65%] Linking C static library libhal_l2ram.a +Scanning dependencies of target hal_qspi +[ 65%] Building C object hal/otp/CMakeFiles/hal_otp.dir/brandy/hal_otp.c.obj [ 65%] Built target hal_lpc -[ 66%] Built target hal_i2c -[ 66%] Built target hal_mipi +Scanning dependencies of target hal_reboot +[ 65%] Built target hal_pmp +[ 65%] Building C object hal/qspi/CMakeFiles/hal_qspi.dir/hal_qspi.c.obj +[ 65%] Building C object hal/mipi/CMakeFiles/hal_mipi.dir/hal_mipi_tx.c.obj +[ 65%] Building C object hal/reboot/CMakeFiles/hal_reboot.dir/hal_reboot.c.obj +Scanning dependencies of target hal_reg_config +Scanning dependencies of target hal_sectors +[ 65%] Linking C static library libhal_otp.a +[ 65%] Building C object hal/reg_config/CMakeFiles/hal_reg_config.dir/hal_reg_config.c.obj +[ 65%] Linking C static library libhal_qspi.a +[ 65%] Linking C static library libhal_mipi.a +[ 65%] Building C object hal/sectors/CMakeFiles/hal_sectors.dir/hal_sectors.c.obj +[ 65%] Built target hal_cipher +[ 65%] Built target hal_l2ram +[ 66%] Linking C static library libhal_reg_config.a +[ 66%] Linking C static library libhal_reboot.a [ 66%] Built target hal_otp -[ 66%] Built target hal_reg_config -[ 67%] Built target hal_sectors -[ 68%] Built target hal_pmp -[ 68%] Built target hal_qspi -[ 68%] Built target hal_pinctrl -[ 68%] Built target hal_reboot -[ 68%] Built target hal_cipher -[ 68%] Built target hal_hash -[ 68%] Built target hal_km -[ 68%] Built target hal_systick -[ 69%] Built target hal_efuse_v100 -[ 69%] Built target hal_trng -[ 69%] Built target hal_pke +[ 66%] Linking C static library libhal_sectors.a +[ 66%] Built target hal_qspi +[ 67%] Built target hal_km +[ 67%] Built target hal_mipi +[ 67%] Built target hal_hash +[ 67%] Built target hal_reg_config +[ 67%] Built target hal_reboot +[ 68%] Built target hal_pke +Scanning dependencies of target hal_systick +Scanning dependencies of target hal_efuse_v100 +[ 68%] Built target hal_trng +[ 68%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150.c.obj +[ 68%] Built target hal_spi [ 69%] Built target hal_tcxo -[ 69%] Built target hal_spi -[ 70%] Built target hal_timer -[ 70%] Built target hal_uart +[ 69%] Built target hal_sectors +[ 69%] Built target hal_timer +[ 69%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150_regs_op.c.obj +[ 69%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100.c.obj +[ 69%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100_reg_op.c.obj +[ 69%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/hal_efuse.c.obj +Scanning dependencies of target hal_xip +Scanning dependencies of target hal_uart +Scanning dependencies of target hal_rtc_unified +[ 69%] Linking C static library libhal_systick.a +[ 69%] Built target hal_watchdog +[ 69%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip.c.obj +[ 70%] Building C object hal/uart/CMakeFiles/hal_uart.dir/hal_uart.c.obj +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/xip/hal_xip.c:24:13: warning: unused function 'hal_xip_auto' [-Wunused-function] +static void hal_xip_auto(bool en) +^ +1 warning generated. +[ 70%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/hal_rtc.c.obj +[ 70%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip_v150_regs_op.c.obj +[ 70%] Linking C static library libhal_efuse_v100.a +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:13:11: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_comm_regs = NULL; +^ ~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:14:45: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_regs[CONFIG_RTC_MAX_NUM] = {NULL}; +^~~~ +/home/snicker/hiwatch/code/sdk/kernel/liteos/liteos_v207.1.0/Huawei_LiteOS/open_source/musl/include/stddef.h:9:14: note: expanded from macro 'NULL' +#define NULL ((void*)0) +^~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:31:23: warning: incompatible pointer to integer conversion assigning to 'uintptr_t' (aka 'unsigned int') from 'void *' [-Wint-conversion] +g_rtc_regs[index] = NULL; +^ ~~~~ +3 warnings generated. +Scanning dependencies of target chip_brandy +[ 70%] Built target hal_systick +[ 70%] Linking C static library libhal_xip.a +[ 70%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/v100/hal_rtc_v100.c.obj +[ 70%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt.c.obj +Scanning dependencies of target brandy_clocks +[ 70%] Linking C static library libhal_rtc_unified.a +Scanning dependencies of target gpio_port +[ 70%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120_regs_op.c.obj +Scanning dependencies of target pmu_brandy +[ 70%] Built target hal_efuse_v100 +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks_config_priv.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt_handler.c.obj [ 70%] Built target hal_xip -[ 71%] Built target hal_watchdog -[ 71%] Built target hal_rtc_unified -[ 71%] Built target gpio_port -[ 72%] Built target brandy_clocks -[ 72%] Built target chip_brandy -[ 72%] Built target liteos_port -[ 72%] Built target cipher_port -[ 72%] Built target pmu_brandy +[ 70%] Building C object drivers/chips/brandy/porting/gpio/CMakeFiles/gpio_port.dir/gpio_porting.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_cmu.c.obj +[ 70%] Linking C static library libhal_uart.a +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/interrupt/vectors.c.obj +[ 70%] Built target hal_rtc_unified +[ 70%] Built target cipher_port +[ 70%] Linking C static library libgpio_port.a +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks.c.obj +Scanning dependencies of target liteos_port +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/config/pmp_config.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_interrupt.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/oam_trace.c.obj +[ 70%] Building C object drivers/chips/brandy/porting/liteos/CMakeFiles/liteos_port.dir/riscv70/idle_config.c.obj +[ 70%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app_priv.c.obj +[ 70%] Built target hal_uart +[ 71%] Building C object drivers/chips/brandy/porting/liteos/CMakeFiles/liteos_port.dir/riscv70/tick_timer.c.obj [ 72%] Built target hash_port -[ 73%] Built target km_port +[ 72%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_ldo.c.obj +[ 72%] Built target gpio_port +[ 72%] Linking C static library libchip_brandy.a +[ 72%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_glb.c.obj +[ 72%] Built target km_port +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_sdio.c.obj +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/shared/pmu.c.obj +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_cmu.c.obj [ 73%] Built target pke_port -[ 73%] Built target efuse_porting [ 73%] Built target trng_port -[ 73%] Built target timer_port -[ 73%] Built target tcxo_port -[ 75%] Built target systick_port -[ 75%] Built target watchdog_port -[ 75%] Built target uart_port -[ 77%] Built target pmp_port -[ 77%] Built target xip_port -[ 78%] Built target i2c_porting -[ 78%] Built target dma_port -[ 79%] Built target port_pinctrl -[ 79%] Built target spi_porting -[ 79%] Built target rtc_unified_port -[ 79%] Built target flash_porting -[ 79%] Built target lcd -[ 79%] Built target dfx_exception -[ 80%] Built target touch +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks.c.obj +[ 73%] Linking C static library libliteos_port.a +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_cpu_clocks.c.obj +[ 73%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_interrupt.c.obj +[ 75%] Built target chip_brandy +Scanning dependencies of target efuse_porting +[ 75%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_peripheral_app.c.obj +[ 75%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch_priv.c.obj +[ 75%] Building C object drivers/chips/brandy/porting/security/efuse/CMakeFiles/efuse_porting.dir/efuse_porting.c.obj +[ 76%] Built target timer_port +[ 76%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_core.c.obj +[ 76%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clock_calibration.c.obj +Scanning dependencies of target uart_port +[ 76%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch.c.obj +[ 76%] Linking C static library libpmu_brandy.a +[ 76%] Built target liteos_port +[ 76%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clocks_core_common.c.obj +[ 76%] Linking C static library libefuse_porting.a +[ 77%] Building C object drivers/chips/brandy/porting/uart/CMakeFiles/uart_port.dir/uart_porting.c.obj +Scanning dependencies of target systick_port +[ 77%] Linking C static library libbrandy_clocks.a +[ 77%] Built target tcxo_port +Scanning dependencies of target watchdog_port +[ 77%] Linking C static library libuart_port.a +[ 77%] Building C object drivers/chips/brandy/porting/systick/CMakeFiles/systick_port.dir/systick_porting.c.obj +[ 77%] Building C object drivers/chips/brandy/porting/watchdog/CMakeFiles/watchdog_port.dir/watchdog_porting.c.obj +[ 77%] Built target port_pinctrl +[ 77%] Built target efuse_porting +Scanning dependencies of target xip_port +[ 77%] Linking C static library libwatchdog_port.a +[ 78%] Built target pmu_brandy +[ 78%] Built target uart_port +[ 78%] Building C object drivers/chips/brandy/porting/xip/CMakeFiles/xip_port.dir/xip_porting.c.obj +[ 78%] Linking C static library libsystick_port.a +[ 78%] Built target brandy_clocks +[ 78%] Built target pmp_port +Scanning dependencies of target i2c_porting +[ 79%] Linking C static library libxip_port.a +Scanning dependencies of target flash_porting +Scanning dependencies of target spi_porting +Scanning dependencies of target rtc_unified_port +[ 79%] Building C object drivers/chips/brandy/porting/i2c/CMakeFiles/i2c_porting.dir/i2c_porting.c.obj +[ 79%] Building C object drivers/chips/brandy/porting/flash/CMakeFiles/flash_porting.dir/flash_porting.c.obj +[ 79%] Built target watchdog_port +[ 79%] Building C object drivers/chips/brandy/porting/spi/CMakeFiles/spi_porting.dir/spi_porting.c.obj +Scanning dependencies of target dma_port +[ 79%] Built target systick_port +[ 79%] Building C object drivers/chips/brandy/porting/rtc_unified/CMakeFiles/rtc_unified_port.dir/rtc_porting.c.obj +[ 79%] Linking C static library libflash_porting.a +/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/spi/spi_porting.c:468:47: warning: unused parameter 'clk_in_mhz' [-Wunused-parameter] +bool hal_opi_set_freq(spi_bus_t bus, uint32_t clk_in_mhz) +^ +1 warning generated. +[ 79%] Linking C static library libi2c_porting.a +[ 79%] Building C object drivers/chips/brandy/porting/dma/CMakeFiles/dma_port.dir/dma_porting.c.obj +[ 79%] Linking C static library librtc_unified_port.a +[ 79%] Built target xip_port +[ 79%] Linking C static library libspi_porting.a Scanning dependencies of target button_port -[ 81%] Built target button -[ 81%] Built target dfx_port_brandy -[ 82%] Built target pm_brandy -[ 82%] Building C object drivers/chips/brandy/porting/button/CMakeFiles/button_port.dir/button_porting.c.obj -[ 82%] Built target pm_service -[ 82%] Built target partition_brandy -[ 82%] Built target update_common_brandy -[ 82%] Built target app_version -[ 83%] Built target algorithm -[ 83%] Built target at_cmd -[ 83%] Built target build_version -[ 83%] Built target cpu_load -[ 84%] Built target connectivity -[ 85%] Built target dfx_preserve -[ 85%] Built target dfx_panic -[ 86%] Built target log_file -[ 86%] Built target soc_log -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:95:5: warning: implicit declaration of function 'uapi_tcxo_delay_ms' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_ms(cali_ms); +Scanning dependencies of target dfx_exception +[ 79%] Building C object middleware/chips/brandy/exception/CMakeFiles/dfx_exception.dir/exception_riscv.c.obj +[ 79%] Built target i2c_porting +[ 79%] Linking C static library libdma_port.a +[ 79%] Built target flash_porting +[ 79%] Building C object drivers/chips/brandy/porting/button/CMakeFiles/button_port.dir/button_porting.c.obj +[ 79%] Built target rtc_unified_port +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/exception/exception_riscv.c:975:5: warning: implicit declaration of function 'nandflash_yaffs_sync' is invalid in C99 [-Wimplicit-function-declaration] +nandflash_yaffs_sync(); ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:265:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +1 warning generated. +[ 79%] Built target spi_porting +[ 80%] Linking C static library libbutton_port.a +[ 80%] Built target dma_port +[ 80%] Built target partition_brandy +[ 80%] Linking C static library libdfx_exception.a +Scanning dependencies of target pm_service +Scanning dependencies of target update_common_brandy +[ 80%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_dev.c.obj +[ 80%] Built target button_port +Scanning dependencies of target dfx_port_brandy +[ 80%] Building C object middleware/chips/brandy/update/common/CMakeFiles/update_common_brandy.dir/upg_common_porting.c.obj +Scanning dependencies of target algorithm +[ 80%] Built target dfx_exception +[ 80%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_fsm.c.obj +Scanning dependencies of target pm_brandy +[ 81%] Building C object utils/algorithm/CMakeFiles/algorithm.dir/sec_random/sec_random.c.obj +[ 81%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/dfx_channel.c.obj +Scanning dependencies of target app_version +[ 81%] Linking C static library libupdate_common_brandy.a +Scanning dependencies of target build_version +[ 81%] Linking C static library libalgorithm.a +[ 81%] Building C object utils/app_version/CMakeFiles/app_version.dir/private/application_version.c.obj +[ 81%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_clocks.c.obj +[ 81%] Building C object utils/build_version/CMakeFiles/build_version.dir/private/build_version.c.obj +[ 81%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_sleep.c.obj +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:96:52: warning: unused parameter 'fd' [-Wunused-parameter] +static errcode_t diag_channel_bt_gatt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:269:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:96:72: warning: unused parameter 'data_type' [-Wunused-parameter] +static errcode_t diag_channel_bt_gatt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:273:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:97:13: warning: unused parameter 'cnt' [-Wunused-parameter] +uint8_t cnt) ^ -4 warnings generated. -[ 89%] Built target dfx_log -[ 88%] Built target cpu_utils -[ 89%] Built target reboot -[ 92%] Linking C static library libbutton_port.a -[ 92%] Built target dfx_diag -[ 92%] Built target dfx_update -[ 93%] Built target x_fat -[ 93%] Built target x_disk -[ 93%] Built target partition -[ 94%] Built target diag_dfx_cmd -[ 94%] Built target button_port -[ 94%] Generating NV_SRC -[ 94%] Built target lib_utils -[ 94%] Built target update_common -[ 94%] Built target update_local -[100%] Built target x_vfs +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:116:15: warning: unused parameter 'status' [-Wunused-parameter] +errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:44:13: warning: unused function 'diag_channel_rx_bt_data' [-Wunused-function] +static void diag_channel_rx_bt_data(uint8_t *data, uint16_t size) +^ +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:63:18: warning: unused function 'diag_channel_bt_output' [-Wunused-function] +static errcode_t diag_channel_bt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], +^ +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:84:13: warning: unused function 'diag_channel_register_bt_callback' [-Wunused-function] +static void diag_channel_register_bt_callback(void) +^ +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:96:18: warning: unused function 'diag_channel_bt_gatt_output' [-Wunused-function] +static errcode_t diag_channel_bt_gatt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], +^ +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:124:13: warning: unused function 'diag_channel_register_bt_gatt_callback' [-Wunused-function] +static void diag_channel_register_bt_gatt_callback(void) +^ +9 warnings generated. +[ 81%] Built target update_common_brandy +[ 82%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_config.c.obj +[ 82%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/dfx_system_init.c.obj +[ 82%] Linking C static library libbuild_version.a +[ 82%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_sys.c.obj +[ 82%] Linking C static library libapp_version.a +[ 82%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_control.c.obj +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_system_init.c:228:13: warning: unused function 'cmd_shell_proc' [-Wunused-function] +static void cmd_shell_proc(uint8_t *data, uint32_t data_len) +^ +1 warning generated. +[ 82%] Built target algorithm +[ 82%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/last_dump_adapt.c.obj +Scanning dependencies of target connectivity +[ 82%] Built target build_version +[ 83%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/sample_data_adapt.c.obj +[ 83%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_core.c.obj +[ 83%] Built target app_version +[ 84%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_tickless.c.obj +[ 84%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/zdiag_adapt_sdt.c.obj +Scanning dependencies of target cpu_load +[ 84%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_lp_stub.c.obj +[ 84%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/connectivity_calibration.c.obj +[ 84%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/shared/connectivity_log.c.obj +[ 84%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_veto.c.obj +[ 84%] Building C object utils/cpu_load/CMakeFiles/cpu_load.dir/private/cpu_load.c.obj +[ 84%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_lpc.c.obj +[ 84%] Linking C static library libdfx_port_brandy.a +[ 84%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/identity.c.obj +[ 84%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/los_status.c.obj +[ 84%] Linking C static library libcpu_load.a +[ 84%] Linking C static library libpm_service.a +[ 84%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_os.c.obj +[ 84%] Built target dfx_port_brandy +[ 84%] Built target pm_service +[ 84%] Linking C static library libconnectivity.a +[ 84%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_pmu.c.obj +[ 84%] Built target cpu_load +Scanning dependencies of target gpu +[ 84%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm.c.obj +Scanning dependencies of target dfx_preserve +[ 84%] Linking C static library libpm_brandy.a +[ 84%] Built target connectivity +[ 84%] Building C object utils/dfx/CMakeFiles/dfx_preserve.dir/preserve/private/preserve.c.obj +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/dpu/soc_dpu_api.c.obj +Scanning dependencies of target soc_log +[ 84%] Building C object utils/dfx/CMakeFiles/soc_log.dir/soc_log/soc_log.c.obj +[ 84%] Linking C static library libdfx_preserve.a +Scanning dependencies of target dfx_panic +Scanning dependencies of target log_file +[ 84%] Built target pm_brandy +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/soc_vau_api.c.obj +[ 84%] Building C object utils/dfx/CMakeFiles/soc_log.dir/soc_log/soc_log_uart_instance.c.obj +[ 84%] Building C object utils/dfx/CMakeFiles/dfx_panic.dir/panic/private/panic.c.obj +[ 84%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file.c.obj +[ 84%] Linking C static library libsoc_log.a +Scanning dependencies of target cpu_utils +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_draw.c.obj +[ 84%] Building C object utils/dfx/dfx_reboot/cpu_utils/CMakeFiles/cpu_utils.dir/private/cpu_utils.c.obj +[ 84%] Built target dfx_preserve +[ 84%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file_file.c.obj +[ 84%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file_flash.c.obj +[ 84%] Linking C static library libdfx_panic.a +[ 84%] Linking C static library libcpu_utils.a +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_utility.c.obj +[ 84%] Built target soc_log +[ 84%] Linking C static library liblog_file.a +Scanning dependencies of target reboot +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/matrix/vau_matrix.c.obj +Scanning dependencies of target dfx_diag +[ 84%] Built target dfx_panic +[ 84%] Built target log_file +[ 84%] Built target cpu_utils +[ 84%] Building C object utils/dfx/dfx_reboot/reboot/CMakeFiles/reboot.dir/shared/non_os_reboot.c.obj +[ 84%] Linking C static library libreboot.a +[ 84%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/compress/vau_compress.c.obj +[ 84%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_debug.c.obj +Scanning dependencies of target dfx_log +Scanning dependencies of target dfx_update +[ 85%] Built target x_fat +[ 85%] Building C object utils/dfx/diag_dfx_cmd/diag_update/CMakeFiles/dfx_update.dir/diag_update.c.obj +[ 85%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/debug/vau_debug.c.obj +Scanning dependencies of target dfx_file_operation +[ 85%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log.c.obj +[ 85%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_pkt.c.obj +[ 85%] Built target reboot +[ 85%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/intf/drv_dpu_intf.c.obj +[ 85%] Building C object utils/dfx/file_operation/CMakeFiles/dfx_file_operation.dir/dfx_file_operation.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_update/diag_update.c:71:13: warning: implicit declaration of function 'upg_reboot' is invalid in C99 [-Wimplicit-function-declaration] +upg_reboot(); +^ +1 warning generated. +[ 85%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_logger.c.obj +[ 85%] Linking C static library libdfx_update.a +[ 85%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/ioctl/dpu_ioctl.c.obj +[ 86%] Linking C static library libdfx_file_operation.a +[ 86%] Built target x_disk +[ 86%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_mem.c.obj +[ 86%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/layer/dpu_layer.c.obj +[ 86%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_mem_query.c.obj +[ 86%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_msg.c.obj +[ 86%] Built target dfx_file_operation +Scanning dependencies of target diag_dfx_cmd +[ 88%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/disp/dpu_disp.c.obj +[ 88%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_ota.c.obj +[ 88%] Built target dfx_update +[ 88%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_tx.c.obj +[ 88%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_beat_heart.c.obj +[ 88%] Built target partition +[ 88%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_pcm.c.obj +[ 88%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/clock/dpu_clock.c.obj +[ 93%] Built target x_vfs +[ 93%] Built target lib_utils +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag/diag_tx.c:16:17: warning: unused function 'diag_alloc_pkt_buffer' [-Wunused-function] +STATIC uint8_t *diag_alloc_pkt_buffer(diag_pkt_handle_t *pkt) +^ +1 warning generated. +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/isr/dpu_isr.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_reg_query.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_rx_api.c.obj +[ 93%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_connect.c.obj +[ 93%] Generating NV_SRC +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/dfx/dpu_dfx.c.obj +Scanning dependencies of target update_common +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_status.c.obj +Scanning dependencies of target update_local +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal.c.obj +[ 93%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_filter.c.obj +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_crg.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_channel.c.obj +[ 93%] Building C object utils/update/common/CMakeFiles/update_common.dir/upg_common.c.obj +[ 93%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_patch.c.obj +[ 93%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_mem_info.c.obj +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_disp.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_pkt_router.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_dscr_cb.c.obj +[ 93%] Building C object utils/update/common/CMakeFiles/update_common.dir/upg_verify.c.obj +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_layer.c.obj +[ 93%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_process.c.obj +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/qspi/dpu_qspi.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oml_ota_rom.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oml_exception.c.obj +[ 93%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_task_info.c.obj +[ 93%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_dfx.c.obj +[ 93%] Linking C static library libupdate_common.a +[ 93%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_resource.c.obj +[ 93%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_res_info.c.obj +[ 93%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/dfx/vau_dfx.c.obj +[ 94%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_upgrade.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_stat.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_printf.c.obj +[ 95%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/drv_vau_intf.c.obj +[ 95%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/vau_pre_process.c.obj +[ 95%] Linking C static library libupdate_local.a +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_printf_rom.c.obj +[ 95%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_init_info.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_service.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_filter.c.obj +[ 95%] Built target update_common +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_reg_dump.c.obj +[ 95%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_cpup.c.obj +[ 95%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/ioctl/vau_ioctl.c.obj +[ 95%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_password.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_dispatch.c.obj +[ 95%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_stat.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_system_cmd/diag_cmd_get_cpup.c:100:44: warning: implicit declaration of function 'dfx_os_task_status_convert_str' is invalid in C99 [-Wimplicit-function-declaration] +info->task_info->priority, dfx_os_task_status_convert_str(info->task_info->status), +^ +1 warning generated. +[ 95%] Built target update_local +[ 95%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/isr/vau_isr.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_trigger.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_dst.c.obj +[ 95%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_mocked_shell/diag_mocked_shell.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_src.c.obj +[ 95%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_ind_dst.c.obj +[ 96%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_reader/private/log_oam_msg.c.obj +[ 96%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/last_dump/last_dump.c.obj +[ 96%] Built target nv_config_brandy +[ 96%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_ind_src.c.obj +[ 96%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_buffer.c.obj +[ 96%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_cmd_ls.c.obj +[ 96%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/job/vau_job.c.obj +[ 97%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_list.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_cmd_delete_file.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit.c.obj +[ 97%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/sample_data/sample_data.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_buffer_reader.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_send_recv_pkt.c.obj +[ 97%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_handle.c.obj +[ 97%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/mem/vau_mem.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_memory_region.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_item.c.obj +[ 97%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_resume.c.obj +[ 97%] Linking C static library libdiag_dfx_cmd.a +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_dst.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/node/vau_node.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_memory_section.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_reader/private/log_uart.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_src.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_write_read.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_api.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_apb.c.obj +[ 98%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_debug.c.obj +[ 98%] Linking C static library libdfx_log.a +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_affine.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_capability.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_node.c.obj +[ 98%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_vector_draw.c.obj +[100%] Built target diag_dfx_cmd +[100%] Linking C static library libdfx_diag.a +[100%] Linking C static library ../../../../../../interim_binary/brandy/libs/gpu/evb_recovery/libgpu.a +[100%] Built target dfx_log +[100%] Built target dfx_diag +[100%] Built target gpu Scanning dependencies of target recovery [100%] Building C object CMakeFiles/recovery.dir/temp/__null___.c.obj -[100%] Built target nv_config_brandy [100%] Linking C executable recovery.elf Generating /home/snicker/hiwatch/code/sdk/drivers/boards/brandy_evb/linker/recovery/acore.prelds -> /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/linker.lds Memory region Used Size Region Size %age Used BOOTUP_RAM: 372 B 436 B 85.32% BOOTUP_LOAD: 372 B 436 B 85.32% FLASH_VERSION: 0 GB 88 B 0.00% -FLASH_PROGRAM: 186916 B 259992 B 71.89% +FLASH_PROGRAM: 235140 B 259992 B 90.44% PSRAM_PROGRAM: 0 GB 32 MB 0.00% PSRAM_HEAP: 0 GB 7 MB 0.00% L2M_GPU_PROGRAM: 0 GB 0 GB -L2M_DSP_PROGRAM: 0 GB 640 KB 0.00% -ITCM: 91204 B 196172 B 46.49% -DTCM: 61752 B 436 KB 13.83% +L2M_DSP_PROGRAM: 0 GB 1280 KB 0.00% +ITCM: 107772 B 196172 B 54.94% +DTCM: 66576 B 436 KB 14.91% IPC_SHARE_MEM: 18528 B 18528 B 100.00% PRESERVE_SHARE_MEM: 252 B 252 B 100.00% CPUTRACE_RAM: 8184 B 8184 B 100.00% @@ -433,16 +1176,14 @@ CPUTRACE_RAM: 8184 B 8184 B 100.00% [100%] Built target GENERAT_LST [100%] Built target GENERAT_BIN ######### Build target:brandy_native_js_r success -brandy-native-js-r takes 3.662144 s -output_path /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r -Start pack target pack_brandy_native_js -pack_target_path /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js-r -current_target_file /home/snicker/hiwatch/code/sdk/output/currentbuild.txt +brandy-native-js-r takes 4.060818 s +Start pack target brandy-native-js-r copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.elf -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js-r/recovery.elf copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js-r/recovery.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/recovery.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.lst -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js-r/recovery.lst copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.map -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js-r/recovery.map +Not searching for unused variables given on the command line. -- BUILD_PLATFORM: linux audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/vendor/../../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4max_liteos_cfg.mak audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/application/audio/../../drivers/drivers/driver/audio/source/build/configs/brandy/brandy_evb4max_liteos_cfg.mak @@ -478,7 +1219,7 @@ LOSCFG_TASK_JOINABLE is set to y LOSCFG_BASE_CORE_TSK_MONITOR is set to y LOSCFG_TASK_STACK_STATIC_ALLOCATION is set to y LOSCFG_TASK_STACK_DYNAMIC_ALLOCATION is set to y -LOSCFG_BASE_CORE_TSK_LIMIT is set to 48 +LOSCFG_BASE_CORE_TSK_LIMIT is set to 40 LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE is set to 1024 LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE is set to 2048 LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE is set to 2048 @@ -555,6 +1296,7 @@ audio SAP_CFGFILE = /home/snicker/hiwatch/code/sdk/drivers/drivers/driver/audio/ GEN_TARGET_SRC = /home/snicker/hiwatch/code/sdk/output/brandy/acore/acore.c PRECOMPILE_TARGET = /home/snicker/hiwatch/code/sdk/output/brandy/acore/acore.etypes TARGET_INCLUDE = /home/snicker/hiwatch/code/sdk/middleware/chips/brandy/nv/nv_config/include;/home/snicker/hiwatch/code/sdk/middleware/utils/common_headers/native +-- /home/snicker/hiwatch/code/sdk/middleware/services/gpu/api/rm/src/vau_stroke_dash.c is not found, finding libgfx_rm.a in /home/snicker/hiwatch/code/sdk/middleware/services/gpu/api/rm/brandy-native-js -- /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.cpp is not found, finding libuikit_ext.a in /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/brandy-native-js -- /home/snicker/hiwatch/code/sdk/middleware/services/gui/hal/display/src/display_vau.c is not found, finding libdisplay_gfx.a in /home/snicker/hiwatch/code/sdk/middleware/services/gui/hal/display/brandy-native-js -- /home/snicker/hiwatch/code/sdk/middleware/utils/fs/vfs/bcache/src/bcache.c is not found, finding libx_vfs_private.a in /home/snicker/hiwatch/code/sdk/middleware/utils/fs/vfs/brandy-native-js @@ -562,632 +1304,3504 @@ TARGET_INCLUDE = /home/snicker/hiwatch/code/sdk/middleware/chips/brandy/nv/nv_co -- /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/abilitykit/ability_manager.cpp is not found, finding libams.a in /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js -- /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/bundlekit/ability_info.cpp is not found, finding libbms.a in /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js -- /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/animation/transition_impl.cpp is not found, finding libace.a in /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js --- /home/snicker/hiwatch/code/sdk/open_source/openharmony/third_party/jerryscript/src/arg.c is not found, finding libjerryscript.a in /home/snicker/hiwatch/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js +-- /home/snicker/hiwatch/code/sdk/open_source/openharmony/third_party/jerryscript/jerry-core/api/jerry-debugger-transport.c is not found, finding libjerryscript.a in /home/snicker/hiwatch/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js -- Configuring done -- Generating done -- Build files have been written to: /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js -[ 0%] Built target alipay_hal -[ 0%] Built target media_at_service -[ 1%] Built target audio_at_service -[ 1%] Built target ohosfwk_at_service -Scanning dependencies of target app_at_service -Scanning dependencies of target batterry_service -[ 1%] Built target audio_vendor -[ 2%] Built target nativeabilityfwk -[ 2%] Building C object application/battery/CMakeFiles/batterry_service.dir/service/battery_service.c.obj -[ 2%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_at_process.c.obj -[ 6%] Built target mbedtls +[ 0%] Built target alipay_antchain +Scanning dependencies of target audio_vendor +[ 1%] Building C object application/audio/vendor/CMakeFiles/audio_vendor.dir/aw88262/aw88262.c.obj +[ 1%] Linking C static library ../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a +Scanning dependencies of target ohosfwk_at_service +Scanning dependencies of target graphic_at_service +[ 1%] Building CXX object application/wstp/at_service/ohosfwk/CMakeFiles/ohosfwk_at_service.dir/ohosfwk_at_process.cpp.obj +[ 1%] Building C object application/wstp/at_service/graphic/CMakeFiles/graphic_at_service.dir/graphic_cmd_manager.c.obj +[ 4%] Built target mbedtls Scanning dependencies of target brandy_app_standard +[ 4%] Built target audio_vendor +[ 4%] Building C object application/wstp/at_service/graphic/CMakeFiles/graphic_at_service.dir/graphic_at_process.c.obj +[ 4%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/kernel_init.c.obj +[ 4%] Built target ohos_deps Scanning dependencies of target audio_sample +[ 5%] Building C object application/wstp/at_service/graphic/CMakeFiles/graphic_at_service.dir/graphic_rx_process.c.obj +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/chip_init.c.obj +Scanning dependencies of target app_at_service +[ 5%] Linking CXX static library libohosfwk_at_service.a +[ 5%] Building C object application/wstp/at_service/graphic/CMakeFiles/graphic_at_service.dir/graphic_tx_process.c.obj +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/board_init.c.obj +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_ai/sample_ai.c.obj +[ 5%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_cmd_manager.c.obj +[ 5%] Built target ohosfwk_at_service +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/service_init.c.obj +[ 5%] Building C object application/wstp/at_service/graphic/CMakeFiles/graphic_at_service.dir/graphic_msg_manager.c.obj +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_ai/sample_ai_aenc.c.obj +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/thread_init.c.obj +Scanning dependencies of target broadcast +[ 5%] Linking C static library libgraphic_at_service.a +Scanning dependencies of target nativeabilityfwk +[ 5%] Building C object application/wearable/service/broadcast/CMakeFiles/broadcast.dir/src/broadcast_feature.c.obj +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_ao/sample_ao.c.obj +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/thread_pri_init.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c:37:18: warning: incompatible function pointer types initializing 'BOOL (*)(Feature *, Request *)' (aka 'unsigned int (*)(struct Feature *, struct Request *)') with an expression of type 'BOOL (Feature *, Request **)' (aka 'unsigned int (struct Feature *, struct Request **)') [-Wincompatible-function-pointer-types] +.OnMessage = OnMessage, +^~~~~~~~~ +1 warning generated. +[ 5%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/BaseView.cpp.obj +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_decode/sample_decode.c.obj +/home/snicker/hiwatch/code/sdk/application/brandy/brandy_standard/thread_pri_init.c:234:13: warning: unused function 'force_to_sleep' [-Wunused-function] +static void force_to_sleep(void) +^ +1 warning generated. +[ 5%] Building C object application/wearable/service/broadcast/CMakeFiles/broadcast.dir/src/broadcast_implement.c.obj +/home/snicker/hiwatch/code/sdk/application/audio/sample_decode/sample_decode.c:460:54: warning: unused parameter 'adp' [-Wunused-parameter] +static td_s32 sample_decode_adp_event_proc(td_handle adp, uapi_adp_event_type event, +^ +/home/snicker/hiwatch/code/sdk/application/audio/sample_decode/sample_decode.c:460:79: warning: unused parameter 'event' [-Wunused-parameter] +static td_s32 sample_decode_adp_event_proc(td_handle adp, uapi_adp_event_type event, +^ +2 warnings generated. +/home/snicker/hiwatch/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c:135:20: warning: unused function 'IsOuterCore' [-Wunused-function] +inline static BOOL IsOuterCore(CoreMask mask) +^ +1 warning generated. +[ 5%] Built target graphic_at_service +[ 5%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/input_app.c.obj +[ 5%] Building C object application/wearable/service/broadcast/CMakeFiles/broadcast.dir/src/broadcast_service.c.obj +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_encode/sample_encode.c.obj +[ 5%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/Ability.cpp.obj +[ 5%] Linking C static library libbrandy_app_standard.a +[ 5%] Linking C static library libbroadcast.a +[ 5%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_encode/sample_cast_aenc_play.c.obj +[ 6%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/NativeAbility.cpp.obj +[ 6%] Built target brandy_app_standard [ 6%] Built target broadcast -[ 6%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/chip_init.c.obj -[ 6%] Built target ohos_deps -[ 6%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_ai/sample_ai.c.obj -[ 6%] Built target ai_voice_audio_stream_wrapper -[ 6%] Built target ai_voice_engine_hal -[ 6%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_encode/sample_cast_aenc_play.c.obj -[ 6%] Built target ai_voice_service -[ 6%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_phone/sample_phone_apps.c.obj -/home/snicker/hiwatch/code/sdk/application/brandy/brandy_standard/chip_init.c:92:17: warning: unused function 'chip_get_tempe' [-Wunused-function] -static uint32_t chip_get_tempe(void) -^ -1 warning generated. -[ 6%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/thread_init.c.obj -[ 6%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/thread_pri_init.c.obj -Scanning dependencies of target msg_center_adapt -Scanning dependencies of target power_manager -[ 7%] Linking C static library ../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a -[ 7%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/display_state_machine.c.obj -[ 7%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/vendor_app/baidu/baidu_app.cpp.obj -[ 7%] Built target audio_sample -/home/snicker/hiwatch/code/sdk/application/battery/service/battery_service.c:123:12: warning: implicit declaration of function 'adc_trans_sytick_to_voltage_without_auto_scan' is invalid in C99 [-Wimplicit-function-declaration] -return adc_trans_sytick_to_voltage_without_auto_scan(stick); +Scanning dependencies of target ai_voice_engine_hal +[ 6%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_lpwk/sample_lpwk.c.obj +[ 6%] Building C object application/wearable/service/smart_voice/voice_engine_hal/CMakeFiles/ai_voice_engine_hal.dir/src/voice_engine_hal.c.obj +[ 6%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_at_process.c.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/NativeAbility.cpp:25: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; ^ -/home/snicker/hiwatch/code/sdk/application/battery/service/battery_service.c:114:17: warning: unused function 'adc_get_sample_stick' [-Wunused-function] -static uint32_t adc_get_sample_stick(void) +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; ^ -/home/snicker/hiwatch/code/sdk/application/battery/service/battery_service.c:119:14: warning: unused function 'adc_stick_transfer_voltage' [-Wunused-function] -static float adc_stick_transfer_voltage(uint16_t stick, adc_channel_t channel) +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; ^ -3 warnings generated. +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; +^ +5 warnings generated. +[ 6%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/StartNative.cpp.obj +[ 6%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_gui_aef/sample_gui_aef.c.obj +[ 7%] Linking C static library libai_voice_engine_hal.a +Scanning dependencies of target ai_voice_audio_stream_wrapper +Scanning dependencies of target ai_voice_service +[ 7%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_sea/sample_sea.c.obj +[ 7%] Building CXX object application/wearable/service/smart_voice/smart_voice_service/CMakeFiles/ai_voice_audio_stream_wrapper.dir/src/audio/audio_stream.cpp.obj +[ 7%] Building C object application/wearable/service/smart_voice/smart_voice_service/CMakeFiles/ai_voice_service.dir/src/smart_voice_service.c.obj +[ 7%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/SliceTransition.cpp.obj +[ 7%] Built target ai_voice_engine_hal +[ 7%] Linking C static library libai_voice_service.a +[ 7%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_phone/sample_phone_apps.c.obj +[ 7%] Linking CXX static library libai_voice_audio_stream_wrapper.a +[ 7%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/TransitionManager.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:10: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h:16: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:39: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/svg_data.h:86:26: warning: missing field 'gradientNum' initializer [-Wmissing-field-initializers] +SvgInfo svgInfo_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/svg_data.h:86:26: warning: missing field 'pathPnt' initializer [-Wmissing-field-initializers] +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:10: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:199:40: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient linearGradient_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:200:40: warning: missing field 'centerY' initializer [-Wmissing-field-initializers] +RadialGradient radialGradient_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:201:38: warning: missing field 'centerY' initializer [-Wmissing-field-initializers] +SweepGradient sweepGradient_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:209:32: warning: missing field 'version' initializer [-Wmissing-field-initializers] +PatternInfo pattern_ = {{{0}}}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:209:33: warning: missing field 'dataSize' initializer [-Wmissing-field-initializers] +PatternInfo pattern_ = {{{0}}}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:209:34: warning: missing field 'wrap' initializer [-Wmissing-field-initializers] +PatternInfo pattern_ = {{{0}}}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:106:32: warning: missing field 'version' initializer [-Wmissing-field-initializers] +ImageInfo dstInfo = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:106:33: warning: missing field 'dataSize' initializer [-Wmissing-field-initializers] +ImageInfo dstInfo = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:130:25: warning: missing field 'version' initializer [-Wmissing-field-initializers] +ImageInfo info = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:130:26: warning: missing field 'dataSize' initializer [-Wmissing-field-initializers] +ImageInfo info = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:147:25: warning: missing field 'version' initializer [-Wmissing-field-initializers] +ImageInfo info = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp:147:26: warning: missing field 'dataSize' initializer [-Wmissing-field-initializers] +ImageInfo info = {{0}}; +^ +15 warnings generated. +[ 7%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/transition/ZoomTransition.cpp.obj +[ 7%] Building C object application/audio/CMakeFiles/audio_sample.dir/tools/sample_dump.c.obj +[ 7%] Building CXX object application/wearable/nativeabilityfwk/CMakeFiles/nativeabilityfwk.dir/src/transition/HexagonsTransition.cpp.obj +[ 7%] Built target ai_voice_service +[ 7%] Built target ai_voice_audio_stream_wrapper +[ 7%] Building C object application/audio/CMakeFiles/audio_sample.dir/tools/sample_proc.c.obj +[ 7%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_rx_process.c.obj +[ 7%] Building C object application/audio/CMakeFiles/audio_sample.dir/tools/sample_data.c.obj +[ 7%] Linking CXX static library libnativeabilityfwk.a +Scanning dependencies of target ohos_startup +Scanning dependencies of target msg_center_adapt +Scanning dependencies of target power_manager +[ 7%] Built target nativeabilityfwk +[ 7%] Building C object application/wearable/ohos_startup/CMakeFiles/ohos_startup.dir/ohosfwk_startup.c.obj +[ 8%] Building C object application/audio/CMakeFiles/audio_sample.dir/thread/athread_cmsis.c.obj +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/msg_center_customer.cpp.obj +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/display_state_machine.c.obj +[ 8%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_audio.c.obj +[ 8%] Linking C static library libohos_startup.a /home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/display_state_machine.c:157:72: warning: implicit declaration of function 'action_timer_get_timer_is_running' is invalid in C99 [-Wimplicit-function-declaration] if ((event_type == TIMER_EVENT) && (action == TURN_OFF_SCREEN) && (action_timer_get_timer_is_running() == true)) { ^ 1 warning generated. -[ 7%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/power_display_service.c.obj -[ 7%] Linking C static library libbatterry_service.a -Scanning dependencies of target ohos_startup -[ 7%] Building C object application/brandy/brandy_standard/CMakeFiles/brandy_app_standard.dir/input_app.c.obj -[ 7%] Building C object application/wearable/ohos_startup/CMakeFiles/ohos_startup.dir/ohosfwk_startup.c.obj -[ 8%] Built target batterry_service -[ 8%] Built target alipay_soc_adapt -[ 8%] Built target non_os -[ 8%] Built target alipay_service -[ 8%] Built target riscv +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/power_display_service.c.obj +Scanning dependencies of target alipay_soc_adapt +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp:20: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp:120:38: warning: missing field 'type' initializer [-Wmissing-field-initializers] +hfp_hf_calls_info_t callData = {0}; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp:120:38: warning: missing field 'id' initializer [-Wmissing-field-initializers] +7 warnings generated. +[ 8%] Building C object application/wearable/alipay/driver_adapt/CMakeFiles/alipay_soc_adapt.dir/soc_adapt.c.obj [ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/filters/gui_event_filter.c.obj -[ 8%] Built target targets -[ 8%] Linking C static library libohos_startup.a -[ 8%] Built target init +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/soc_adapt.c:85:5: warning: implicit declaration of function 'osDelay' is invalid in C99 [-Wimplicit-function-declaration] +osDelay(byMilliSec); +^ +1 warning generated. [ 8%] Built target ohos_startup -[ 8%] Linking C static library libapp_at_service.a -[ 8%] Linking C static library libbrandy_app_standard.a -[ 9%] Built target base -[ 9%] Built target app_at_service -[ 9%] Built target brandy_app_standard -[ 11%] Built target sec -[ 11%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/filters/slice_event_filter.c.obj -[ 13%] Built target posix -[ 13%] Built target csysdeps -[ 13%] Built target interrupt -[ 21%] Built target m -[ 21%] Built target driverbase -[ 31%] Built target c -[ 31%] Built target cmsis -[ 31%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/filters/timer_event_filter.c.obj -[ 31%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/display_action.c.obj -[ 31%] Built target linux -[ 31%] Built target adc -[ 31%] Built target x_dpal -[ 32%] Built target osal -[ 32%] Built target flash -[ 33%] Built target dma -[ 33%] Built target gpio -[ 33%] Built target i2c -[ 33%] Built target cpu_trace -[ 33%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/timer_action.c.obj -[ 33%] Built target ipc_old -[ 33%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/touch_action.c.obj -[ 33%] Built target lpc -[ 33%] Built target memory_core -[ 33%] Built target mem_monitor -[ 33%] Built target mipi_tx -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:40:5: warning: implicit declaration of function 'display_resume_power_on' is invalid in C99 [-Wimplicit-function-declaration] +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/msg_center_cmd.cpp.obj +[ 8%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_audio_utils.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp:116:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +return "com.vendor.voiceassistant"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp:118:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +return "cn.navigate"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp:120:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +return "com.baidu.baiduMap"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp:125:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] +} +^ +4 warnings generated. +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/filters/slice_event_filter.c.obj +[ 8%] Building C object application/wearable/alipay/driver_adapt/CMakeFiles/alipay_soc_adapt.dir/vendor_product.c.obj +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/filters/timer_event_filter.c.obj +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/notify/alarm_notification.cpp.obj +[ 8%] Building C object application/audio/CMakeFiles/audio_sample.dir/sample_dpm/sample_dpm.c.obj +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/display_action.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:204:12: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned int)' [-Wimplicit-function-declaration] +return malloc(size); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:204:12: note: include the header or explicitly provide a declaration for 'malloc' +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:209:12: warning: implicitly declaring library function 'calloc' with type 'void *(unsigned int, unsigned int)' [-Wimplicit-function-declaration] +return calloc(nblock, size); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:209:12: note: include the header or explicitly provide a declaration for 'calloc' +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:214:5: warning: implicitly declaring library function 'free' with type 'void (void *)' [-Wimplicit-function-declaration] +free(pt); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:214:5: note: include the header or explicitly provide a declaration for 'free' +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:219:12: warning: implicitly declaring library function 'realloc' with type 'void *(void *, unsigned int)' [-Wimplicit-function-declaration] +return realloc(pt, size); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/driver_adapt/vendor_product.c:219:12: note: include the header or explicitly provide a declaration for 'realloc' +4 warnings generated. +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/timer_action.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:60:5: warning: implicit declaration of function 'display_resume_power_on' is invalid in C99 [-Wimplicit-function-declaration] display_resume_power_on(); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:85:19: warning: implicit declaration of function 'drv_dpu_resume' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:117:19: warning: implicit declaration of function 'drv_dpu_resume' is invalid in C99 [-Wimplicit-function-declaration] ret = drv_dpu_resume(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:92:15: warning: implicit declaration of function 'drv_vau_resume' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:125:15: warning: implicit declaration of function 'drv_jpeg_resume' is invalid in C99 [-Wimplicit-function-declaration] +(void)drv_jpeg_resume(NULL); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:127:15: warning: implicit declaration of function 'drv_vau_resume' is invalid in C99 [-Wimplicit-function-declaration] ret = drv_vau_resume(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:98:15: warning: implicit declaration of function 'drv_gmmu_resume' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:133:15: warning: implicit declaration of function 'drv_gmmu_resume' is invalid in C99 [-Wimplicit-function-declaration] ret = drv_gmmu_resume(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:114:5: warning: implicit declaration of function 'NotifyScreenOn' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:149:5: warning: implicit declaration of function 'NotifyScreenOn' is invalid in C99 [-Wimplicit-function-declaration] NotifyScreenOn(); // Instruct the uikit to start the display operation. ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:134:5: warning: implicit declaration of function 'NotifyScreenOff' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:181:5: warning: implicit declaration of function 'NotifyScreenOff' is invalid in C99 [-Wimplicit-function-declaration] NotifyScreenOff(); // Instruct the uikit to close the display operation. ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:138:21: warning: implicit declaration of function 'drv_vau_suspend' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:190:21: warning: implicit declaration of function 'drv_vau_suspend' is invalid in C99 [-Wimplicit-function-declaration] ext_errno ret = drv_vau_suspend(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:144:11: warning: implicit declaration of function 'drv_dpu_suspend' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:196:11: warning: implicit declaration of function 'drv_jpeg_suspend' is invalid in C99 [-Wimplicit-function-declaration] +(void)drv_jpeg_suspend(NULL); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:199:11: warning: implicit declaration of function 'drv_dpu_suspend' is invalid in C99 [-Wimplicit-function-declaration] ret = drv_dpu_suspend(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:151:11: warning: implicit declaration of function 'drv_gmmu_suspend' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:206:11: warning: implicit declaration of function 'drv_gmmu_suspend' is invalid in C99 [-Wimplicit-function-declaration] ret = drv_gmmu_suspend(NULL); ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:165:5: warning: implicit declaration of function 'display_suspend_power_off' is invalid in C99 [-Wimplicit-function-declaration] +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c:220:5: warning: implicit declaration of function 'display_suspend_power_off' is invalid in C99 [-Wimplicit-function-declaration] display_suspend_power_off(); ^ -10 warnings generated. -[ 33%] Built target nand_flash -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp:11: -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:56:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"", /* unused */ +12 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:57:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"com.vendor.voiceassistant", /* Command: 0x1, Type: 0x1 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:58:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"com.vendor.voiceassistant", /* Command: 0x1, Type: 0x2 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:59:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"com.vendor.voiceassistant", /* Command: 0x1, Type: 0x3 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:60:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"com.vendor.voiceassistant", /* Command: 0x1, Type: 0x4 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp:16:30: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* RING_AGAIN = "响铃将在十分钟后再次响起"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:61:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"", /* unused */ +6 warnings generated. +/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/timer_action.c:50:30: warning: initializing 'power_display_svr_api_t *' (aka 'struct power_display_svr_api *') with an expression of type 'const power_display_svr_api_t *' (aka 'const struct power_display_svr_api *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +power_display_svr_api_t *display_api = power_display_svr_get_api(); +^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +1 warning generated. +[ 8%] Linking C static library libalipay_soc_adapt.a +[ 8%] Linking C static library ../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a +[ 8%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_tx_process.c.obj +[ 8%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_msg_manager.c.obj +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/notify/makephone_notification.cpp.obj +[ 8%] Building C object application/wearable/service/power_manager/CMakeFiles/power_manager.dir/src/actions/touch_action.c.obj +[ 8%] Built target alipay_soc_adapt +[ 8%] Linking C static library libpower_manager.a +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:62:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"cn.navigate", /* Command: 0x2, Type: 0x1 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:63:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"cn.navigate", /* Command: 0x2, Type: 0x2 */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h:64:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] -"", /* unused */ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp:102:43: warning: missing field 'cmd_id' initializer [-Wmissing-field-initializers] -diag_ser_header_t send_pcm_header = {0}; +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; ^ -/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp:115:36: warning: missing field 'pcm_file_path' initializer [-Wmissing-field-initializers] -send_pcm_info_t pcm_info = { 0 }; +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h:139:33: warning: missing field 'isLoaded' initializer [-Wmissing-field-initializers] +ImageNode longTermList_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h:140:34: warning: missing field 'isLoaded' initializer [-Wmissing-field-initializers] +ImageNode shortTermList_ = {0}; +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp:17: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/../../nativeapp/nativeui/main/include/VolumeSettingView.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp:17: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/../../nativeapp/nativeui/main/include/VolumeSettingView.h:14: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/../../nativeapp/nativeui/player/include/PlayersView.h:27: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/../../nativeapp/nativeui/player/include/PlayersPresenter.h:19: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/../../nativeapp/nativeui/bluetooth/include/BluetoothModel.h:92:34: warning: missing field 'type' initializer [-Wmissing-field-initializers] +bd_addr_t remoteConnectAddr{0}; +^ +9 warnings generated. +[ 8%] Built target audio_sample +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/notify/notification_manager_customer.cpp.obj +Scanning dependencies of target non_os +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; +^ +5 warnings generated. +Scanning dependencies of target alipay_service +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/vendor_app/baidu/baidu_app.cpp.obj +[ 8%] Built target power_manager +[ 8%] Building C object kernel/non_os/non_os/CMakeFiles/non_os.dir/non_os_utils.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp:98:37: warning: missing field 'attr_bits' initializer [-Wmissing-field-initializers] +osMessageQueueAttr_t m_attr = {0}; ^ -11 warnings generated. -[ 33%] Built target drv_mmc -[ 33%] Built target otp -[ 33%] Linking CXX static library libmsg_center_adapt.a -[ 34%] Built target pinctrl -[ 34%] Built target pmp -/home/snicker/hiwatch/code/sdk/application/wearable/service/power_manager/src/actions/timer_action.c:50:30: warning: initializing 'power_display_svr_api_t *' (aka 'struct power_display_svr_api *') with an expression of type 'const power_display_svr_api_t *' (aka 'const struct power_display_svr_api *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] -power_display_svr_api_t *display_api = power_display_svr_get_api(); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. -[ 34%] Linking C static library libpower_manager.a -[ 34%] Built target pwm -[ 34%] Built target psram -[ 34%] Built target qspi -[ 35%] Built target cipher -[ 35%] Built target hash -[ 35%] Built target msg_center_adapt -[ 35%] Built target trng -[ 35%] Built target power_manager -[ 35%] Built target pke -[ 35%] Built target km -[ 35%] Built target systick -[ 35%] Built target spi -[ 35%] Built target tcxo -[ 35%] Built target drv_timer -[ 35%] Built target ulp_aon -[ 35%] Built target uart -[ 35%] Built target watchdog -[ 35%] Built target calendar -[ 35%] Built target qspi_display -[ 35%] Built target rtc_unified -[ 36%] Built target efuse -[ 36%] Built target mtd_com -[ 36%] Built target hal_adc -[ 38%] Built target hal_cpu_core +[ 8%] Building C object application/wearable/alipay/service/CMakeFiles/alipay_service.dir/alipay_feature.c.obj +[ 8%] Building CXX object application/wearable/service/msg_center/CMakeFiles/msg_center_adapt.dir/src/vendor_app/alipay/alipay_app.cpp.obj +[ 8%] Linking C static library libnon_os.a +[ 8%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_test_fs.c.obj +[ 8%] Built target riscv +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/alipay/alipay_app.cpp:257:29: warning: missing field 'tv_usec' initializer [-Wmissing-field-initializers] +struct timeval tv = { 0 }; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/src/vendor_app/alipay/alipay_app.cpp:258:30: warning: missing field 'tz_dsttime' initializer [-Wmissing-field-initializers] +struct timezone tz = { 0 }; +^ +2 warnings generated. +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:74:9: warning: implicit declaration of function 'svr_alipay_ble_adv_start' is invalid in C99 [-Wimplicit-function-declaration] +svr_alipay_ble_adv_start(); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:76:9: warning: implicit declaration of function 'svr_alipay_ble_adv_stop' is invalid in C99 [-Wimplicit-function-declaration] +svr_alipay_ble_adv_stop(); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:204:5: warning: implicit declaration of function 'csi_enter_lpm' is invalid in C99 [-Wimplicit-function-declaration] +csi_enter_lpm((void *)&data); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:211:5: warning: implicit declaration of function 'csi_exit_lpm' is invalid in C99 [-Wimplicit-function-declaration] +csi_exit_lpm((void *)&data); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:561:40: warning: incompatible function pointer types passing 'errcode_t (void *)' (aka 'unsigned int (void *)') to parameter of type 'osThreadFunc_t' (aka 'void (*)(void *)') [-Wincompatible-function-pointer-types] +g_alipay_task_handle = osThreadNew(svr_alipay_msg_thread, NULL, &g_alipay_attr); +^~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/kernel/liteos/liteos_v207.1.0/Huawei_LiteOS/open_source/CMSIS/CMSIS/RTOS2/Include/cmsis_os2.h:371:42: note: passing argument to parameter 'func' here +osThreadId_t osThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_feature.c:607:5: warning: implicit declaration of function 'HS_IIC_Init' is invalid in C99 [-Wimplicit-function-declaration] +HS_IIC_Init(); +^ +6 warnings generated. +[ 8%] Linking CXX static library libmsg_center_adapt.a +[ 8%] Building C object application/wearable/alipay/service/CMakeFiles/alipay_service.dir/alipay_bluetooth.c.obj +[ 8%] Building C object application/wstp/at_service/app/CMakeFiles/app_at_service.dir/app_common_api.c.obj +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:128:9: warning: implicit declaration of function 'osDelay' is invalid in C99 [-Wimplicit-function-declaration] +osDelay(50); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:150:83: warning: unused parameter 'addr' [-Wunused-parameter] +static void svr_alipay_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_ble_conn_state_t conn_state, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:151:26: warning: unused parameter 'pair_state' [-Wunused-parameter] +gap_ble_pair_state_t pair_state, gap_ble_disc_reason_t disc_reason) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:151:60: warning: unused parameter 'disc_reason' [-Wunused-parameter] +gap_ble_pair_state_t pair_state, gap_ble_disc_reason_t disc_reason) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:164:49: warning: unused parameter 'adv_id' [-Wunused-parameter] +static void svr_alipay_ble_adv_start_cb(uint8_t adv_id, adv_status_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:164:70: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_ble_adv_start_cb(uint8_t adv_id, adv_status_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:170:52: warning: unused parameter 'adv_id' [-Wunused-parameter] +static void svr_alipay_ble_set_adv_data_cb(uint8_t adv_id, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:170:70: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_ble_set_adv_data_cb(uint8_t adv_id, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:175:48: warning: unused parameter 'adv_id' [-Wunused-parameter] +static void svr_alipay_ble_adv_stop_cb(uint8_t adv_id, adv_status_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:175:69: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_ble_adv_stop_cb(uint8_t adv_id, adv_status_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:181:15: warning: unused parameter 'status' [-Wunused-parameter] +errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:221:9: warning: implicit declaration of function 'bts_data_to_uuid_len2' is invalid in C99 [-Wimplicit-function-declaration] +bts_data_to_uuid_len2(0x2902, &ccc_uuid); +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:208:53: warning: unused parameter 'status' [-Wunused-parameter] +gatts_add_character_result_t *result, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:256:59: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_descriptor_add_cb(uint8_t server_id, bt_uuid_t *uuid, uint16_t srv_handle, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:256:81: warning: unused parameter 'uuid' [-Wunused-parameter] +static void svr_alipay_bt_gatts_descriptor_add_cb(uint8_t server_id, bt_uuid_t *uuid, uint16_t srv_handle, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:256:96: warning: unused parameter 'srv_handle' [-Wunused-parameter] +static void svr_alipay_bt_gatts_descriptor_add_cb(uint8_t server_id, bt_uuid_t *uuid, uint16_t srv_handle, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:257:14: warning: unused parameter 'desc_handle' [-Wunused-parameter] +uint16_t desc_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:257:37: warning: unused parameter 'status' [-Wunused-parameter] +uint16_t desc_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:263:58: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_start_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:263:78: warning: unused parameter 'srv_handle' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_start_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:263:100: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_start_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:268:57: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_stop_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:268:77: warning: unused parameter 'srv_handle' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_stop_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:268:99: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_stop_cb(uint8_t server_id, uint16_t srv_handle, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:273:56: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_del_cb(uint8_t server_id, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:273:77: warning: unused parameter 'status' [-Wunused-parameter] +static void svr_alipay_bt_gatts_service_del_cb(uint8_t server_id, errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:278:53: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_req_read_cb(uint8_t server_id, uint16_t conn_id, gatts_req_read_cb_t *read_cb_para, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:278:73: warning: unused parameter 'conn_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_req_read_cb(uint8_t server_id, uint16_t conn_id, gatts_req_read_cb_t *read_cb_para, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:278:103: warning: unused parameter 'read_cb_para' [-Wunused-parameter] +static void svr_alipay_bt_gatts_req_read_cb(uint8_t server_id, uint16_t conn_id, gatts_req_read_cb_t *read_cb_para, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:279:15: warning: unused parameter 'status' [-Wunused-parameter] +errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:284:54: warning: unused parameter 'server_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_req_write_cb(uint8_t server_id, uint16_t conn_id, gatts_req_write_cb_t *write_cb_para, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:284:74: warning: unused parameter 'conn_id' [-Wunused-parameter] +static void svr_alipay_bt_gatts_req_write_cb(uint8_t server_id, uint16_t conn_id, gatts_req_write_cb_t *write_cb_para, +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:285:15: warning: unused parameter 'status' [-Wunused-parameter] +errcode_t status) +^ +/home/snicker/hiwatch/code/sdk/application/wearable/alipay/service/alipay_bluetooth.c:354:16: warning: implicit declaration of function 'enable_bt_stack' is invalid in C99 [-Wimplicit-function-declaration] +bool ret = enable_bt_stack(); +^ +34 warnings generated. +[ 8%] Built target targets +[ 8%] Linking C static library libalipay_service.a +[ 8%] Built target non_os +[ 8%] Built target msg_center_adapt +[ 8%] Built target alipay_service +[ 9%] Built target base +[ 9%] Built target init +[ 10%] Built target posix +[ 13%] Built target sec +[ 13%] Built target csysdeps +[ 13%] Built target interrupt +[ 22%] Built target m +[ 22%] Built target driverbase +[ 22%] Built target linux +[ 22%] Built target cmsis +[ 22%] Built target x_dpal +[ 22%] Built target adc +Scanning dependencies of target osal +[ 33%] Built target c +[ 33%] Built target dma +Scanning dependencies of target cpu_trace +[ 33%] Building C object kernel/osal/CMakeFiles/osal.dir/adapt/liteos/oal_onetrack.c.obj +[ 33%] Building C object driver/cpu_trace/CMakeFiles/cpu_trace.dir/cpu_trace.c.obj +[ 33%] Built target gpio +Scanning dependencies of target flash +Scanning dependencies of target i2c +[ 33%] Linking C static library libcpu_trace.a +[ 33%] Linking C static library libosal.a +[ 33%] Building C object driver/flash/CMakeFiles/flash.dir/flash.c.obj +[ 33%] Building C object driver/i2c/CMakeFiles/i2c.dir/i2c.c.obj +Scanning dependencies of target ipc_old +[ 33%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/acore/ipc_irq.c.obj +[ 33%] Linking C static library libi2c.a +[ 33%] Linking C static library libflash.a +[ 33%] Built target cpu_trace +Scanning dependencies of target lcd +[ 33%] Building C object driver/ipc/CMakeFiles/ipc_old.dir/ipc_old/shared/ipc.c.obj +[ 33%] Built target i2c +[ 33%] Built target flash +[ 33%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_bus.c.obj +[ 33%] Linking C static library libipc_old.a +[ 34%] Built target osal +Scanning dependencies of target memory_core +[ 34%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_qspi.c.obj +Scanning dependencies of target lpc +Scanning dependencies of target mipi_tx +[ 34%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_mipi.c.obj +[ 34%] Building C object driver/memory_core/CMakeFiles/memory_core.dir/shared/memory_core.c.obj +[ 34%] Built target ipc_old +[ 34%] Building C object driver/lpc/CMakeFiles/lpc.dir/acore/lpc_core.c.obj +[ 34%] Building C object driver/mipi/CMakeFiles/mipi_tx.dir/shared/mipi_tx.c.obj +[ 34%] Built target mem_monitor +[ 34%] Linking C static library libmemory_core.a +[ 34%] Building C object driver/lpc/CMakeFiles/lpc.dir/shared/lpc.c.obj +[ 34%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_common.c.obj +[ 35%] Linking C static library libmipi_tx.a +[ 35%] Linking C static library liblpc.a +[ 35%] Building C object driver/lcd/CMakeFiles/lcd.dir/lcd_config.c.obj +[ 35%] Built target memory_core +[ 35%] Building C object driver/lcd/CMakeFiles/lcd.dir/soc_lcd_api.c.obj +[ 35%] Built target mipi_tx +[ 35%] Linking C static library liblcd.a +Scanning dependencies of target nand_flash +[ 35%] Built target lpc +Scanning dependencies of target otp +[ 35%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_ds35x1g.c.obj +[ 35%] Built target pinctrl +[ 35%] Building C object driver/otp/CMakeFiles/otp.dir/otp.c.obj +[ 35%] Built target lcd +Scanning dependencies of target drv_mmc +[ 35%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_tc58cyg.c.obj +[ 35%] Built target pmp +Scanning dependencies of target psram +[ 35%] Building C object driver/mmc/CMakeFiles/drv_mmc.dir/core/block.c.obj +[ 35%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_w25n01g.c.obj +[ 35%] Linking C static library libotp.a +[ 35%] Built target pwm +[ 35%] Building C object driver/psram/CMakeFiles/psram.dir/psram_drv.c.obj +Scanning dependencies of target qspi +[ 35%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_config.c.obj +[ 35%] Building C object driver/mmc/CMakeFiles/drv_mmc.dir/host/sdhci/brandy/mmc_sdhci.c.obj +[ 35%] Linking C static library libpsram.a +[ 35%] Built target otp +[ 36%] Building C object driver/qspi/CMakeFiles/qspi.dir/qspi.c.obj +[ 36%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/hal_nandflash.c.obj +[ 36%] Linking C static library libqspi.a +[ 36%] Linking C static library libdrv_mmc.a +[ 36%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_to_os.c.obj +[ 36%] Built target hash +[ 36%] Built target psram +[ 36%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash_qspi.c.obj +[ 38%] Built target cipher +[ 38%] Built target qspi +[ 38%] Building C object driver/nand_flash/CMakeFiles/nand_flash.dir/nand/nandflash.c.obj +[ 38%] Built target km +[ 39%] Built target pke +Scanning dependencies of target trng +[ 39%] Linking C static library libnand_flash.a +Scanning dependencies of target systick +[ 39%] Built target spi +[ 39%] Built target tcxo +[ 40%] Built target drv_mmc +[ 40%] Building C object driver/security/trng/CMakeFiles/trng.dir/drv_trng.c.obj +[ 40%] Building C object driver/systick/CMakeFiles/systick.dir/systick.c.obj +[ 40%] Built target nand_flash +[ 40%] Built target drv_timer +[ 40%] Linking C static library libsystick.a +Scanning dependencies of target ulp_aon +[ 40%] Building C object driver/ulp_aon/CMakeFiles/ulp_aon.dir/ulp_aon_control.c.obj +[ 40%] Linking C static library libtrng.a +[ 40%] Built target watchdog +Scanning dependencies of target uart +[ 40%] Linking C static library libulp_aon.a +[ 40%] Building C object driver/uart/CMakeFiles/uart.dir/uart.c.obj +[ 40%] Built target systick +[ 40%] Built target trng +Scanning dependencies of target touch +[ 40%] Built target calendar +[ 40%] Linking C static library libapp_at_service.a +[ 40%] Built target ulp_aon +[ 40%] Linking C static library libuart.a +[ 40%] Building C object driver/touch/CMakeFiles/touch.dir/touch_screen_drv.c.obj +Scanning dependencies of target button +[ 40%] Built target app_at_service +[ 40%] Built target mtd_com +Scanning dependencies of target rtc_unified +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:431:5: warning: implicit declaration of function 'uapi_gpio_disable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:436:5: warning: implicit declaration of function 'uapi_gpio_disable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:448:5: warning: implicit declaration of function 'uapi_gpio_enable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_enable_interrupt(TOUCH_INT_GPIO); // open tp_int gpio interrupt +^ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/touch/touch_screen_drv.c:472:5: warning: implicit declaration of function 'uapi_gpio_enable_interrupt' is invalid in C99 [-Wimplicit-function-declaration] +uapi_gpio_enable_interrupt(TOUCH_INT_GPIO); // open tp_int gpio interrupt +^ +4 warnings generated. +[ 40%] Built target uart +Scanning dependencies of target qspi_display +[ 40%] Building C object driver/touch/CMakeFiles/touch.dir/touch_screen_queue1.c.obj +[ 40%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_ctrl.c.obj +[ 40%] Building C object driver/rtc_unified/CMakeFiles/rtc_unified.dir/rtc.c.obj +[ 40%] Building C object driver/qspi_display/CMakeFiles/qspi_display.dir/qspi_display.c.obj +[ 40%] Building C object driver/button/CMakeFiles/button.dir/button.c.obj +Scanning dependencies of target efuse +[ 40%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_drv1.c.obj +[ 40%] Linking C static library libbutton.a +[ 40%] Linking C static library libqspi_display.a +[ 40%] Building C object driver/touch/CMakeFiles/touch.dir/ztw523_touch/ztw523_touch1.c.obj +[ 41%] Linking C static library librtc_unified.a +[ 41%] Building C object driver/efuse/CMakeFiles/efuse.dir/efuse.c.obj +[ 41%] Linking C static library libtouch.a +[ 41%] Built target qspi_display +[ 41%] Built target button +[ 41%] Linking C static library libefuse.a +[ 41%] Built target touch +[ 42%] Built target hal_adc +[ 42%] Built target rtc_unified +[ 42%] Built target efuse +[ 42%] Built target hal_cpu_core +[ 42%] Built target hal_dma_v100 +Scanning dependencies of target hal_cpu_trace +[ 42%] Building C object hal/cpu_trace/CMakeFiles/hal_cpu_trace.dir/hal_cpu_trace.c.obj +Scanning dependencies of target hal_ipc_old +[ 43%] Built target hal_gpio_v100 +[ 43%] Building C object hal/ipc/CMakeFiles/hal_ipc_old.dir/hal_ipc_old/hal_ipc.c.obj +[ 43%] Built target hal_i2c +[ 43%] Linking C static library libhal_cpu_trace.a +Scanning dependencies of target hal_lpc Scanning dependencies of target audio_api -[ 38%] Built target hal_cpu_trace +Scanning dependencies of target hal_l2ram +[ 43%] Built target hal_cpu_trace +[ 43%] Building C object hal/l2ram/CMakeFiles/hal_l2ram.dir/hal_l2ram_private.c.obj +[ 43%] Building C object hal/lpc/CMakeFiles/hal_lpc.dir/hal_lpc.c.obj +[ 43%] Linking C static library libhal_ipc_old.a Scanning dependencies of target audio_core -[ 38%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/adp/mpi_adp.c.obj -[ 38%] Built target hal_gpio_v100 -[ 38%] Built target hal_i2c -[ 38%] Built target hal_dma_v100 -Scanning dependencies of target nativelauncher -[ 38%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/osal/liteos/audio_osal_addr.c.obj -[ 38%] Built target hal_ipc_old -[ 38%] Built target hal_lpc -[ 38%] Built target hal_l2ram -[ 38%] Built target hal_mem_monitor -[ 38%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a -[ 38%] Built target hal_mipi -[ 38%] Built target hal_otp -[ 39%] Built target hal_pmp -[ 39%] Built target hal_pinctrl -[ 39%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/adp/core_adp.c.obj -[ 39%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/sys_ctrl/sys_cmd.c.obj +[ 43%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/sys/mpi_sys.c.obj +[ 43%] Linking C static library libhal_l2ram.a +[ 43%] Linking C static library libhal_lpc.a +[ 43%] Built target hal_mem_monitor +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/osal/liteos/audio_osal_addr.c.obj +[ 43%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/adec/mpi_adec.c.obj +[ 43%] Built target hal_ipc_old +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/osal/liteos/audio_osal_debug.c.obj +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/adp/core_adp.c.obj +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/core_util.c.obj +[ 43%] Built target hal_l2ram +[ 43%] Built target hal_lpc +Scanning dependencies of target hal_otp +[ 43%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/adp/mpi_adp.c.obj +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/core_module.c.obj +[ 43%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/share_mem/core_msg.c.obj +Scanning dependencies of target hal_mipi +[ 43%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aenc/mpi_aenc.c.obj +[ 43%] Building C object hal/otp/CMakeFiles/hal_otp.dir/brandy/hal_otp.c.obj +[ 44%] Building C object hal/mipi/CMakeFiles/hal_mipi.dir/hal_mipi_tx.c.obj +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aie/mpi_ai.c.obj +[ 44%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/share_mem/core_shrb.c.obj +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aie/mpi_sea.c.obj +[ 44%] Linking C static library libhal_otp.a +[ 44%] Built target hal_pinctrl +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aie/mpi_vad.c.obj +[ 44%] Linking C static library libhal_mipi.a +[ 44%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/share_mem/core_rbuf.c.obj +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aie/uapi_sea.c.obj +[ 44%] Built target hal_pmp +[ 44%] Built target hal_otp +[ 44%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/sys_ctrl/sys_cmd.c.obj +[ 44%] Built target hal_pwm +[ 44%] Built target hal_mipi +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/anc/mpi_anc.c.obj +Scanning dependencies of target hal_qspi +Scanning dependencies of target hal_sectors +Scanning dependencies of target hal_reg_config +[ 44%] Building C object hal/sectors/CMakeFiles/hal_sectors.dir/hal_sectors.c.obj +Scanning dependencies of target hal_reboot +[ 44%] Building C object hal/qspi/CMakeFiles/hal_qspi.dir/hal_qspi.c.obj +[ 44%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/probe/probe.c.obj +[ 44%] Building C object hal/reg_config/CMakeFiles/hal_reg_config.dir/hal_reg_config.c.obj Scanning dependencies of target audio_drv -[ 39%] Built target hal_pwm -[ 39%] Built target hal_qspi -[ 39%] Built target hal_reboot -[ 39%] Built target audio_api -[ 39%] Building C object driver/audio/source/core/CMakeFiles/audio_core.dir/common/probe/probe.c.obj -[ 39%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adec/drv_adec.c.obj -[ 40%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/sys/drv_sys.c.obj -[ 40%] Built target hal_sectors -[ 40%] Built target hal_cipher -[ 40%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aenc/drv_aenc.c.obj -[ 40%] Built target hal_reg_config -[ 40%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_sea.c.obj -[ 40%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_ao.c.obj -[ 40%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_track.c.obj -[ 40%] Built target hal_hash -[ 41%] Built target hal_km -[ 41%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/drv_sap_msg.c.obj -[ 41%] Built target hal_pke -[ 41%] Built target hal_trng -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/drv_sap_intf.c.obj -[ 41%] Built target hal_efuse_v100 -/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/audio/source/drv/aoe/drv_ao.c:686:13: warning: comparison of integers of different signs: 'td_s32' (aka 'int') and 'unsigned int' [-Wsign-compare] -if (ret == ERR_AO_NOT_SUPPORTED) { -~~~ ^ ~~~~~~~~~~~~~~~~~~~~ -1 warning generated. -[ 41%] Built target hal_spi -[ 41%] Built target audio_core -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/brandy/drv_hal.c.obj -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/dpm/drv_dpm.c.obj -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/common/drv_overlay_load.c.obj -[ 41%] Built target hal_systick -[ 41%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/common/drv_overlay_load_from_flash.c.obj -[ 42%] Built target hal_tcxo -[ 42%] Built target hal_uart -[ 42%] Built target hal_timer -/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/audio/source/drv/common/drv_overlay_load_from_flash.c:212:11: warning: implicit declaration of function 'drv_msg_sys_clear_overlay_section' is invalid in C99 [-Wimplicit-function-declaration] -ret = drv_msg_sys_clear_overlay_section(type); -^ -1 warning generated. -[ 42%] Built target hal_watchdog -[ 42%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a -[ 42%] Built target hal_calendar -[ 42%] Built target hal_xip -[ 42%] Built target hal_rtc_unified -[ 43%] Built target chip_brandy -[ 43%] Built target brandy_clocks -[ 44%] Built target pmu_brandy -[ 44%] Built target adc_port -[ 44%] Built target cipher_port -[ 44%] Built target liteos_port -[ 44%] Built target pwm_port -[ 44%] Built target gpio_port -[ 44%] Built target hash_port -[ 44%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmClockModel.cpp.obj -[ 44%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassModel.cpp.obj -[ 45%] Built target audio_drv -[ 45%] Built target pke_port -[ 45%] Built target km_port -[ 45%] Built target efuse_porting -[ 45%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/phoneservice/src/PhoneService.cpp.obj -[ 45%] Built target trng_port -[ 45%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/offlinevoice/src/VocassistPresenter.cpp.obj -[ 45%] Built target uart_port -[ 46%] Built target timer_port -[ 46%] Built target tcxo_port -[ 46%] Built target systick_port -[ 46%] Built target calendar_port -[ 46%] Built target watchdog_port -[ 46%] Built target port_pinctrl -[ 46%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/src/UISamplePresenter.cpp.obj -[ 47%] Built target xip_port -[ 47%] Built target pmp_port -[ 47%] Built target dma_port -[ 47%] Built target i2c_porting -[ 47%] Built target spi_porting -[ 47%] Built target flash_porting -[ 48%] Built target mem_monitor_port +[ 44%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aoe/mpi_ao.c.obj +[ 44%] Linking C static library libhal_sectors.a +[ 44%] Building C object hal/reboot/CMakeFiles/hal_reboot.dir/hal_reboot.c.obj +[ 45%] Linking C static library libhal_reg_config.a +[ 45%] Linking C static library libhal_reboot.a +[ 45%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a +[ 45%] Linking C static library libhal_qspi.a +[ 45%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/aoe/mpi_track.c.obj +[ 45%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/sys/drv_sys.c.obj +[ 45%] Built target hal_sectors +[ 46%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/dpm/mpi_dpm.c.obj +[ 46%] Built target hal_qspi +[ 46%] Built target hal_reboot +[ 46%] Built target audio_core +[ 46%] Built target hal_reg_config +[ 47%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/sys/drv_msg_sys.c.obj +[ 47%] Building C object driver/audio/source/api/CMakeFiles/audio_api.dir/dump/mpi_dump.c.obj +[ 47%] Built target hal_cipher +[ 48%] Built target hal_trng +[ 48%] Built target hal_hash +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/sys/drv_proc_sys.c.obj +[ 48%] Built target hal_km +[ 48%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a +Scanning dependencies of target hal_efuse_v100 +[ 48%] Built target hal_pke +[ 48%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/hal_efuse.c.obj +Scanning dependencies of target hal_systick +[ 48%] Built target hal_spi +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/ab/drv_ab.c.obj +[ 48%] Built target hal_tcxo +[ 48%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150.c.obj +[ 48%] Built target hal_timer +[ 48%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/ab/drv_msg_ab.c.obj +[ 48%] Building C object hal/systick/CMakeFiles/hal_systick.dir/v150/hal_systick_v150_regs_op.c.obj +[ 48%] Built target hal_watchdog +[ 48%] Built target audio_api +Scanning dependencies of target hal_xip +Scanning dependencies of target hal_uart +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/ab/drv_proc_ab.c.obj +[ 48%] Building C object hal/security/efuse/CMakeFiles/hal_efuse_v100.dir/v100/hal_efuse_v100_reg_op.c.obj +[ 48%] Building C object hal/uart/CMakeFiles/hal_uart.dir/hal_uart.c.obj +[ 48%] Linking C static library libhal_systick.a +[ 48%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adec/drv_adec.c.obj +Scanning dependencies of target hal_rtc_unified +[ 48%] Linking C static library libhal_efuse_v100.a +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/xip/hal_xip.c:24:13: warning: unused function 'hal_xip_auto' [-Wunused-function] +static void hal_xip_auto(bool en) +^ +1 warning generated. +[ 48%] Built target hal_calendar +[ 48%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120.c.obj +[ 48%] Building C object hal/xip/CMakeFiles/hal_xip.dir/hal_xip_v150_regs_op.c.obj +[ 48%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/hal_rtc.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adec/drv_msg_adec.c.obj +[ 48%] Building C object hal/uart/CMakeFiles/hal_uart.dir/v120/hal_uart_v120_regs_op.c.obj +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:13:11: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_comm_regs = NULL; +^ ~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:14:45: warning: incompatible pointer to integer conversion initializing 'uintptr_t' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion] +uintptr_t g_rtc_regs[CONFIG_RTC_MAX_NUM] = {NULL}; +^~~~ +/home/snicker/hiwatch/code/sdk/kernel/liteos/liteos_v207.1.0/Huawei_LiteOS/open_source/musl/include/stddef.h:9:14: note: expanded from macro 'NULL' +#define NULL ((void*)0) +^~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/hal/rtc_unified/hal_rtc.c:31:23: warning: incompatible pointer to integer conversion assigning to 'uintptr_t' (aka 'unsigned int') from 'void *' [-Wint-conversion] +g_rtc_regs[index] = NULL; +^ ~~~~ +3 warnings generated. +[ 48%] Building C object hal/rtc_unified/CMakeFiles/hal_rtc_unified.dir/v100/hal_rtc_v100.c.obj +[ 48%] Built target hal_systick +[ 48%] Linking C static library libhal_xip.a +[ 48%] Built target hal_efuse_v100 +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adec/drv_proc_adec.c.obj +[ 48%] Linking C static library libhal_uart.a +[ 48%] Linking C static library libhal_rtc_unified.a +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aenc/drv_aenc.c.obj +Scanning dependencies of target brandy_clocks +Scanning dependencies of target chip_brandy +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aenc/drv_msg_aenc.c.obj +[ 48%] Built target hal_xip +[ 48%] Built target hal_uart +[ 48%] Built target hal_rtc_unified +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aenc/drv_proc_aenc.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks_config_priv.c.obj +Scanning dependencies of target gpio_port +Scanning dependencies of target pmu_brandy +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adp/drv_adp.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/drivers/acore/clocks.c.obj +Scanning dependencies of target adc_port +[ 48%] Building C object drivers/chips/brandy/porting/gpio/CMakeFiles/gpio_port.dir/gpio_porting.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_cmu.c.obj +[ 48%] Building C object drivers/chips/brandy/porting/adc/CMakeFiles/adc_port.dir/adc_porting.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adp/drv_msg_adp.c.obj +[ 48%] Linking C static library libgpio_port.a +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/interrupt_handler.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_app_priv.c.obj +Scanning dependencies of target liteos_port +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_interrupt.c.obj +[ 48%] Linking C static library libadc_port.a +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/adp/drv_proc_adp.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/interrupt/vectors.c.obj +[ 48%] Building C object drivers/chips/brandy/porting/liteos/CMakeFiles/liteos_port.dir/riscv70/idle_config.c.obj +[ 48%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_ai.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/acore/pmu_ldo.c.obj +[ 48%] Building C object drivers/chips/brandy/porting/liteos/CMakeFiles/liteos_port.dir/riscv70/tick_timer.c.obj +[ 48%] Built target gpio_port +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_glb.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/config/pmp_config.c.obj +[ 48%] Built target adc_port +[ 50%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_cmu.c.obj +[ 48%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/drivers/shared/pmu.c.obj +[ 51%] Linking C static library libliteos_port.a +[ 51%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_msg_ai.c.obj +Scanning dependencies of target pwm_port +[ 51%] Building C object drivers/chips/brandy/CMakeFiles/chip_brandy.dir/arch/riscv/riscv70/oam_trace.c.obj +[ 51%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks_sdio.c.obj +[ 51%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_interrupt.c.obj +[ 51%] Building C object drivers/chips/brandy/porting/pwm/CMakeFiles/pwm_port.dir/pwm_porting.c.obj +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_clocks.c.obj +[ 52%] Linking C static library libchip_brandy.a +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/pmu_brandy.dir/pmu/hal/hal_pmu_peripheral_app.c.obj +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks/hal/hal_cpu_clocks.c.obj +[ 52%] Built target liteos_port +[ 52%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_msg_sea.c.obj +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_core.c.obj +[ 52%] Linking C static library libpmu_brandy.a +[ 52%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_proc_ai.c.obj +[ 52%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_proc_sea.c.obj +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch_priv.c.obj +[ 52%] Built target cipher_port +[ 52%] Linking C static library libpwm_port.a +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/acore/clocks_switch.c.obj +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clock_calibration.c.obj +[ 52%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_sea.c.obj +[ 52%] Built target chip_brandy +[ 52%] Building C object drivers/chips/brandy/CMakeFiles/brandy_clocks.dir/clocks_core/drivers/shared/clocks_core_common.c.obj +[ 52%] Built target pwm_port +[ 52%] Built target hash_port +[ 52%] Linking C static library libbrandy_clocks.a +[ 52%] Built target pmu_brandy +[ 53%] Built target km_port +Scanning dependencies of target efuse_porting +[ 53%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aie/drv_vad.c.obj +[ 53%] Building C object drivers/chips/brandy/porting/security/efuse/CMakeFiles/efuse_porting.dir/efuse_porting.c.obj +Scanning dependencies of target uart_port +[ 54%] Built target trng_port +[ 54%] Built target pke_port +[ 54%] Built target timer_port +[ 54%] Built target brandy_clocks +[ 54%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/anc/drv_anc.c.obj +[ 54%] Linking C static library libefuse_porting.a +[ 54%] Building C object drivers/chips/brandy/porting/uart/CMakeFiles/uart_port.dir/uart_porting.c.obj +Scanning dependencies of target systick_port +[ 54%] Building C object drivers/chips/brandy/porting/systick/CMakeFiles/systick_port.dir/systick_porting.c.obj +[ 54%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_ao.c.obj +[ 54%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/anc/drv_msg_anc.c.obj +Scanning dependencies of target calendar_port +[ 54%] Linking C static library libuart_port.a +[ 54%] Built target tcxo_port +[ 54%] Built target efuse_porting +[ 54%] Building C object drivers/chips/brandy/porting/calendar/CMakeFiles/calendar_port.dir/calendar_porting.c.obj +[ 54%] Linking C static library libsystick_port.a +[ 54%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_msg_ao.c.obj +[ 54%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_proc_ao.c.obj +Scanning dependencies of target watchdog_port +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_track.c.obj +[ 55%] Building C object drivers/chips/brandy/porting/watchdog/CMakeFiles/watchdog_port.dir/watchdog_porting.c.obj +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/aoe/drv_msg_track.c.obj +[ 55%] Linking C static library libcalendar_port.a +[ 55%] Built target port_pinctrl +[ 55%] Built target uart_port +[ 55%] Built target systick_port +[ 55%] Linking C static library libwatchdog_port.a +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/drv_sap_intf.c.obj +Scanning dependencies of target xip_port +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/drv_sap_msg.c.obj +[ 55%] Building C object drivers/chips/brandy/porting/xip/CMakeFiles/xip_port.dir/xip_porting.c.obj +[ 55%] Built target pmp_port +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/arch/brandy/drv_hal.c.obj +[ 55%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/common/drv_overlay_load.c.obj +Scanning dependencies of target i2c_porting +[ 55%] Built target calendar_port +[ 56%] Linking C static library libxip_port.a +[ 56%] Built target watchdog_port +[ 56%] Building C object drivers/chips/brandy/porting/i2c/CMakeFiles/i2c_porting.dir/i2c_porting.c.obj +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/dpm/drv_dpm.c.obj +Scanning dependencies of target dma_port +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/common/proc/drv_audio_proc.c.obj +Scanning dependencies of target flash_porting +Scanning dependencies of target spi_porting +[ 56%] Linking C static library libi2c_porting.a +[ 56%] Building C object drivers/chips/brandy/porting/flash/CMakeFiles/flash_porting.dir/flash_porting.c.obj +[ 56%] Building C object drivers/chips/brandy/porting/spi/CMakeFiles/spi_porting.dir/spi_porting.c.obj +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/dpm/drv_msg_dpm.c.obj +[ 56%] Building C object drivers/chips/brandy/porting/dma/CMakeFiles/dma_port.dir/dma_porting.c.obj +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/dpm/drv_proc_dpm.c.obj +/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/spi/spi_porting.c:468:47: warning: unused parameter 'clk_in_mhz' [-Wunused-parameter] +bool hal_opi_set_freq(spi_bus_t bus, uint32_t clk_in_mhz) +^ +1 warning generated. +[ 56%] Linking C static library libdma_port.a +[ 56%] Linking C static library libflash_porting.a +[ 56%] Built target xip_port +[ 56%] Linking C static library libspi_porting.a +[ 56%] Built target i2c_porting +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/vendor/drv_audio_vendor.c.obj +[ 56%] Building C object driver/audio/source/drv/CMakeFiles/audio_drv.dir/common/drv_overlay_load_from_flash.c.obj +Scanning dependencies of target rtc_unified_port +[ 56%] Built target mem_monitor_port +[ 56%] Built target flash_porting +[ 56%] Built target dma_port +[ 56%] Building C object drivers/chips/brandy/porting/rtc_unified/CMakeFiles/rtc_unified_port.dir/rtc_porting.c.obj +[ 56%] Linking C static library ../../../../../../../../interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a +[ 56%] Built target spi_porting Scanning dependencies of target button_port -[ 48%] Built target rtc_unified_port -[ 48%] Building C object drivers/chips/brandy/porting/button/CMakeFiles/button_port.dir/button_porting.c.obj -Scanning dependencies of target acc_sensor -[ 48%] Building C object drivers/peripheral/acc/CMakeFiles/acc_sensor.dir/service/acc_service.c.obj -[ 50%] Built target lcd -[ 50%] Built target button -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:95:5: warning: implicit declaration of function 'uapi_tcxo_delay_ms' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_ms(cali_ms); +[ 56%] Linking C static library librtc_unified_port.a +[ 56%] Building C object drivers/chips/brandy/porting/button/CMakeFiles/button_port.dir/button_porting.c.obj +Scanning dependencies of target dfx_exception +[ 56%] Built target rtc_unified_port +[ 56%] Built target audio_drv +[ 56%] Building C object middleware/chips/brandy/exception/CMakeFiles/dfx_exception.dir/exception_riscv.c.obj +[ 56%] Built target partition_brandy +[ 56%] Linking C static library libbutton_port.a +[ 56%] Linking C static library libdfx_exception.a +Scanning dependencies of target update_common_brandy +Scanning dependencies of target update_storage_brandy +[ 56%] Built target dfx_exception +[ 56%] Building C object middleware/chips/brandy/update/common/CMakeFiles/update_common_brandy.dir/upg_common_porting.c.obj +Scanning dependencies of target pm_service +[ 56%] Building C object middleware/chips/brandy/update/storage/CMakeFiles/update_storage_brandy.dir/upg_backup.c.obj +Scanning dependencies of target pm_brandy +[ 56%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_dev.c.obj +[ 56%] Linking C static library libupdate_storage_brandy.a +Scanning dependencies of target dfx_port_brandy +[ 56%] Built target button_port +[ 56%] Linking C static library libupdate_common_brandy.a +[ 56%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_clocks.c.obj +Scanning dependencies of target nv_brandy +[ 56%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_fsm.c.obj +[ 56%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_config.c.obj +[ 56%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/dfx_channel.c.obj +[ 56%] Building C object middleware/chips/brandy/nv/nv_porting/CMakeFiles/nv_brandy.dir/nv_flash.c.obj +[ 56%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_sleep.c.obj +[ 56%] Built target update_storage_brandy +[ 56%] Built target update_common_brandy +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:96:52: warning: unused parameter 'fd' [-Wunused-parameter] +static errcode_t diag_channel_bt_gatt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:265:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:96:72: warning: unused parameter 'data_type' [-Wunused-parameter] +static errcode_t diag_channel_bt_gatt_output(void *fd, dfx_data_type_t data_type, uint8_t *data[], uint16_t len[], ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:269:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:97:13: warning: unused parameter 'cnt' [-Wunused-parameter] +uint8_t cnt) ^ -/home/snicker/hiwatch/code/sdk/drivers/chips/brandy/porting/button/button_porting.c:273:9: warning: implicit declaration of function 'uapi_tcxo_delay_us' is invalid in C99 [-Wimplicit-function-declaration] -uapi_tcxo_delay_us(ULP_INT_CLEAR_DELAY); +/home/snicker/hiwatch/code/sdk/middleware/chips/brandy/dfx/dfx_channel.c:116:15: warning: unused parameter 'status' [-Wunused-parameter] +errcode_t status) ^ 4 warnings generated. -[ 50%] Linking C static library libbutton_port.a -[ 50%] Built target ppg_sensor -Scanning dependencies of target mag_sensor -[ 50%] Building C object drivers/peripheral/mag/CMakeFiles/mag_sensor.dir/service/mag_service.c.obj -Scanning dependencies of target touch -[ 50%] Built target button_port -[ 50%] Building C object drivers/peripheral/touch/CMakeFiles/touch.dir/touch_screen_drv.c.obj -[ 50%] Built target vibrator -[ 50%] Linking C static library libacc_sensor.a -[ 50%] Built target custom_utils -[ 50%] Linking C static library libmag_sensor.a -[ 50%] Built target rotary_encoder -[ 50%] Built target acc_sensor -[ 50%] Built target dfx_exception -[ 50%] Built target mag_sensor -[ 50%] Building C object drivers/peripheral/touch/CMakeFiles/touch.dir/touch_screen_queue1.c.obj -[ 50%] Building C object drivers/peripheral/touch/CMakeFiles/touch.dir/ft6x46_touch/ft6x46_ctrl.c.obj -[ 51%] Built target dfx_port_brandy -Scanning dependencies of target pm_brandy -[ 51%] Built target pm_service -[ 51%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_lp_stub.c.obj -[ 51%] Built target partition_brandy -[ 51%] Built target update_common_brandy -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp:8: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h:19: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h:22: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h:19: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h:27: -/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h:34:30: warning: missing field 'transition' initializer [-Wmissing-field-initializers] -TransitionInfo info_ = {0}; -^ -1 warning generated. -[ 51%] Built target update_storage_brandy -[ 51%] Building C object drivers/peripheral/touch/CMakeFiles/touch.dir/ft6x46_touch/ft6x46_drv1.c.obj -[ 51%] Built target nv_brandy -[ 51%] Building C object drivers/peripheral/touch/CMakeFiles/touch.dir/ft6x46_touch/ft6x46_touch1.c.obj -[ 51%] Built target media_common -[ 51%] Built target audio_manager -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/dpu/soc_dpu_api.c.obj -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/soc_vau_api.c.obj -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_draw.c.obj -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_utility.c.obj -[ 51%] Linking C static library libpm_brandy.a -[ 51%] Built target audio_service -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/math/vau_math.c.obj -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/matrix/vau_matrix.c.obj -/home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp:634:38: warning: missing field 'type' initializer [-Wmissing-field-initializers] -hfp_hf_calls_info_t call = {0}; -^ -/home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp:634:38: warning: missing field 'id' initializer [-Wmissing-field-initializers] -/home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp:662:38: warning: missing field 'type' initializer [-Wmissing-field-initializers] -hfp_hf_calls_info_t call = {0}; -^ -/home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp:662:38: warning: missing field 'id' initializer [-Wmissing-field-initializers] +[ 56%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_control.c.obj +[ 56%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/dfx_system_init.c.obj +[ 56%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_sys.c.obj +[ 56%] Linking C static library libnv_brandy.a +[ 57%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_core.c.obj +[ 57%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/last_dump_adapt.c.obj +Scanning dependencies of target media_common +[ 57%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_tickless.c.obj +[ 57%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_lp_stub.c.obj +[ 57%] Built target nv_brandy +[ 58%] Building CXX object services/media/foundation/utils/CMakeFiles/media_common.dir/src/format.cpp.obj +[ 58%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/sample_data_adapt.c.obj +[ 58%] Building C object middleware/chips/brandy/pm/service/CMakeFiles/pm_service.dir/pm_veto.c.obj +[ 58%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_lpc.c.obj +[ 58%] Building C object middleware/chips/brandy/dfx/CMakeFiles/dfx_port_brandy.dir/zdiag_adapt_sdt.c.obj +[ 58%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_os.c.obj +Scanning dependencies of target audio_manager +[ 58%] Building CXX object services/media/foundation/utils/CMakeFiles/media_common.dir/src/media_log.cpp.obj +[ 58%] Linking C static library libpm_service.a +[ 58%] Linking C static library libdfx_port_brandy.a +[ 58%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm_adapt/pm_pmu.c.obj +[ 58%] Linking CXX static library ../../../../lib/media/evb_standard/libmedia_common.a +[ 58%] Building C object middleware/chips/brandy/pm/CMakeFiles/pm_brandy.dir/pm.c.obj +[ 58%] Building CXX object services/media/foundation/manager/f/audiomanager/CMakeFiles/audio_manager.dir/cpp/audio_callback_dispatcher.cpp.obj +[ 58%] Linking C static library libpm_brandy.a +[ 58%] Built target dfx_port_brandy +[ 58%] Built target pm_service +[ 58%] Building CXX object services/media/foundation/manager/f/audiomanager/CMakeFiles/audio_manager.dir/cpp/audio_manager.cpp.obj +[ 58%] Built target pm_brandy +Scanning dependencies of target audio_utils +[ 58%] Building CXX object services/media/foundation/manager/f/audiomanager/CMakeFiles/audio_manager.dir/cpp/audio_manager_impl.cpp.obj +[ 58%] Built target media_common +[ 58%] Building C object services/media/foundation/manager/f/audioutils/CMakeFiles/audio_utils.dir/src/audio_utils.c.obj +Scanning dependencies of target audio_stream +Scanning dependencies of target audio_service +[ 58%] Building CXX object services/media/foundation/manager/f/audiostream/CMakeFiles/audio_stream.dir/src/cpp/audio_stream_in.cpp.obj +[ 58%] Linking C static library ../../../../../../lib/media/evb_standard/libaudio_utils.a +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/audio_service.c.obj +[ 58%] Linking CXX static library ../../../../../../lib/media/evb_standard/libaudio_manager.a +[ 58%] Building CXX object services/media/foundation/manager/f/audiostream/CMakeFiles/audio_stream.dir/src/cpp/audio_stream_out.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiostream/src/cpp/audio_stream_out.cpp:63:80: warning: unused parameter 'renderConfig' [-Wunused-parameter] +int32_t AudioStreamOut::SetOutputDevice(int32_t deviceId, AudioRendererConfig &renderConfig) const +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiostream/src/cpp/audio_stream_out.cpp:135:58: warning: unused parameter 'renderConfig' [-Wunused-parameter] +AudioRendererConfig &renderConfig) const +^ +2 warnings generated. +[ 58%] Linking CXX static library ../../../../../../lib/media/evb_standard/libaudio_stream.a +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/devicemanager/src/device_config.c.obj +Scanning dependencies of target js_player +[ 58%] Built target audio_manager +[ 58%] Built target audio_utils +[ 58%] Building CXX object services/media/foundation/player/i/CMakeFiles/js_player.dir/src/audio_player.cpp.obj +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/devicemanager/src/device_hal.c.obj +[ 58%] Built target audio_stream +[ 58%] Building CXX object services/media/foundation/player/i/CMakeFiles/js_player.dir/src/audio_module.cpp.obj +Scanning dependencies of target js_audio_captuer +Scanning dependencies of target audio_capture +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/devicemanager/src/device_manager.c.obj +[ 58%] Building CXX object services/media/foundation/capturer/f/CMakeFiles/audio_capture.dir/audio_capturer.cpp.obj +[ 58%] Linking CXX static library ../../../../../../../../../interim_binary/brandy/libs/media/evb_standard/libjs_player.a +[ 58%] Building CXX object services/media/foundation/capturer/js_buildin/CMakeFiles/js_audio_captuer.dir/recording_module.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/devicemanager/src/device_manager.c:339:67: warning: unused parameter 'streamType' [-Wunused-parameter] +int32_t DeviceMgrDestroyStreamIn(uint32_t device, AudioStreamType streamType, Handle inputStreamHandle) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/devicemanager/src/device_manager.c:360:68: warning: unused parameter 'streamType' [-Wunused-parameter] +int32_t DeviceMgrDestroyStreamOut(uint32_t device, AudioStreamType streamType, Handle outputStreamHandle) +^ +2 warnings generated. +[ 58%] Building CXX object services/media/foundation/capturer/f/CMakeFiles/audio_capture.dir/audio_capturer_impl.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audio_capturer/interfaces/kits/audio_captuer_lite/recording_module.cpp:234:16: warning: unused function 'HandleAudioCaptureCmd' [-Wunused-function] +static int32_t HandleAudioCaptureCmd(int32_t argc, const char **argv) +^ +1 warning generated. +[ 58%] Built target js_player +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/policymanager/src/devices_manager.c.obj +[ 58%] Linking CXX static library ../../../../../../../../../interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audio_capturer/frameworks/audio_capturer_impl.cpp:85:95: warning: unused parameter 'base' [-Wunused-parameter] +bool AudioCapturer::AudioCapturerImpl::GetTimestamp(Timestamp ×tamp, Timestamp::Timebase base) +^ +1 warning generated. +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/policymanager/src/interrupt_manager.c.obj +[ 58%] Building CXX object services/media/foundation/capturer/f/CMakeFiles/audio_capture.dir/audio_source/audio_stream_source/audio_source.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:991:32: warning: passing 'const InterruptElement *' to parameter of type 'InterruptElement *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +if (InterruptCheckIsReject(interruptEl, true, &isDelay)) { +^~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:401:54: note: passing argument to parameter 'newInterruptEl' here +static bool InterruptCheckIsReject(InterruptElement *newInterruptEl, bool isOutput, bool *isDelay) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:1047:32: warning: passing 'const InterruptElement *' to parameter of type 'InterruptElement *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +if (InterruptCheckIsReject(interruptEl, false, &isDelay)) { +^~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:401:54: note: passing argument to parameter 'newInterruptEl' here +static bool InterruptCheckIsReject(InterruptElement *newInterruptEl, bool isOutput, bool *isDelay) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:1082:32: warning: passing 'const InterruptElement *' to parameter of type 'InterruptElement *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +if (InterruptCheckIsReject(interruptEl, false, &isInPutDelay) || +^~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:401:54: note: passing argument to parameter 'newInterruptEl' here +static bool InterruptCheckIsReject(InterruptElement *newInterruptEl, bool isOutput, bool *isDelay) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:1083:32: warning: passing 'const InterruptElement *' to parameter of type 'InterruptElement *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +InterruptCheckIsReject(interruptEl, true, &isOutPutDelay)) { +^~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c:401:54: note: passing argument to parameter 'newInterruptEl' here +static bool InterruptCheckIsReject(InterruptElement *newInterruptEl, bool isOutput, bool *isDelay) +^ 4 warnings generated. -[ 51%] Built target audio_stream -[ 51%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/compress/vau_compress.c.obj -[ 51%] Built target audio_utils -[ 52%] Built target pm_brandy -[ 52%] Built target js_player -[ 52%] Building C object services/gpu/CMakeFiles/gpu.dir/api/gmmu/src/soc_gmmu_api.c.obj -[ 52%] Built target audio_capture -[ 52%] Built target player -[ 52%] Built target js_audio_captuer -[ 52%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_api.c.obj -[ 52%] Built target media_hal_common -[ 52%] Built target audio_hw -[ 52%] Linking C static library libtouch.a -[ 52%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_config.c.obj -[ 52%] Built target media_sample_wrapper -[ 52%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_context.c.obj -[ 52%] Built target audio_primary_port -[ 52%] Built target audio_bluetooth_port -[ 52%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_display.c.obj -[ 52%] Built target audio_modem_port -[ 53%] Built target audio_port_common -[ 53%] Built target touch -[ 53%] Built target format_hw -[ 53%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_egl.c.obj -[ 53%] Built target plugin_demuxer_raw -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp:8: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistPresenter.h:12: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h:19: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h:27: -/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h:34:30: warning: missing field 'transition' initializer [-Wmissing-field-initializers] -TransitionInfo info_ = {0}; +Scanning dependencies of target media_hal_common +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/policymanager/src/policy_config.c.obj +[ 58%] Building C object services/media/hal/common/CMakeFiles/media_hal_common.dir/src/media_hal_common.c.obj +[ 58%] Built target js_audio_captuer +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audio_capturer/frameworks/audio_source/audio_stream_source/audio_source.cpp:125:46: warning: unused parameter 'deviceId' [-Wunused-parameter] +int32_t AudioSource::SetInputDevice(uint32_t deviceId) ^ -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp:8: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistPresenter.h:13: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: -/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/graphic/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] -rotateEventInjector_(nullptr), +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audio_capturer/frameworks/audio_source/audio_stream_source/audio_source.cpp:164:56: warning: unused parameter 'isBlockingRead' [-Wunused-parameter] +int32_t AudioSource::ReadFrame(AudioFrame &frame, bool isBlockingRead) ^ 2 warnings generated. -[ 53%] Built target codec_plugin_vdec -[ 53%] Built target codec_hw -[ 53%] Built target camera_codec_hw -[ 53%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_mutex.c.obj -[ 54%] Built target hdi_camera_intf -[ 54%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_surface.c.obj -[ 54%] Built target display_layer -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_context.c.obj -[ 55%] Built target graphic_utils -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/openvg_api.c.obj -[ 55%] Built target display_gralloc -Scanning dependencies of target graphic_input -[ 55%] Built target graphic_service -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_draw.c.obj -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_image.c.obj -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_math.c.obj -[ 55%] Built target algorithm -[ 55%] Built target app_version -[ 55%] Building C object services/gui/hal/input/CMakeFiles/graphic_input.dir/src/input_manager.c.obj -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_paint.c.obj -[ 55%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_matrix.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_resource.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_path.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vgu.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/hdf/hchip/hdi_gfx.c.obj -[ 56%] Built target at_cmd -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/hdf/hchip/hdi_hardware_capability.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/soc_jpeg_api.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_csc.c.obj -[ 56%] Built target build_version -[ 56%] Built target connectivity -[ 56%] Built target cpu_load -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_mem.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_exif.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_parse.c.obj -[ 56%] Built target dfx_preserve -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_stream.c.obj -[ 56%] Built target soc_log -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_table.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/intf/drv_dpu_intf.c.obj -[ 56%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/ioctl/dpu_ioctl.c.obj -[ 60%] Built target graphic_ui -[ 61%] Built target log_file -[ 61%] Built target dfx_panic -[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/layer/dpu_layer.c.obj -[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/disp/dpu_disp.c.obj -[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/clock/dpu_clock.c.obj -[ 63%] Built target dfx_diag -/home/snicker/hiwatch/code/sdk/middleware/services/gui/hal/input/src/input_manager.c:45:80: warning: unused parameter 'callback' [-Wunused-parameter] -__attribute__((weak)) uint32_t button_register_report_event_cb(report_event_cb callback) -^ -1 warning generated. -[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/dfx/dpu_dfx.c.obj -[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal.c.obj +[ 58%] Linking CXX static library ../../../../../lib/media/evb_standard/libaudio_capture.a +[ 58%] Building C object services/media/hal/common/CMakeFiles/media_hal_common.dir/src/media_hal_thread_adapt.c.obj +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/policymanager/src/policy_manager.c.obj +Scanning dependencies of target player +[ 58%] Linking C static library ../../../../lib/media/evb_standard/liteos/libmedia_hal_common.a +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/streammanager/src/source_handle.c.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/buffersource/src/buffer_source.cpp.obj +Scanning dependencies of target audio_hw +[ 58%] Built target audio_capture +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/buffersource/src/buffer_source.cpp:166:58: warning: unused parameter 'timeOut' [-Wunused-parameter] +int BufferSource::DequeIdleBuffer(QueBuffer* buffer, int timeOut) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/buffersource/src/buffer_source.cpp:207:60: warning: unused parameter 'timeOut' [-Wunused-parameter] +int BufferSource::DequeFilledBuffer(QueBuffer* buffer, int timeOut) +^ +2 warnings generated. +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/streammanager/src/stream_manager.c.obj +[ 58%] Building C object services/media/hal/audio/CMakeFiles/audio_hw.dir/src/audio_manager.c.obj +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/streammanager/src/stream_utils.c.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c:146:19: warning: implicit declaration of function 'sprintf_s' is invalid in C99 [-Wimplicit-function-declaration] +int32_t ret = sprintf_s(typeVolumeStr, MAX_FLOAT_TO_CHAR_NUM, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c:694:9: warning: implicit declaration of function 'SetHifiClockFreqByStreamTypeAndDeviceType' is invalid in C99 [-Wimplicit-function-declaration] +SetHifiClockFreqByStreamTypeAndDeviceType(streamType, deviceType, false); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c:764:9: warning: implicit declaration of function 'SetHifiClockFreqByStreamTypeAndDeviceType' is invalid in C99 [-Wimplicit-function-declaration] +SetHifiClockFreqByStreamTypeAndDeviceType(streamType, deviceType, false); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c:791:23: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] +for (int i = 0; i < infoSize; i++) { +~ ^ ~~~~~~~~ +4 warnings generated. +[ 58%] Building C object services/media/hal/audio/CMakeFiles/audio_hw.dir/src/audio_adapter.c.obj +[ 58%] Built target media_hal_common +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/streammanager/src/track_handle.c.obj +[ 58%] Building C object services/media/hal/audio/CMakeFiles/audio_hw.dir/src/audio_capture.c.obj +[ 58%] Building C object services/media/hal/audio/CMakeFiles/audio_hw.dir/src/audio_render.c.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/player/liteplayer.cpp.obj +Scanning dependencies of target gpu +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c:196:5: warning: implicit declaration of function 'SetHifiClockFreqByStreamTypeAndDeviceType' is invalid in C99 [-Wimplicit-function-declaration] +SetHifiClockFreqByStreamTypeAndDeviceType(context->streamInfo.streamType, (AudioDeviceType)validFwDevice, false); +^ +1 warning generated. +[ 58%] Building C object services/media/hal/audio/CMakeFiles/audio_hw.dir/src/audio_plugins_manager/src/audio_plugins_manager.c.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/player/liteplayer_comm.cpp.obj +Scanning dependencies of target audio_primary_port +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp:1142:70: warning: unused parameter 'codecFormat' [-Wunused-parameter] +void PlayerControl::GetRenderFullSleepThresholdTime(AudioCodecFormat codecFormat) +^ +1 warning generated. +[ 58%] Building C object services/media/foundation/manager/f/audioservice/CMakeFiles/audio_service.dir/src/policymanager/src/hifi_clock_freq_manager.c.obj +Scanning dependencies of target media_sample_wrapper +[ 58%] Building C object services/media/hal/audio/plugins/brandy/primary/CMakeFiles/audio_primary_port.dir/primary_port.c.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/sink/player_sync.cpp.obj +[ 58%] Linking C static library ../../../../lib/media/evb_standard/liteos/libaudio_hw.a +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/sink/player_audio_sink.cpp.obj +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/audio_capture_wrapper.cpp.obj +[ 58%] Building C object services/gpu/CMakeFiles/gpu.dir/api/dpu/soc_dpu_api.c.obj +[ 58%] Linking C static library ../../../../../../lib/media/evb_standard/libaudio_service.a +[ 58%] Building C object services/media/hal/audio/plugins/brandy/primary/CMakeFiles/audio_primary_port.dir/primary_sub_port_in.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c:648:18: warning: incompatible function pointer types initializing 'AudioPortInvokeFunc' (aka 'int (*)(void *, char *, unsigned int)') with an expression of type 'int32_t (AudioHandle, const char *, uint32_t)' (aka 'int (void *, const char *, unsigned int)') [-Wincompatible-function-pointer-types] +{SEA_ENABLE, PrimarySetSeaEnable, true}, +^~~~~~~~~~~~~~~~~~~ +1 warning generated. +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/sink/player_video_sink.cpp.obj +[ 58%] Building C object services/media/hal/audio/plugins/brandy/primary/CMakeFiles/audio_primary_port.dir/primary_sub_port_out.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp:342:59: warning: unused parameter 'argv' [-Wunused-parameter] +static int32_t CheckInputParam(int32_t argc, const char **argv) +^ +1 warning generated. +[ 58%] Built target audio_hw +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/audio_scene_interaction.cpp.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c:585:25: warning: incompatible function pointer types initializing 'uapi_adp_event_proc' (aka 'int (*)(unsigned int, uapi_adp_event_type, void *, void *)') with an expression of type 'int32_t (td_handle, uapi_adp_event_type, const td_void *, td_void *)' (aka 'int (unsigned int, uapi_adp_event_type, const void *, void *)') [-Wincompatible-function-pointer-types] +uapi_adp_event_proc adpCallback = AdpEventCB; +^ ~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c:809:25: warning: incompatible function pointer types initializing 'uapi_adp_event_proc' (aka 'int (*)(unsigned int, uapi_adp_event_type, void *, void *)') with an expression of type 'int32_t (td_handle, uapi_adp_event_type, const td_void *, td_void *)' (aka 'int (unsigned int, uapi_adp_event_type, const void *, void *)') [-Wincompatible-function-pointer-types] +uapi_adp_event_proc adpCallback = AdpEventCB; +^ ~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_out.c:916:12: warning: implicit declaration of function 'UpdateCurrentPosition' is invalid in C99 [-Wimplicit-function-declaration] +return UpdateCurrentPosition(portTrackOutCtx->trackHandle, time); +^ +3 warnings generated. +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/player_sample_wrapper.cpp.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/sink/player_sink_manager.cpp.obj +[ 58%] Built target audio_service +[ 58%] Linking C static library ../../../../../../../lib/media/evb_standard/liteos/libaudio_primary_port.a +[ 58%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/soc_vau_api.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:767:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction001(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:767:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction001(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:782:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction002(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:782:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction002(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:797:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction003(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:797:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction003(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:812:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction004(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:812:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction004(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:827:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction005(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:827:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction005(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:841:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction006(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:841:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction006(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:855:42: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t AudioSceneInteraction007(int32_t argc, const char *argv[]) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_scene_interaction.cpp:855:60: warning: unused parameter 'argv' [-Wunused-parameter] +int32_t AudioSceneInteraction007(int32_t argc, const char *argv[]) +^ +14 warnings generated. +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp:472:25: warning: unused parameter 'type' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) override +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/player_sample_wrapper.cpp:472:39: warning: unused parameter 'extra' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) override +^ +2 warnings generated. +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/video_player_sample_wrapper.cpp.obj +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/voice_call_volte_sample_wrapper.cpp.obj +[ 58%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/source/player_demux.cpp.obj +[ 58%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_draw.c.obj +Scanning dependencies of target audio_bluetooth_port +Scanning dependencies of target audio_modem_port +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp:527:44: warning: unused parameter 'param' [-Wunused-parameter] +static int32_t StartVoiceCall(const char **param) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp:561:43: warning: unused parameter 'param' [-Wunused-parameter] +static int32_t StopVoiceCall(const char **param) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_sample_wrapper.cpp:628:38: warning: unused parameter 'argc' [-Wunused-parameter] +int32_t VoiceCallVolteSample(int32_t argc, const char *argv[]) +^ +3 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:34: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:45: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:70: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:65: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:60: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:63: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:66: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:44: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:69: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:67: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1270:46: warning: unused parameter 'id' [-Wunused-parameter] +virtual UIView* GetChildById(const char* id) const +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1338:38: warning: unused parameter 'neeInvalidate' [-Wunused-parameter] +virtual void LayoutChildren(bool neeInvalidate = false) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1729:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnFocus(UIView& view) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1740:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnBlur(UIView& view) +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:34: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:47: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h:36: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:146:28: warning: unused parameter 'usage' [-Wunused-parameter] +void SetUsage(uint32_t usage) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:41: warning: unused parameter 'key' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:65: warning: unused parameter 'value' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:175:48: warning: unused parameter 'key' [-Wunused-parameter] +std::string GetUserData(const std::string& key) override +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:42: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/animator/animator.h:71:33: warning: unused parameter 'view' [-Wunused-parameter] +virtual void OnStop(UIView& view) {} +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:42: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:13: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h:165:26: warning: unused parameter 'invalidatedArea' [-Wunused-parameter] +bool OnPreDraw(Rect& invalidatedArea) const override +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:42: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h:39: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:442:52: warning: unused parameter 'dragDistanceX' [-Wunused-parameter] +virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) {}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:442:76: warning: unused parameter 'dragDistanceY' [-Wunused-parameter] +virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) {}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:448:39: warning: unused parameter 'distanceX' [-Wunused-parameter] +virtual void FixDistance(int16_t& distanceX, int16_t& distanceY) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:448:59: warning: unused parameter 'distanceY' [-Wunused-parameter] +virtual void FixDistance(int16_t& distanceX, int16_t& distanceY) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:213:25: warning: unused parameter 'type' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) override +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp:213:39: warning: unused parameter 'extra' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) override +^ +38 warnings generated. +[ 58%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/audio_manager_c_wrapper.cpp.obj +[ 58%] Built target audio_primary_port +[ 59%] Building C object services/media/hal/audio/plugins/brandy/modem/CMakeFiles/audio_modem_port.dir/modem_port.c.obj +[ 59%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/video_play_wrapper.cpp.obj +[ 59%] Building C object services/media/hal/audio/plugins/brandy/bluetooth/CMakeFiles/audio_bluetooth_port.dir/bluetooth_port.c.obj +[ 59%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/source/player_source.cpp.obj +[ 59%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/draw/vau_utility.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_manager_c_wrapper.cpp:407:71: warning: unused parameter 'a2dpContext' [-Wunused-parameter] +static int32_t DisConnectBluetoothA2dpDevice(AudioManagerA2dpContext *a2dpContext) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_manager_c_wrapper.cpp:420:68: warning: unused parameter 'a2dpContext' [-Wunused-parameter] +static int32_t ConnectBluetoothA2dpDevice(AudioManagerA2dpContext *a2dpContext) +^ +2 warnings generated. +[ 59%] Building C object services/media/hal/audio/plugins/brandy/modem/CMakeFiles/audio_modem_port.dir/modem_sub_port.c.obj +[ 59%] Building C object services/media/hal/audio/plugins/brandy/bluetooth/CMakeFiles/audio_bluetooth_port.dir/bluetooth_sub_port.c.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:12: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:45: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:70: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:65: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:60: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:63: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:66: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:44: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:69: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:67: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1270:46: warning: unused parameter 'id' [-Wunused-parameter] +virtual UIView* GetChildById(const char* id) const +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1338:38: warning: unused parameter 'neeInvalidate' [-Wunused-parameter] +virtual void LayoutChildren(bool neeInvalidate = false) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1729:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnFocus(UIView& view) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1740:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnBlur(UIView& view) +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:12: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:47: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h:36: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:146:28: warning: unused parameter 'usage' [-Wunused-parameter] +void SetUsage(uint32_t usage) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:41: warning: unused parameter 'key' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:65: warning: unused parameter 'value' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:175:48: warning: unused parameter 'key' [-Wunused-parameter] +std::string GetUserData(const std::string& key) override +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/animator/animator.h:71:33: warning: unused parameter 'view' [-Wunused-parameter] +virtual void OnStop(UIView& view) {} +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:13: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_label.h:165:26: warning: unused parameter 'invalidatedArea' [-Wunused-parameter] +bool OnPreDraw(Rect& invalidatedArea) const override +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h:39: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:442:52: warning: unused parameter 'dragDistanceX' [-Wunused-parameter] +virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) {}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:442:76: warning: unused parameter 'dragDistanceY' [-Wunused-parameter] +virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) {}; +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:448:39: warning: unused parameter 'distanceX' [-Wunused-parameter] +virtual void FixDistance(int16_t& distanceX, int16_t& distanceY) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_scroll.h:448:59: warning: unused parameter 'distanceY' [-Wunused-parameter] +virtual void FixDistance(int16_t& distanceX, int16_t& distanceY) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:90:25: warning: unused parameter 'type' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp:90:39: warning: unused parameter 'extra' [-Wunused-parameter] +void OnInfo(int32_t type, int32_t extra) +^ +38 warnings generated. +Scanning dependencies of target audio_port_common +[ 59%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/matrix/vau_matrix.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/modem/modem_sub_port.c:300:55: warning: unused parameter 'portCtx' [-Wunused-parameter] +static int32_t SubPortTrackInit(const SubPortContext *portCtx, const struct PortPluginAttr *inputAttr, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/modem/modem_sub_port.c:745:18: warning: incompatible function pointer types initializing 'AudioPortInvokeFunc' (aka 'int (*)(void *, char *, unsigned int)') with an expression of type 'int32_t (AudioHandle, const char *, uint32_t)' (aka 'int (void *, const char *, unsigned int)') [-Wincompatible-function-pointer-types] +{SEA_ENABLE, ModemSetSeaEnable, true}, +^~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/modem/modem_sub_port.c:1532:25: warning: assigning to 'enum AudioFormat *' from 'const enum AudioFormat [1]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +capability->formats = g_supportFormats; +^ ~~~~~~~~~~~~~~~~ +3 warnings generated. +[ 59%] Building CXX object services/media/foundation/sample/wrapper/CMakeFiles/media_sample_wrapper.dir/camera_preview_sample_wrapper.cpp.obj +[ 59%] Building C object services/media/hal/audio/plugins/brandy/common/CMakeFiles/audio_port_common.dir/src/plugin_common.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/bluetooth/bluetooth_sub_port.c:327:9: warning: incompatible function pointer types initializing 'TrackSetVolumeFunc' (aka 'int (*)(const SubPortTrackContext *, float)') with an expression of type 'int32_t (SubPortTrackContext *, float)' (aka 'int (SubPortTrackContext *, float)') [-Wincompatible-function-pointer-types] +TrackSetVolumeInBluetoothA2DPSourceNormalScene, TrackGetVolumeInBluetoothA2DPSourceNormalScene, +^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/bluetooth/bluetooth_sub_port.c:490:30: warning: assigning to 'struct SubPortContext *' from 'const SubPortContext *' (aka 'const struct SubPortContext *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +portTrackCtx->subPortCtx = portCtx; +^ ~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/bluetooth/bluetooth_sub_port.c:1823:12: warning: implicit declaration of function 'UpdateCurrentPosition' is invalid in C99 [-Wimplicit-function-declaration] +return UpdateCurrentPosition(portTrackCtx->trackHandle, time); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/bluetooth/bluetooth_sub_port.c:2770:24: warning: passing 'const SubPortTrackContext *' to parameter of type 'SubPortTrackContext *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] +DecreaseTrackCount(portTrackCtx); +^~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/bluetooth/bluetooth_sub_port.c:2680:53: note: passing argument to parameter 'portTrackCtx' here +static void DecreaseTrackCount(SubPortTrackContext *portTrackCtx) +^ +4 warnings generated. +[ 59%] Linking C static library ../../../../../../../lib/media/evb_standard/liteos/libaudio_modem_port.a +[ 59%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_control/decoder/decoder.cpp.obj +[ 59%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/compress/vau_compress.c.obj +[ 59%] Building CXX object services/media/foundation/player/f/CMakeFiles/player.dir/player_impl.cpp.obj +[ 59%] Building C object services/media/hal/audio/plugins/brandy/bluetooth/CMakeFiles/audio_bluetooth_port.dir/latm_simple_muxer.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/common/src/plugin_common.c:55:49: warning: implicitly declaring library function 'log' with type 'double (double)' [-Wimplicit-function-declaration] +double tmpDb = PERCENT_TO_GAIN_LOG_FACTOR * log(volume * VOLUME_UNIT / VOLUME_UNIT); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/common/src/plugin_common.c:55:49: note: include the header or explicitly provide a declaration for 'log' +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/common/src/plugin_common.c:746:71: warning: unused parameter 'valueLen' [-Wunused-parameter] +int32_t SetSeaEnable(td_handle seaHandle, const char *value, uint32_t valueLen) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/common/src/plugin_common.c:870:16: warning: implicit declaration of function 'GetModemPortPluginFuncs' is invalid in C99 [-Wimplicit-function-declaration] +return GetModemPortPluginFuncs(pluginType); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/audio/plugins/brandy/common/src/plugin_common.c:870:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'const AudioPortPlugin *' [-Wint-conversion] +return GetModemPortPluginFuncs(pluginType); +^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +4 warnings generated. +[ 59%] Linking C static library ../../../../../../../lib/media/evb_standard/liteos/libaudio_port_common.a +[ 59%] Building C object services/gpu/CMakeFiles/gpu.dir/api/vau/debug/vau_debug.c.obj +[ 59%] Linking C static library ../../../../../../../lib/media/evb_standard/liteos/libaudio_bluetooth_port.a +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/player_impl.cpp:1161:57: warning: unused parameter 'params' [-Wunused-parameter] +void AdapterStreamCallback::SetParameters(const Format ¶ms) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/player_impl.cpp:1185:89: warning: unused parameter 'timeOutMs' [-Wunused-parameter] +int32_t Player::PlayerImpl::ReadData(void *handle, uint8_t *data, int32_t size, int32_t timeOutMs, DataFlags *flags) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/player/frameworks/player_impl.cpp:1304:56: warning: unused parameter 'params' [-Wunused-parameter] +int32_t Player::PlayerImpl::SetParameter(const Format ¶ms) +^ +3 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp:29: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:45: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:208:70: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnLongPress(UIView& view, const LongPressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:239:65: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragStart(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:254:60: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDrag(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:269:63: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnDragEnd(UIView& view, const DragEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:301:62: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnPress(UIView& view, const PressEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:40: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:316:66: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRelease(UIView& view, const ReleaseEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:331:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnCancel(UIView& view, const CancelEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:44: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:360:69: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateStart(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:39: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:373:64: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotate(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:42: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:385:67: warning: unused parameter 'event' [-Wunused-parameter] +virtual bool OnRotateEnd(UIView& view, const RotateEvent& event) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1270:46: warning: unused parameter 'id' [-Wunused-parameter] +virtual UIView* GetChildById(const char* id) const +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1338:38: warning: unused parameter 'neeInvalidate' [-Wunused-parameter] +virtual void LayoutChildren(bool neeInvalidate = false) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1729:38: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnFocus(UIView& view) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:1740:37: warning: unused parameter 'view' [-Wunused-parameter] +virtual bool OnBlur(UIView& view) +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp:29: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h:47: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h:36: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:146:28: warning: unused parameter 'usage' [-Wunused-parameter] +void SetUsage(uint32_t usage) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:41: warning: unused parameter 'key' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:166:65: warning: unused parameter 'value' [-Wunused-parameter] +void SetUserData(const std::string& key, const std::string& value) override {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h:175:48: warning: unused parameter 'key' [-Wunused-parameter] +std::string GetUserData(const std::string& key) override +^ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp:251:21: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare] +if (loopCnt > TIME_OUT_LOOP_CNT) { +~~~~~~~ ^ ~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp:268:21: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare] +if (loopCnt > TIME_OUT_LOOP_CNT) { +~~~~~~~ ^ ~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp:366:21: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare] +if (loopCnt > TIME_OUT_LOOP_CNT) { +~~~~~~~ ^ ~~~~~~~~~~~~~~~~~ +33 warnings generated. +[ 59%] Linking CXX static library ../../../../../lib/media/evb_standard/libplayer.a +[ 59%] Linking CXX static library ../../../../../lib/media/evb_standard/libmedia_sample_wrapper.a +[ 59%] Building C object services/gpu/CMakeFiles/gpu.dir/api/gmmu/src/soc_gmmu_api.c.obj +[ 59%] Built target audio_modem_port +[ 59%] Built target audio_port_common +[ 59%] Built target audio_bluetooth_port +Scanning dependencies of target format_hw +[ 60%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_api.c.obj +Scanning dependencies of target plugin_demuxer_raw +[ 60%] Built target player +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/format_manager.c.obj +[ 60%] Built target media_sample_wrapper +[ 60%] Building C object services/media/hal/format/plugins/raw_demuxer/CMakeFiles/plugin_demuxer_raw.dir/raw_format.c.obj +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/demuxer_manager/src/demuxer_manager.c.obj +Scanning dependencies of target codec_hw +[ 60%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_config.c.obj +Scanning dependencies of target codec_plugin_vdec +Scanning dependencies of target camera_codec_hw +[ 60%] Building C object services/media/hal/codec/plugins/brandy/CMakeFiles/codec_plugin_vdec.dir/video_decoder/native_vdec_jpeg.c.obj +[ 60%] Building C object services/media/hal/codec/CMakeFiles/codec_hw.dir/src/codec_v2.c.obj +[ 60%] Building C object services/media/hal/camera/hw_camera/CMakeFiles/camera_codec_hw.dir/src/virtual_camera_impl.c.obj +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/demuxer_plugins_manager/src/demuxer_plugins_manager.c.obj +[ 60%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_context.c.obj +[ 60%] Building C object services/media/hal/format/plugins/raw_demuxer/CMakeFiles/plugin_demuxer_raw.dir/silk_demuxer.c.obj +[ 60%] Built target hdi_camera_intf +[ 60%] Linking C static library ../../../../../../lib/media/evb_standard/liteos/libcodec_plugin_vdec.a +[ 60%] Building C object services/media/hal/codec/CMakeFiles/codec_hw.dir/src/codec_config/codec_config.c.obj +[ 60%] Building C object services/media/hal/codec/CMakeFiles/codec_hw.dir/src/buffer_channel/buffer_channel.c.obj +[ 60%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_display.c.obj +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/muxer_manager/src/muxer_manager.c.obj +[ 60%] Linking C static library ../../../../../lib/media/evb_standard/liteos/libcamera_codec_hw.a +[ 60%] Building C object services/media/hal/format/plugins/raw_demuxer/CMakeFiles/plugin_demuxer_raw.dir/sbc_demuxer.c.obj +[ 60%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_egl.c.obj +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/muxer_plugins_manager/src/muxer_plugins_manager.c.obj +[ 60%] Built target codec_plugin_vdec +[ 60%] Building C object services/media/hal/codec/CMakeFiles/codec_hw.dir/src/common/codec_common.c.obj +/home/snicker/hiwatch/code/sdk/middleware/services/media/hal/format/plugins/raw_demuxer/sbc_demuxer.c:124:17: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned int') and 'int' [-Wsign-compare] +if (readLen == -1) { +~~~~~~~ ^ ~~ +1 warning generated. +[ 60%] Building C object services/media/hal/codec/CMakeFiles/codec_hw.dir/src/pluginManager/codec_plugin_manager.c.obj +[ 60%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/plugins_manager_common/src/plugins_manager_common.c.obj +[ 61%] Building C object services/media/hal/format/CMakeFiles/format_hw.dir/src/protocol_plugins_manager/src/protocol_plugins_manager.c.obj +[ 61%] Linking C static library ../../../../../../lib/media/evb_standard/liteos/libplugin_demuxer_raw.a +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_mutex.c.obj +[ 61%] Built target camera_codec_hw +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/egl/src/egl_surface.c.obj +[ 61%] Linking C static library ../../../../lib/media/evb_standard/liteos/libcodec_hw.a +[ 61%] Linking C static library ../../../../lib/media/evb_standard/liteos/libformat_hw.a +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/openvg_api.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_context.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_draw.c.obj +[ 61%] Built target plugin_demuxer_raw +[ 61%] Built target format_hw +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_image.c.obj +[ 61%] Built target codec_hw +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_math.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_matrix.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_paint.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_path.c.obj +Scanning dependencies of target display_gralloc +Scanning dependencies of target display_layer +[ 61%] Building C object services/gui/hal/display/CMakeFiles/display_gralloc.dir/src/display_gralloc.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vg_resource.c.obj +Scanning dependencies of target graphic_input +[ 61%] Building C object services/gui/hal/display/CMakeFiles/display_layer.dir/src/display_layer.c.obj +[ 61%] Building C object services/gui/hal/display/CMakeFiles/display_gralloc.dir/mempool/src/mem_pool_los.c.obj +[ 61%] Building C object services/gui/hal/input/CMakeFiles/graphic_input.dir/src/input_manager.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/vg/src/vgu.c.obj +Scanning dependencies of target graphic_service +[ 61%] Linking C static library libdisplay_layer.a +[ 61%] Linking C static library libdisplay_gralloc.a +[ 61%] Linking C static library libgraphic_input.a +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/hdf/hchip/hdi_gfx.c.obj +[ 61%] Building CXX object uikit/proprietary/src/service/CMakeFiles/graphic_service.dir/src/graphic_service.cpp.obj +[ 61%] Built target display_layer +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/openvg/hdf/hchip/hdi_hardware_capability.c.obj +[ 61%] Built target graphic_input +[ 61%] Building CXX object uikit/proprietary/src/service/CMakeFiles/graphic_service.dir/src/graphic_event_handler.cpp.obj +[ 61%] Built target display_gralloc +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/soc_jpeg_api.c.obj +Scanning dependencies of target app_version +Scanning dependencies of target algorithm +Scanning dependencies of target at_cmd +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_csc.c.obj +[ 61%] Building C object utils/app_version/CMakeFiles/app_version.dir/private/application_version.c.obj +[ 61%] Building C object utils/algorithm/CMakeFiles/algorithm.dir/sec_random/sec_random.c.obj +[ 61%] Building C object utils/at/wstp_at/CMakeFiles/at_cmd.dir/src/at_cmd_task.c.obj +[ 61%] Building CXX object uikit/proprietary/src/service/CMakeFiles/graphic_service.dir/src/graphic_service_wrapper.cpp.obj +[ 61%] Linking C static library libapp_version.a +/home/snicker/hiwatch/code/sdk/middleware/utils/at/wstp_at/src/at_cmd_task.c:194:57: warning: incompatible pointer types passing 'btsrv_calibration_config_t *' to parameter of type 'const ipc_payload *' [-Wincompatible-pointer-types] +ipc_send_message(CORES_BT_CORE, IPC_ACTION_BT_CALI, config, value_len, IPC_PRIORITY_LOWEST, false); +^~~~~~ +/home/snicker/hiwatch/code/sdk/drivers/drivers/driver/ipc/ipc_old/shared/ipc.h:224:50: note: passing argument to parameter 'payload_p' here +const ipc_payload *payload_p, uint16_t payload_length, +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/at/wstp_at/src/at_cmd_task.c:206:80: warning: incompatible pointer types passing 'btsrv_calibration_config_t *' to parameter of type 'uint8_t *' (aka 'unsigned char *') [-Wincompatible-pointer-types] +uapi_nv_read(NV_ID_BTSRV_CALIBRATION_CONFIG, kvalue_max_length, &real_len, kvalue); +^~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/utils/at/wstp_at/src/at_cmd_task.c:45:100: note: passing argument to parameter 'kvalue' here +errcode_t uapi_nv_read(uint16_t key, uint16_t kvalue_max_length, uint16_t *kvalue_length, uint8_t *kvalue); +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/at/wstp_at/src/at_cmd_task.c:219:38: warning: incompatible pointer types passing 'ipc_calibration_config_t *' to parameter of type 'btsrv_calibration_config_t *' [-Wincompatible-pointer-types] +at_cmd_set_calibration_to_bt(ipc_msg, sizeof(ipc_calibration_config_t)); +^~~~~~~ +/home/snicker/hiwatch/code/sdk/middleware/utils/at/wstp_at/src/at_cmd_task.c:192:63: note: passing argument to parameter 'config' here +void at_cmd_set_calibration_to_bt(btsrv_calibration_config_t *config, uint16_t value_len) +^ +3 warnings generated. +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_exif.c.obj +Scanning dependencies of target graphic_utils +[ 61%] Linking C static library libat_cmd.a +[ 61%] Linking C static library libalgorithm.a +[ 61%] Linking CXX static library libgraphic_service.a +[ 61%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/color.cpp.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_mem.c.obj +[ 61%] Built target at_cmd +[ 61%] Built target algorithm +[ 61%] Built target app_version +[ 61%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/geometry2d.cpp.obj +[ 61%] Built target graphic_service +Scanning dependencies of target build_version +Scanning dependencies of target cpu_load +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_parse.c.obj +[ 61%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/graphic_math.cpp.obj +[ 61%] Building C object utils/build_version/CMakeFiles/build_version.dir/private/build_version.c.obj +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_stream.c.obj +[ 61%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/graphic_performance.cpp.obj +[ 61%] Building C object utils/cpu_load/CMakeFiles/cpu_load.dir/private/cpu_load.c.obj +Scanning dependencies of target connectivity +[ 61%] Linking C static library libbuild_version.a +[ 61%] Building C object services/gpu/CMakeFiles/gpu.dir/api/jpeg/src/jpeg_table.c.obj +[ 61%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/graphic_timer.cpp.obj +[ 61%] Linking C static library libcpu_load.a +[ 61%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/connectivity_calibration.c.obj +[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/intf/drv_dpu_intf.c.obj +[ 63%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/hal_tick.cpp.obj +[ 63%] Built target build_version +[ 63%] Built target cpu_load +[ 63%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/shared/connectivity_log.c.obj +[ 63%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/mem_api.cpp.obj +[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/ioctl/dpu_ioctl.c.obj +[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/layer/dpu_layer.c.obj +[ 63%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/identity.c.obj +Scanning dependencies of target dfx_preserve +[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/disp/dpu_disp.c.obj +[ 63%] Building C object utils/connectivity/CMakeFiles/connectivity.dir/common/acore/los_status.c.obj +[ 63%] Building C object utils/dfx/CMakeFiles/dfx_preserve.dir/preserve/private/preserve.c.obj +[ 63%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/style.cpp.obj +[ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/clock/dpu_clock.c.obj [ 63%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/isr/dpu_isr.c.obj -[ 64%] Built target cpu_utils -[ 64%] Linking C static library libgraphic_input.a -[ 64%] Built target reboot +[ 63%] Linking C static library libdfx_preserve.a +[ 64%] Linking C static library libconnectivity.a +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/utils/frameworks/transform.cpp.obj +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/dfx/dpu_dfx.c.obj +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/hals/display_dev.cpp.obj +[ 64%] Built target dfx_preserve +[ 64%] Built target connectivity +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal.c.obj +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp.obj [ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_crg.c.obj +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/hals/lite_input_distributer.cpp.obj [ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_disp.c.obj +Scanning dependencies of target soc_log +[ 64%] Building C object utils/dfx/CMakeFiles/soc_log.dir/soc_log/soc_log.c.obj +Scanning dependencies of target dfx_panic +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/hals/lite_input_hal.cpp.obj [ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/hal/dpu_hal_layer.c.obj -[ 65%] Built target dfx_log -[ 65%] Built target graphic_input -[ 65%] Built target audio_proc -[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/dfx/vau_dfx.c.obj -[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/qspi/dpu_qspi.c.obj -[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/drv_vau_intf.c.obj -[ 65%] Built target diag_dfx_cmd -[ 65%] Built target audio_probe -[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/vau_pre_process.c.obj +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/mem_check.cpp.obj +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/dpu/qspi/dpu_qspi.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/soc_log.dir/soc_log/soc_log_uart_instance.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/dfx_panic.dir/panic/private/panic.c.obj +Scanning dependencies of target log_file +Scanning dependencies of target dfx_diag +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/dfx/vau_dfx.c.obj +[ 64%] Linking C static library libsoc_log.a +[ 64%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file.c.obj +[ 64%] Building CXX object uikit/CMakeFiles/graphic_utils.dir/proprietary/src/utils/frameworks/mem_custom.cpp.obj +[ 64%] Linking C static library libdfx_panic.a +[ 64%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_debug.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file_file.c.obj +[ 64%] Linking CXX static library libgraphic_utils.a +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/drv_vau_intf.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/log_file.dir/log_file/log_file_flash.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_pkt.c.obj +[ 64%] Built target soc_log +[ 64%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_mem.c.obj +[ 64%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/intf/vau_pre_process.c.obj +[ 64%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_msg.c.obj +[ 64%] Linking C static library liblog_file.a +[ 65%] Built target dfx_panic [ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/ioctl/vau_ioctl.c.obj -[ 65%] Built target audio_dump -[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/isr/vau_isr.c.obj -[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/job/vau_job.c.obj -[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_list.c.obj -[ 66%] Built target dfx_nv -[ 66%] Built target gpu_proc -[ 66%] Built target dfx_update -[ 67%] Built target x_fat -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/mem/vau_mem.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_handle.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/node/vau_node.c.obj -[ 67%] Built target lib_utils -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_apb.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_affine.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_node.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_tx.c.obj +[ 65%] Built target graphic_utils +[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/isr/vau_isr.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_rx_api.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_channel.c.obj +[ 65%] Built target log_file +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_pkt_router.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_dfx.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_stat.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_filter.c.obj +Scanning dependencies of target cpu_utils +[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/job/vau_job.c.obj +[ 65%] Building C object utils/dfx/dfx_reboot/cpu_utils/CMakeFiles/cpu_utils.dir/private/cpu_utils.c.obj +[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_list.c.obj +[ 65%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_service.c.obj +[ 65%] Linking C static library libcpu_utils.a +Scanning dependencies of target reboot +[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/list/vau_handle.c.obj +[ 65%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/mem/vau_mem.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_dispatch.c.obj +[ 66%] Building C object utils/dfx/dfx_reboot/reboot/CMakeFiles/reboot.dir/shared/non_os_reboot.c.obj +Scanning dependencies of target dfx_log +[ 66%] Built target cpu_utils +[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/node/vau_node.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_dst.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_cmd_src.c.obj +[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log.c.obj +[ 66%] Linking C static library libreboot.a +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_ind_dst.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_logger.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_mem_query.c.obj +[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_apb.c.obj +[ 66%] Built target reboot +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_pcm.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_ota.c.obj +[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_node.c.obj +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag/diag_cmd_router/diag_ind_src.c.obj +[ 66%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_affine.c.obj +[ 66%] Built target audio_proc +[ 66%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_reg_query.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_capability.c.obj -[ 67%] Built target x_disk +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_cmd_ls.c.obj +Scanning dependencies of target diag_dfx_cmd +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_status.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_cmd_delete_file.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_beat_heart.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/vau/hal/vau_hal_vector_draw.c.obj +[ 67%] Built target audio_dump +[ 67%] Built target audio_probe +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oam_dscr_cb.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/clock/gmmu_clock.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_connect.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oml_exception.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/context/gmmu_context.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_filter.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_item.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_send_recv_pkt.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_oml_ota_rom.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_mem_info.c.obj +Scanning dependencies of target dfx_nv [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/dev/gmmu_dev.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_resume.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_printf.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_task_info.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/dfx/gmmu_dfx.c.obj -[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/intf/drv_gmmu_intf.c.obj [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/hal/gmmu_hal.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_dst.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_res_info.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_printf_rom.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_reg_dump.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_src.c.obj +[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/intf/drv_gmmu_intf.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log/log_trigger.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/diag_nv/CMakeFiles/dfx_nv.dir/zdiag_nv.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_init_info.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_get_cpup.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_nv/zdiag_nv.c:158:36: warning: implicit declaration of function 'kv_store_get_page_count' is invalid in C99 [-Wimplicit-function-declaration] +pages_in_store = (uint32_t)kv_store_get_page_count(0); +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_nv/zdiag_nv.c:162:17: warning: implicit declaration of function 'kv_store_get_page_handle' is invalid in C99 [-Wimplicit-function-declaration] +if (kv_store_get_page_handle(0, page_index, &page) == ERRCODE_SUCC) { +^ +2 warnings generated. +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_write_read.c.obj +[ 67%] Linking C static library libdfx_nv.a +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_reader/private/log_oam_msg.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_system_cmd/diag_cmd_get_cpup.c:100:44: warning: implicit declaration of function 'dfx_os_task_status_convert_str' is invalid in C99 [-Wimplicit-function-declaration] +info->task_info->priority, dfx_os_task_status_convert_str(info->task_info->status), +^ +1 warning generated. [ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/ioctl/gmmu_ioctl.c.obj -[ 68%] Built target nv +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_password.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_api.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_system_cmd/diag_cmd_stat.c.obj +[ 67%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_buffer.c.obj +[ 67%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/isr/gmmu_isr.c.obj +[ 67%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/diag_mocked_shell/diag_mocked_shell.c.obj +[ 67%] Built target dfx_nv +[ 68%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/last_dump/last_dump.c.obj +[ 68%] Building C object utils/dfx/CMakeFiles/dfx_diag.dir/diag_transmit/transmit_debug.c.obj [ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/mem/gmmu_mem.c.obj -[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/isr/gmmu_isr.c.obj -[ 68%] Built target partition +[ 68%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_buffer_reader.c.obj +[ 68%] Building C object utils/dfx/diag_dfx_cmd/CMakeFiles/diag_dfx_cmd.dir/sample_data/sample_data.c.obj +[ 68%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_memory_region.c.obj [ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/gmmu/base/gmmu_comm.c.obj -[ 68%] Built target update_common +[ 68%] Linking C static library libdfx_diag.a +Scanning dependencies of target gpu_proc +Scanning dependencies of target dfx_update +[ 68%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_buffer/log_memory_section.c.obj +[ 68%] Linking C static library libdiag_dfx_cmd.a [ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/clock/jpeg_clock.c.obj -[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/dev/jpeg_dev.c.obj +[ 68%] Building C object utils/dfx/CMakeFiles/dfx_log.dir/log_reader/private/log_uart.c.obj +[ 68%] Building C object utils/dfx/diag_dfx_cmd/diag_gpu_proc/CMakeFiles/gpu_proc.dir/diag_gpu_proc.c.obj +[ 68%] Building C object utils/dfx/diag_dfx_cmd/diag_update/CMakeFiles/dfx_update.dir/diag_update.c.obj [ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/context/jpeg_context.c.obj -[ 68%] Built target update_storage -[ 70%] Built target x_vfs -[ 70%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/dfx/jpeg_dfx.c.obj -[ 71%] Built target update_local +[ 68%] Built target dfx_diag +[ 68%] Linking C static library libdfx_log.a +[ 68%] Linking C static library libgpu_proc.a +/home/snicker/hiwatch/code/sdk/middleware/utils/dfx/diag_dfx_cmd/diag_update/diag_update.c:71:13: warning: implicit declaration of function 'upg_reboot' is invalid in C99 [-Wimplicit-function-declaration] +upg_reboot(); +^ +1 warning generated. +[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/dev/jpeg_dev.c.obj +[ 68%] Built target diag_dfx_cmd +[ 68%] Linking C static library libdfx_update.a +[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/dfx/jpeg_dfx.c.obj +Scanning dependencies of target dfx_file_operation +[ 68%] Built target dfx_log +[ 68%] Built target gpu_proc +[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/hal/jpeg_hal.c.obj +[ 68%] Building C object utils/dfx/file_operation/CMakeFiles/dfx_file_operation.dir/dfx_file_operation.c.obj +[ 68%] Built target dfx_update +[ 68%] Built target x_fat +[ 68%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/intf/drv_jpeg_intf.c.obj +[ 68%] Built target lib_utils +[ 68%] Built target x_disk +[ 69%] Linking C static library libdfx_file_operation.a +[ 69%] Built target partition +[ 69%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/ioctl/jpeg_ioctl.c.obj +Scanning dependencies of target update_common +[ 69%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/isr/jpeg_isr.c.obj +[ 69%] Built target dfx_file_operation +Scanning dependencies of target update_storage +[ 69%] Linking C static library ../../../../../../interim_binary/brandy/libs/gpu/evb_standard/libgpu.a +[ 69%] Building C object utils/update/storage/CMakeFiles/update_storage.dir/upg_storage.c.obj +[ 69%] Building C object utils/update/common/CMakeFiles/update_common.dir/upg_common.c.obj +[ 72%] Built target x_vfs +[ 72%] Linking C static library libupdate_storage.a +Scanning dependencies of target update_local +[ 72%] Building C object utils/update/common/CMakeFiles/update_common.dir/upg_verify.c.obj +[ 72%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_patch.c.obj [ 72%] Built target lzma_21.07 -[ 72%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/hal/jpeg_hal.c.obj -[ 72%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/intf/drv_jpeg_intf.c.obj -[ 73%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/ioctl/jpeg_ioctl.c.obj -[ 73%] Built target cjson_static -[ 75%] Built target freetype_static -[ 75%] Building C object services/gpu/CMakeFiles/gpu.dir/drv/jpeg/isr/jpeg_isr.c.obj -[ 76%] Built target icu4c -[ 77%] Built target qrcodegen -[ 78%] Built target lwIP -[ 78%] Built target syspara -[ 78%] Linking C static library ../../../../../../interim_binary/brandy/libs/gpu/evb_standard/libgpu.a -[ 78%] Built target bootstrap -[ 79%] Built target samgr -[ 81%] Built target harfbuzz -[ 81%] Built target permission -[ 82%] Built target appverify -[ 82%] Built target gpu -[ 82%] Generating NV_SRC -[ 83%] Built target alipay_soc -[ 83%] Built target resmgr -[ 83%] Built target i18n -[ 83%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_bas.c.obj -[ 83%] copy file..... -[ 83%] Install hal_release ... -[ 83%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_hid.c.obj -[ 83%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_dis_profile.c.obj -[ 83%] Built target nv_config_brandy -[ 85%] Built target ace_adapt -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/dis_profile_server.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_fmp.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_bas_client.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/dis_profile_client.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_bas_server.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_hid_take_photo_server.c.obj -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/dis_profile_client.c:52:14: warning: incompatible integer to pointer conversion initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'int' [-Wint-conversion] -uint8_t *tgt = bts_init_128bit_uuid(tgt_uuid); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/dis_profile_client.c:57:14: warning: incompatible integer to pointer conversion initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'int' [-Wint-conversion] -uint8_t *src = bts_init_128bit_uuid(src_uuid); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -2 warnings generated. -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_bas_client.c:43:14: warning: incompatible integer to pointer conversion initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'int' [-Wint-conversion] -uint8_t *tgt = bts_init_128bit_uuid(tgt_uuid); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_bas_client.c:48:14: warning: incompatible integer to pointer conversion initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'int' [-Wint-conversion] -uint8_t *src = bts_init_128bit_uuid(src_uuid); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Scanning dependencies of target nv +[ 72%] Built target update_storage +[ 72%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_app/soc_nv_storage_handle.c.obj +[ 72%] Linking C static library libupdate_common.a +[ 72%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_process.c.obj +[ 72%] Built target gpu +[ 72%] Built target freetype_static +[ 72%] Built target cjson_static +[ 72%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_app/soc_nv_storage.c.obj +[ 72%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_resource.c.obj +[ 72%] Built target update_common +[ 72%] Built target qrcodegen +[ 72%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_key.c.obj +[ 72%] Building C object utils/update/local_update/CMakeFiles/update_local.dir/upg_upgrade.c.obj +[ 73%] Built target icu4c +[ 73%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_notify.c.obj +[ 73%] Linking C static library libupdate_local.a +[ 75%] Built target syspara +Scanning dependencies of target bootstrap +[ 75%] Building C object ohos/bootstrap/CMakeFiles/bootstrap.dir/source/bootstrap_service.c.obj +[ 75%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_nvregion.c.obj +[ 75%] Built target update_local +[ 75%] Building C object ohos/bootstrap/CMakeFiles/bootstrap.dir/source/system_init.c.obj +[ 75%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_page.c.obj +Scanning dependencies of target bms_sign_mode +[ 75%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_reset.c.obj +Scanning dependencies of target brightness +[ 75%] Building CXX object ohos/appexecfwk/CMakeFiles/bms_sign_mode.dir/bundlems/sign_mode.cpp.obj +[ 75%] Linking C static library libbootstrap.a +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_rpc.c.obj +[ 76%] Building CXX object ohos/ace_engine/CMakeFiles/brightness.dir/modules/display/display.cpp.obj +Scanning dependencies of target samgr +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_store.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/communication/broadcast/source/broadcast_service.c.obj +[ 76%] Linking CXX static library libbrightness.a +[ 76%] Linking CXX static library libbms_sign_mode.a +[ 76%] Built target bootstrap +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/communication/broadcast/source/pub_sub_feature.c.obj +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_update.c.obj +[ 76%] Built target brightness +[ 76%] Built target bms_sign_mode +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_upg.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/communication/broadcast/source/pub_sub_implement.c.obj +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_debug.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/nv/nv_storage_lib/nv_upg.c:80:21: warning: implicit declaration of function 'uapi_drv_cipher_sha256_start' is invalid in C99 [-Wimplicit-function-declaration] +errcode_t ret = uapi_drv_cipher_sha256_start(&handle); +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/nv/nv_storage_lib/nv_upg.c:96:15: warning: implicit declaration of function 'uapi_drv_cipher_sha256_update' is invalid in C99 [-Wimplicit-function-declaration] +ret = uapi_drv_cipher_sha256_update(handle, image_data, read_len); +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/nv/nv_storage_lib/nv_upg.c:105:11: warning: implicit declaration of function 'uapi_drv_cipher_sha256_finish' is invalid in C99 [-Wimplicit-function-declaration] +ret = uapi_drv_cipher_sha256_finish(handle, data_sha, &out_length); +^ +3 warnings generated. +[ 76%] Building C object utils/nv/CMakeFiles/nv.dir/nv_storage_lib/nv_async_store.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/adapter/cmsis/queue_adapter.c.obj +/home/snicker/hiwatch/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.c:58:82: warning: unused parameter 'kvalue_length' [-Wunused-parameter] +static bool nv_async_check_writeable(uint16_t key, nv_key_attr_t *attr, uint16_t kvalue_length) +^ +/home/snicker/hiwatch/code/sdk/middleware/utils/nv/nv_storage_lib/nv_async_store.c:363:43: warning: incompatible function pointer types passing 'errcode_t (void)' (aka 'unsigned int (void)') to parameter of type 'osal_kthread_handler' (aka 'int (*)(void *)') [-Wincompatible-function-pointer-types] +osal_task *task = osal_kthread_create(nv_async_msg_process_thread, NULL, "nv_write_task", 0x1000); +^~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/kernel/osal/include/schedule/osal_task.h:76:53: note: passing argument to parameter 'handler' here +osal_task *osal_kthread_create(osal_kthread_handler handler, void *data, const char *name, unsigned int stack_size); +^ 2 warnings generated. -[ 85%] Built target brandy_CFBB -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_fmp_target.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_fmp_locator.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_gatts_callbacks.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_avrcp_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_a2dp_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_hfp_hf_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_pbap_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_hfp_ag_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_pan_service.c.obj -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_spp_service.c.obj -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_ag_service.c:918:23: warning: incompatible integer to pointer conversion initializing 'hfp_phone_info_t *' with an expression of type 'int' [-Wint-conversion] -hfp_phone_info_t *info = bt_os_new(sizeof(hfp_phone_info_t) + name_len); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_ag_service.c:963:22: warning: incompatible integer to pointer conversion initializing 'hfp_clcc_info_t *' with an expression of type 'int' [-Wint-conversion] -hfp_clcc_info_t *info = bt_os_new(sizeof(hfp_clcc_info_t) + number_len); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_ag_service.c:1019:23: warning: incompatible integer to pointer conversion initializing 'hfp_phone_info_t *' with an expression of type 'int' [-Wint-conversion] -hfp_phone_info_t *info = bt_os_new(sizeof(hfp_phone_info_t) + name_len); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_hfp_ag_service.c:1099:22: warning: incompatible integer to pointer conversion initializing 'hfp_cops_info_t *' with an expression of type 'int' [-Wint-conversion] -hfp_cops_info_t *info = bt_os_new(sizeof(hfp_cops_info_t) + operator_len); -^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/adapter/cmsis/thread_adapter.c.obj +Scanning dependencies of target baidumapcomponent +[ 76%] Linking C static library libnv.a +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/dependency/dependency.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/registry/service_registry.c.obj +[ 76%] Building CXX object ohos/ace_engine/CMakeFiles/baidumapcomponent.dir/modules/baidumapcomponent/baidumap.cpp.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/common.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/feature.c.obj +[ 76%] Built target nv +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/iunknown.c.obj +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:27:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] +typedef struct : public OHOS::HeapBase { +^ +BaiduMapAsyncMsgParams +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:27:18: note: type is not C-compatible due to this base class +typedef struct : public OHOS::HeapBase { +^~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:31:3: note: type is given name 'BaiduMapAsyncMsgParams' for linkage purposes by this typedef declaration +} BaiduMapAsyncMsgParams; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:33:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] +typedef struct : public OHOS::HeapBase { +^ +BaiduMapJSCoordinate +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:33:18: note: type is not C-compatible due to this base class +typedef struct : public OHOS::HeapBase { +^~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:36:3: note: type is given name 'BaiduMapJSCoordinate' for linkage purposes by this typedef declaration +} BaiduMapJSCoordinate; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:923:29: warning: missing field 'lat' initializer [-Wmissing-field-initializers] +JSCoordinate params = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:941:29: warning: missing field 'lat' initializer [-Wmissing-field-initializers] +JSCoordinate params = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:959:29: warning: missing field 'lat' initializer [-Wmissing-field-initializers] +JSCoordinate params = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp:977:29: warning: missing field 'lat' initializer [-Wmissing-field-initializers] +JSCoordinate params = {0}; +^ +6 warnings generated. +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/message_alloc.c.obj +[ 76%] Built target permission +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/message.c.obj +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/samgr_lite.c.obj +[ 76%] Linking CXX static library libbaidumapcomponent.a +Scanning dependencies of target graphic_ui +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/samgr_lite_vtbl.c.obj +[ 76%] Built target baidumapcomponent +[ 76%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/service.c.obj +[ 77%] Built target i18n +[ 77%] Building C object ohos/samgr/CMakeFiles/samgr.dir/services/samgr/source/task_manager.c.obj +[ 77%] Linking C static library libsamgr.a +Scanning dependencies of target appverify +[ 77%] Built target resmgr +[ 77%] Building C object ohos/appverify/CMakeFiles/appverify.dir/app_provision.c.obj +[ 77%] Built target samgr +[ 77%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/animator/animator.cpp.obj +[ 78%] Built target utils_kv_store +[ 79%] Building C object ohos/appverify/CMakeFiles/appverify.dir/app_verify.c.obj +[ 79%] Built target native_file +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/animator/animator_manager.cpp.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/animator/easing_equation.cpp.obj +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/app_verify.c:1047:32: warning: comparison of integers of different signs: 'const size_t' (aka 'const unsigned int') and 'const int' [-Wsign-compare] +if (certA->subject_raw.len != binSignCert->subjectLen || +~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/app_verify.c:1053:31: warning: comparison of integers of different signs: 'const size_t' (aka 'const unsigned int') and 'const int' [-Wsign-compare] +if (certA->issuer_raw.len != binSignCert->issuerLen || +~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/app_verify.c:1542:28: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] +if (unsignedFileLength == V_ERR) { +~~~~~~~~~~~~~~~~~~ ^ ~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/app_verify.c:1421:12: warning: unused function 'InitMessageEnv' [-Wunused-function] +static int InitMessageEnv(const char *filePath, MessageFunc func) +^ 4 warnings generated. -[ 85%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_audio/sample_bt_audio_hal.c.obj -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_core/sample_bts_gap.c.obj -[ 86%] Built target hal_release -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/sample_common.c.obj -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/bt_srv_shell_internal.c.obj -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_core/sample_bts_gatt.c.obj -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_srv_shell.c.obj -[ 86%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/sample_common_internal.c.obj -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gatt.c:235:15: warning: unused parameter 'status' [-Wunused-parameter] -errcode_t status) +[ 79%] Built target quickjs +[ 79%] Building C object ohos/appverify/CMakeFiles/appverify.dir/mbedtls_pkcs7.c.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/animator/interpolation.cpp.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/graphic_startup.cpp.obj +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/mbedtls_pkcs7.c:439:17: warning: implicit declaration of function 'PSRAM_Malloc' is invalid in C99 [-Wimplicit-function-declaration] +void *ptr = PSRAM_Malloc(nmemb * size); +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/mbedtls_pkcs7.c:439:11: warning: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion] +void *ptr = PSRAM_Malloc(nmemb * size); +^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/mbedtls_pkcs7.c:453:5: warning: implicit declaration of function 'PSRAM_Free' is invalid in C99 [-Wimplicit-function-declaration] +PSRAM_Free(ptr); ^ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gatt.c:1613:61: warning: unused parameter 'params_cnt' [-Wunused-parameter] -static void sample_gattc_speed(const char **params, int32_t params_cnt) +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/mbedtls_pkcs7.c:677:42: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare] +if (oneCertLen + (*p - seqBegin) > (certsEnd - seqBegin)) { +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/base/security/appverify/mbedtls_pkcs7.c:1255:34: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] +while (signer != NULL && idx < signersCnt) { +~~~ ^ ~~~~~~~~~~ +5 warnings generated. +Scanning dependencies of target storage_jsapi +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/image.cpp.obj +[ 79%] Linking C static library libappverify.a +[ 79%] Building CXX object ohos/storage_jsi/CMakeFiles/storage_jsapi.dir/kvstorekit/src/nativeapi_kv_impl.cpp.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/image_decode_ability.cpp.obj +[ 79%] Building CXX object ohos/storage_jsi/CMakeFiles/storage_jsapi.dir/kvstorekit/src/nativeapi_kv.cpp.obj +[ 79%] Built target appverify +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/input_device_manager.cpp.obj +[ 79%] Building CXX object ohos/storage_jsi/CMakeFiles/storage_jsapi.dir/filekit/src/nativeapi_fs_impl.cpp.obj +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:76:28: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat info = { 0 }; ^ -/home/snicker/hiwatch/code/sdk/protocol/bt/host/bt/bts/bt_sample/bt_core/sample_bts_gatt.c:1649:61: warning: unused parameter 'params_cnt' [-Wunused-parameter] -static void sample_gatts_speed(const char **params, int32_t params_cnt) +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:285:22: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] +return (writeLen != len) ? ERROR_CODE_IO : NATIVE_SUCCESS; +~~~~~~~~ ^ ~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:316:51: warning: comparison of integers of different signs: 'off_t' (aka 'long') and 'unsigned int' [-Wsign-compare] +if (lseek(fileHandle, position, SEEK_SET) != position) { +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:323:22: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] +return (writeLen != len) ? ERROR_CODE_IO : NATIVE_SUCCESS; +~~~~~~~~ ^ ~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:345:28: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat info = { 0 }; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:357:47: warning: comparison of integers of different signs: 'off_t' (aka 'long') and 'unsigned int' [-Wsign-compare] +if (lseek(fileHandle, position, SEEK_SET) != position) { +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:379:32: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat fileStat = { 0 }; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp:384:40: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] +while ((dir != NULL) && (fileIndex < listNum)) { +~~~~~~~~~ ^ ~~~~~~~ +8 warnings generated. +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/screen.cpp.obj +[ 79%] Building CXX object ohos/storage_jsi/CMakeFiles/storage_jsapi.dir/filekit/src/nativeapi_fs.cpp.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/task.cpp.obj +Scanning dependencies of target alipay_soc +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp:247:26: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat info = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp:319:26: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat info = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp:400:26: warning: missing field 'st_ino' initializer [-Wmissing-field-initializers] +struct stat info = {0}; ^ 3 warnings generated. -[ 86%] Linking C static library ../../../../../../../../../../interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a -[ 86%] Built target bt_host_brandy_sample -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp:15: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmClockModel.h:18: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h:22: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h:19: -In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h:27: -/home/snicker/hiwatch/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h:34:30: warning: missing field 'transition' initializer [-Wmissing-field-initializers] -TransitionInfo info_ = {0}; -^ -1 warning generated. -[ 86%] Linking CXX static library libnativelauncher.a +[ 79%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/se/hsec/vendor_crypto.c.obj +[ 79%] Building CXX object ohos/storage_jsi/CMakeFiles/storage_jsapi.dir/common/src/nativeapi_common.cpp.obj +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/text.cpp.obj +[ 79%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/se/hsec/vendor_rot.c.obj +[ 79%] Built target alipay_hal +[ 79%] Linking CXX static library libstorage_jsapi.a +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/common/typed_text.cpp.obj +[ 79%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/se/hsec/vendor_ssp.c.obj +[ 79%] Generating NV_SRC +[ 79%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/root_view.cpp.obj +[ 80%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/test/yunit.c.obj +[ 80%] Built target storage_jsapi +[ 80%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/test/test_crypto_hal.c.obj +[ 80%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/test/test_ssp_hal.c.obj +[ 80%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/text_adapter.cpp.obj +[ 80%] Building C object vendor/alipay_sdk/alipay_sec_sdk_v3.0.0/soc/CMakeFiles/alipay_soc.dir/test/yunit_test_main.c.obj +Scanning dependencies of target bt_host_brandy_sample +[ 80%] Install hal_release ... +[ 80%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_abstract_clock.cpp.obj +[ 80%] Linking C static library libalipay_soc.a +[ 80%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_dis_profile.c.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_abstract_progress.cpp.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_abstract_scroll.cpp.obj +[ 81%] Built target alipay_soc +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_bas.c.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_analog_clock.cpp.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_abstract_scroll_bar.cpp.obj +[ 81%] Built target nv_config_brandy +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_arc_label.cpp.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_hid.c.obj +[ 81%] Built target hal_release +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_arc_scroll_bar.cpp.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_axis.cpp.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/ble_at_sample/src/sample_ble_fmp.c.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_box_progress.cpp.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/dis_profile_server.c.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/dis_profile_client.c.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_box_scroll_bar.cpp.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_hid_take_photo_server.c.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_bas_client.c.obj +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_bas_server.c.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_canvas.cpp.obj +[ 81%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_button.cpp.obj +Scanning dependencies of target harfbuzz +[ 81%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_fmp_target.c.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_gatts_callbacks.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_chart.cpp.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_checkbox.cpp.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/ble_profile/profiles/src/ble_fmp_locator.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_circle_progress.cpp.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_dialog.cpp.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_a2dp_service.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_digital_clock.cpp.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_a2dp_snk_service.c.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-aat-layout.cc.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_edit_text.cpp.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-aat-map.cc.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_image_animator.cpp.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_hfp_hf_service.c.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_avrcp_service.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_image_view.cpp.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_hfp_ag_service.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_label.cpp.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-blob.cc.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_pbap_service.c.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-buffer-serialize.cc.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_list.cpp.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_label_button.cpp.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-buffer.cc.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_spp_service.c.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-common.cc.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-face.cc.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-fallback-shape.cc.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_picker.cpp.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-font.cc.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-map.cc.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/br_profile/sample_pan_service.c.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_audio/sample_bt_audio_hal.c.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_core/sample_bts_gap.c.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_qrcode.cpp.obj +[ 82%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_radio_button.cpp.obj +[ 82%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-cff1-table.cc.obj +[ 82%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_core/sample_bts_gatt.c.obj +[ 83%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-cff2-table.cc.obj +[ 83%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/sample_common_internal.c.obj +[ 83%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/bt_srv_shell_internal.c.obj +[ 83%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-face.cc.obj +[ 83%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_scroll_view.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_slider.cpp.obj +[ 84%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/sample_common/sample_common.c.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-font.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_swipe_view.cpp.obj +[ 84%] Building C object protocol/bt/host/bt/bts/bt_sample/CMakeFiles/bt_host_brandy_sample.dir/bt_srv_shell.c.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_texture_mapper.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_time_picker.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-layout.cc.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-map.cc.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-math.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_toggle_button.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_view.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-metrics.cc.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-meta.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/components/ui_view_group.cpp.obj +Scanning dependencies of target ace_adapt +[ 84%] Linking C static library ../../../../../../../../../../interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-name.cc.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-arabic.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/core/render_manager.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-default.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/core/task_manager.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-hangul.cc.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-hebrew.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/default_resource/check_box_res.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dfx/event_injector.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-indic-table.cc.obj +Scanning dependencies of target nativelauncher +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dfx/key_event_injector.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/analog_clock_component.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/canvas_component.cpp.obj +[ 84%] Built target bt_host_brandy_sample +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dfx/point_event_injector.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-indic.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dfx/ui_view_bounds.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/focus_manager.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dfx/ui_dump_dom_tree.cpp.obj +[ 84%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-khmer.cc.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/input_device.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.cpp:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/key_input_device.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/chart_component.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/circle_progress_component.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/clock_hand_component.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/pointer_input_device.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/circle_progress_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/circle_progress_component.h:20: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/chart_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/chart_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/chart_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/chart_component.h:21: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_chart.h:757:31: warning: missing field 'stopCount' initializer [-Wmissing-field-initializers] +VGUGradient gradient_ = {0}; +^ +2 warnings generated. +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/component_utils.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/rotate_input_device.cpp.obj +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/div_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_utils.cpp:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/div_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/div_component.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/event_listener.cpp.obj +[ 84%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/vibrator_manager.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 84%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/image_animator_component.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/horizon_progress_component.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/image_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/horizon_progress_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/horizon_progress_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 85%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/dock/virtual_input_device.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_animator_component.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_animator_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_animator_component.cpp:234:39: warning: missing field 'pos' initializer [-Wmissing-field-initializers] +ImageAnimatorInfo frame = {{0}}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_animator_component.cpp:239:25: warning: missing field 'y' initializer [-Wmissing-field-initializers] +Point point = {0}; +^ +3 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/image_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/input_button_component.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/input_checkbox_component.cpp.obj +[ 85%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/clip_utils.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/input_radio_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_checkbox_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_checkbox_component.h:17: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 85%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_arc.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_button_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_button_component.h:17: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_radio_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/input_radio_component.h:17: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/list_adapter.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/marquee_component.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/list_component.cpp.obj +[ 85%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/picker_view_component.cpp.obj +[ 85%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_curve.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/list_adapter.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/list_adapter.h:20: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/marquee_component.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/marquee_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/text_component.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/list_component.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/list_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_image.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/picker_view_component.h:20: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_label.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/qrcode_component.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/scroll_layer.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_line.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_rect.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/qrcode_component.cpp:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/qrcode_component.h:20: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_triangle.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/scroll_layer.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/scroll_layer.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/slider_component.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/stack_component.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/draw/draw_utils.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/swiper_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/slider_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/slider_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/switch_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/stack_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/stack_component.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/tab_bar_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/swiper_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/swiper_component.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/switch_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/switch_component.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/tab_content_component.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/events/event.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/tabs_component.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/engines/gfx/gfx_engine_manager.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/base_font.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/text_component.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/glyphs_manager.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/components/baidu_map_component.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/text_component.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/text_component.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/app_module.cpp.obj +[ 86%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativelauncher/src/NativeLauncher.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.cpp:17: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.h:23: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/dfx_module.cpp.obj +[ 86%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font.cpp.obj +[ 86%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativelauncher/src/slices/main/MainPresenter.cpp.obj +[ 86%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/module_manager.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/app_data_module.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/dfx_module.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/dfx_module.h:20: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp:22: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp:22: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp:47: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistPresenter.h:13: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +3 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.cpp:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h:21: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/router/js_router.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/router/js_page_state_machine.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/cjson_parser.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/console_log_impl.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font_adaptor.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativelauncher/src/slices/main/MainView.cpp.obj +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-myanmar.cc.obj +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-thai.cc.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/MainViewSample.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/console_module.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font_bitmap.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/MainModel.cpp.obj +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-use-table.cc.obj +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-use.cc.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/MainPresenterSample.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/date_time_format_module.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/ModelListenerSample.cpp.obj +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-complex-vowel-constraints.cc.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font_builder.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font_cache.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/PresenterTask.cpp.obj +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/date_time_format_module.cpp:154:26: warning: missing field 'tm_min' initializer [-Wmissing-field-initializers] +struct tm gmTime = {0}; +^ +/home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/date_time_format_module.cpp:155:25: warning: missing field 'tm_min' initializer [-Wmissing-field-initializers] +struct tm local = {0}; +^ +2 warnings generated. +[ 88%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-fallback.cc.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/HealthModel.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_font_vector.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/feature_ability_module.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/PullUpDownView.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/applist/src/AppItemView.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_line_break.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/jstest_module.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/localization_module.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_multi_font_manager.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/intl_module.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/applist/src/ApplistAdapter.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/number_format_module.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/preset_module.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/font/ui_text_shaping.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/imgdecode/cache_manager.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/applist/src/ApplistModel.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/profiler_module.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/imgdecode/file_img_decoder.cpp.obj +[ 88%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/render_module.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/imgdecode/image_load.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/layout/flex_layout.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/layout/grid_layout.cpp.obj +[ 88%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/layout/list_layout.cpp.obj +[ 88%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/applist/src/ApplistPresenter.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/render_module.cpp:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h:28: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/canvas_component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/render_module.cpp:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h:30: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/chart_component.h:21: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_chart.h:757:31: warning: missing field 'stopCount' initializer [-Wmissing-field-initializers] +VGUGradient gradient_ = {0}; +^ +2 warnings generated. +[ 89%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape-normalize.cc.obj +[ 89%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/themes/theme.cpp.obj +[ 89%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/require_module.cpp.obj +[ 89%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/applist/src/ApplistView.cpp.obj +[ 89%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/ui/frameworks/themes/theme_manager.cpp.obj +[ 89%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/clock/src/MainClockView.cpp.obj +[ 89%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/ModelDialDataFactory.cpp.obj +[ 89%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/timer_module.cpp.obj +[ 89%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/common/lite_surface.cpp.obj +[ 89%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/presets/version_module.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp:9: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp:9: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 89%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialModelTime.cpp.obj +[ 89%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/router_module.cpp.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialModelSteps.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/common/low_power_manager.cpp.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialModelHeartRate.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/router_module.cpp:17: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h:21: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/router/js_router.h:18: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/router/js_page_state_machine.h:19: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component.h:22: +In file included from /home/snicker/hiwatch/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/event_listener.h:28: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_slider.h:39: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_box_progress.h:38: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_abstract_progress.h:328:44: warning: missing field 'startY' initializer [-Wmissing-field-initializers] +LinearGradient foregroundGradient_ = {0}; +^ +1 warning generated. +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialModelPower.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/common/ui_barcode.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/icon_adapter.cpp.obj +[ 90%] Building CXX object ohos/ace_engine/CMakeFiles/ace_adapt.dir/modules/sample_module.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/image_adapter.cpp.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bloodoxygen/src/BloodOxygenView.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_abstract_soft_keyboard.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bloodoxygen/src/BloodBandoffView.cpp.obj +[ 90%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-shape.cc.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_keyboard_button.cpp.obj +[ 90%] Linking CXX static library libace_adapt.a +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_input_method.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_list_ext.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_menu_item.cpp.obj +[ 90%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-tag.cc.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp.obj +[ 90%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bloodoxygen/src/BloodOxygenModel.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_option_box.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_sweep_clock.cpp.obj +[ 90%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_soft_keyboard.cpp.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-set.cc.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ot-var.cc.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-shape-plan.cc.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/core/input_method_manager.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/components/ui_text_preview_box.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dfx/dfx_cmd.cpp.obj +[ 91%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-shape.cc.obj +[ 91%] Built target ace_adapt +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-shaper.cc.obj +[ 91%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothDeviceListView.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dfx/fps_task.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dfx/dfx_record.cpp.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-static.cc.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-subset-cff-common.cc.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dock/lite_key_device.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dfx/rotate_event_injector.cpp.obj +[ 91%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-subset-cff2.cc.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/dock/lite_touch_device.cpp.obj +[ 91%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/draw/clip_img.cpp.obj +[ 91%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothPresenter.cpp.obj +[ 92%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp.obj +[ 92%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-ucd.cc.obj +[ 92%] Building CXX object harfbuzz/CMakeFiles/harfbuzz.dir/src/hb-unicode.cc.obj +[ 92%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/imgdecode/hw_jpeg_decoder.cpp.obj +[ 92%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.cpp.obj +[ 92%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.cpp.obj +[ 92%] Building CXX object uikit/CMakeFiles/graphic_ui.dir/proprietary/src/ui/frameworks/swipe_effect/card_flip_effect.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/MainBluetoothView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothModel.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp.obj +[ 92%] Linking CXX static library libharfbuzz.a +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/TipsFailMessageView.cpp.obj +[ 92%] Linking CXX static library libgraphic_ui.a +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/TipsConnFailMessageView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/TipsSuccMessageView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothEarListView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothOptionsView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothItemView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothReconnectView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkView.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkModel.cpp.obj +[ 92%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/MotionPageFirst.cpp.obj +[ 93%] Built target harfbuzz +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/MotionPageSecond.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/MotionPageThird.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/MotionPageFourth.cpp.obj +[ 93%] Built target graphic_ui +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/CustomizationView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/IndoorWalkEndView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/indoorwalk/src/MotionPageFifth.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/connectnewphone/src/ConnectPhoneView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/connectnewphone/src/ConnectSelectView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/connectnewphone/src/ConnectOpenView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rebootdevice/src/RebootView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rebootdevice/src/RebootDeviceView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rebootdevice/src/RebootPresenter.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rebootdevice/src/ShutdownDeviceView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rebootdevice/src/RebootModel.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/callerlog/src/CallerLogPresenter.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/callerlog/src/CallerLogView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/callerlog/src/CallerLogModel.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/WaitingHintsView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/CallingView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/callerlog/src/CallerItemView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/MainCallingPresenter.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/CallerDisplayView.cpp.obj +[ 93%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/DialingScreenView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/makephone/src/MainCallingView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/VolumeSettingView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/VolumeSettingPresenter.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/player/src/BluetoothView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/player/src/PlayersView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/player/src/PlayersPresenter.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/player/src/PlayersModel.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/player/src/PlayersCaseListAdapter.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp:18: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; +^ +5 warnings generated. +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/activity/src/ActivityPresenter.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/activity/src/ActivityWeekView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/activity/src/MainActivityView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/activity/src/ActivityModel.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/heartrate/src/HeartRateView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/heartrate/src/HeartModel.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmClockModel.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmConfigView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp:6: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp:6: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmSetTimeView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmSetWeekView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmPresenter.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmJudgeView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/MainAlarmView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmPopUpView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmRingView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmCloseRingView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempJoinStudy.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempMainView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmNewTimeView.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmPopUpPresenter.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempModel.cpp.obj +[ 94%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempPresenter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarm/src/AlarmMaxClock.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempMeasure.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempExitInter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempPromptWear.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempRemindWear.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempClickMea.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempInitInter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempMeaProcess.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempWarn.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempLittleTip.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempExitPrompt.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempStudyAbout.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempContinueWarn.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/temperature/src/TempReport.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/settings/src/SettingPresenter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/settings/src/SettingAdapter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/settings/src/SettingView.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/settings/src/SettingItemView.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/settings/src/SettingModel.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_desktop/src/SetDesktopModel.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_desktop/src/SetDesktopPresenter.cpp.obj +[ 95%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardAdapter.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_desktop/src/SetDesktopView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardItem.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardModel.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardNoCardView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardPresenter.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_card/src/SetCardDeleteView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/add_card/src/AddCardAdapter.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/add_card/src/AddCardItem.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/add_card/src/AddCardModel.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/add_card/src/AddCardView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/add_card/src/AddCardPresenter.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_dial/src/SetDialModel.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_dial/src/SetDialPresenter.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/key/src/KeyInputListener.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassCalibrationView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/set_dial/src/SetDialView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassControlView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialModel.cpp:13: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h:20: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassModel.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/MainCompassView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassPresenter.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h:24: +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:11:38: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:12:37: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:13:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:14:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +^ +/home/snicker/hiwatch/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h:15:36: warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; +^ +7 warnings generated. +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/CompassView.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/phoneservice/src/PhoneService.cpp.obj +[ 96%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/phoneservice/src/PhoneAudio.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/offlinevoice/src/VocassistModel.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/compass/src/MainCompassPresenter.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/offlinevoice/src/VocassistPresenter.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/offlinevoice/src/VocassistView.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/offlinevoice/src/MainVocassistView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistPresenter.h:13: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +1 warning generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/screensetting/src/ScreenModels.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp:9: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +3 warnings generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alarmclockmanage/src/AlarmClockManage.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/src/UISampleView.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/rtcservice/src/RtcService.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp:13: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistModel.h:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +1 warning generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uiservice/src/ui_service.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/src/UISamplePresenter.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/MainVocassistView.cpp:8: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistModel.h:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/dfx/event_injector.h:195:23: warning: field 'rotateEventInjector_' will be initialized after field 'keyEventInjector_' [-Wreorder-ctor] +rotateEventInjector_(nullptr), +^ +1 warning generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/src/UISampleModel.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/uisample/uitest/framework/src/ui_test_group.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/tiger_view.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/screennotify/src/ui_screennotify.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/ui_test_tiger.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_running_ball/ui_test_running_ball.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp:21: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.h:29:23: warning: field 'data_' will be initialized after field 'animator_' [-Wreorder-ctor] +UITestListFPS() : data_(nullptr), animator_(nullptr), list_(nullptr), adapter_(nullptr) {} +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp:24: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_countdown/ui_test_countdown.h:22: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp:30: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h:39:10: warning: 'OnScroll' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] +bool OnScroll(); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h:72:22: note: overridden virtual function is here +virtual bool OnScroll() = 0; +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp:30: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h:41:10: warning: 'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] +bool OnClick(UIView& view, const ClickEvent& event); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:22: note: overridden virtual function is here +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +4 warnings generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_breath/ui_test_breath.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/tiger_view.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/tiger_view.h:20: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_card_switch/ui_test_card_switch.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_countdown/ui_test_countdown.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/ui_test_tiger.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/ui_test_tiger.h:20: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_tiger/tiger_view.h:20: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:15: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/zoom_effect.h:10: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h:114:10: warning: 'OHOS::UICrossView::Remove' hides overloaded virtual function [-Woverloaded-virtual] +void Remove(UIView* view, uint8_t direction); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view_group.h:107:18: note: hidden overloaded virtual function 'OHOS::UIViewGroup::Remove' declared here: different number of parameters (1 vs 2) +virtual void Remove(UIView* view); +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp:12: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h:24: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +2 warnings generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/image_text_adapter.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_message/ui_test_message.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_running_ball/ui_test_running_ball.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_running_ball/ui_test_running_ball.h:21: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_countdown/ui_test_countdown.cpp:16: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_countdown/ui_test_countdown.h:22: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_countdown/ui_test_countdown.cpp:168:23: warning: comparison of integers of different signs: 'int16_t' (aka 'short') and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] +if (endAngle_ <= surplusDegree) { +~~~~~~~~~ ^ ~~~~~~~~~~~~~ +2 warnings generated. +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_cube_rotate/cube_rotate_view.cpp.obj +[ 97%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_cube_rotate/ui_test_cube_rotate.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.h:29:23: warning: field 'data_' will be initialized after field 'animator_' [-Wreorder-ctor] +UITestListFPS() : data_(nullptr), animator_(nullptr), list_(nullptr), adapter_(nullptr) {} +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:40:21: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_ALARM, "闹钟"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:41:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{BLUETOOTH_TITLE, "蓝牙"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:42:28: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_CALLER_IMAGE, "通话记录"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:43:29: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_COMPASS_IMAGE, "指南针"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:44:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_SETTING, "设置"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:45:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_SPO2, "血氧饱和度"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:46:31: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_VOCASSIST_IMAGE, "语音助手"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:47:21: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_ALARM, "闹钟"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:48:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{BLUETOOTH_TITLE, "蓝牙"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:49:28: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_CALLER_IMAGE, "通话记录"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:50:29: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_COMPASS_IMAGE, "指南针"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:51:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_SETTING, "设置"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:52:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_SPO2, "血氧饱和度"}, +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_list_fps/ui_test_list_fps.cpp:53:31: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] +{APPLIST_VOCASSIST_IMAGE, "语音助手"} +^ +15 warnings generated. +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialRotateImgView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/__/__/__/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialOptionImgView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp:18: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.h:55:14: warning: private field 'surface_' is not used [-Wunused-private-field] +Surface *surface_ = nullptr; +^ +1 warning generated. +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialDigitalImgView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h:39:10: warning: 'OnScroll' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] +bool OnScroll(); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h:72:22: note: overridden virtual function is here +virtual bool OnScroll() = 0; +^ +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp:16: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h:41:10: warning: 'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] +bool OnClick(UIView& view, const ClickEvent& event); +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h:176:22: note: overridden virtual function is here +virtual bool OnClick(UIView& view, const ClickEvent& event) +^ +2 warnings generated. +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialLabelView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp:5: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.h:9: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialArcProgressView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialBoxProgressView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialArcLabelView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialViewGroup.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialVideoView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialSequenceImgView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/DialStaticImgView.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayMainView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp:1: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +1 warning generated. +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/main/src/dial/parser/DialBinParser.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayModel.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayPresenter.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayExitBind.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayBind.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayBindRes.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayBindAni.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayPayCode.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayBarCode.cpp.obj +[ 98%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipaySetting.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayHelp.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayUnbindFinish.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayUnbind.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayList/AlipayListAdapter.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayList/AlipayListView.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayList/AlipayListItemView.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransListAdapter.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp.obj +[100%] Building CXX object application/wearable/nativeapp/CMakeFiles/nativelauncher.dir/nativeui/alipay/src/AlipayTrans/AlipayTransListItemView.cpp.obj +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp:15: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h:20: +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h:13: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h:23: +In file included from /home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h:15: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_canvas_ext.h:64:11: warning: field 'paintType_' will be initialized after field 'gradientSpread_' [-Wreorder-ctor] +paintType_(PaintType::PAINT_COLOR), gradientSpread_(GradientSpread::SPREAD_PAD), +^ +In file included from /home/snicker/hiwatch/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp:20: +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h:168:1: warning: replacement function 'operator new' cannot be declared 'inline' [-Winline-new-delete] +inline void* operator new(std::size_t size) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h:180:1: warning: replacement function 'operator new[]' cannot be declared 'inline' [-Winline-new-delete] +inline void* operator new[](std::size_t size) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h:192:1: warning: replacement function 'operator delete' cannot be declared 'inline' [-Winline-new-delete] +inline void operator delete(void *ptr) +^ +/home/snicker/hiwatch/code/sdk/middleware/services/gui/uikit/proprietary/include/gfx_utils/mem_check.h:206:1: warning: replacement function 'operator delete[]' cannot be declared 'inline' [-Winline-new-delete] +inline void operator delete[](void *ptr) +^ +5 warnings generated. +[100%] Linking CXX static library libnativelauncher.a [100%] Built target nativelauncher Scanning dependencies of target application [100%] Building C object CMakeFiles/application.dir/temp/__null___.c.obj @@ -1197,1207 +4811,51 @@ Memory region Used Size Region Size %age Used BOOTUP_RAM: 392 B 436 B 89.91% BOOTUP_LOAD: 392 B 436 B 89.91% FLASH_VERSION: 88 B 88 B 100.00% -FLASH_PROGRAM: 3958952 B 4931060 B 80.29% +FLASH_PROGRAM: 4040592 B 5541364 B 72.92% PSRAM_APP_CODE: 0 GB 1 MB 0.00% -PSRAM_APP_DATA: 112928 B 1 MB 10.77% +PSRAM_APP_DATA: 200816 B 1 MB 19.15% PSRAM_HEAP: 0 GB 7 MB 0.00% L2M_GPU_PROGRAM: 2192 B 256 KB 0.84% L2M_DSP_PROGRAM: 0 GB 0 GB -ITCM: 140108 B 196172 B 71.42% -DTCM: 154792 B 448 KB 33.74% +ITCM: 156268 B 196172 B 79.66% +DTCM: 142144 B 448 KB 30.98% IPC_SHARE_MEM: 18528 B 18528 B 100.00% PRESERVE_SHARE_MEM: 252 B 252 B 100.00% SYSTEM_PM: 44 B 192 B 22.92% SYSTEM_STATUS: 24 B 192 B 12.50% CPUTRACE_RAM: 8184 B 8184 B 100.00% [100%] Built target application +Scanning dependencies of target GENERAT_BIN +Scanning dependencies of target GENERAT_LST [100%] post_build:gen bin file [100%] Built target GENERAT_LST [100%] Built target GENERAT_BIN ######### Build target:brandy_native_js success -brandy-native-js takes 23.503459 s -/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js -['/usr/bin/python3', '/home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js'] - - -mkyaffs2image: image building tool for YAFFS2 built May 12 2023 -File [/home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin] is cread -Processing directory /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system into image file /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin -Object 257, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/KUMI_LOGO.bin is a file, 72 data chunks written -Object 258, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/logo.bin is a file, 38 data chunks written -tlen=240768 tp=6528 csz=2048 pp=6414 -Operation complete. -4 objects in 1 directories -114 NAND pages -mkyaffs2image: image building tool for YAFFS2 built May 12 2023 -File [/home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin] is exisits,file_size = 13787136 -Processing directory /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/update into image file /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin -Object 257, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/update/test2.txt is a file, 1 data chunks written -tlen=13795584 tp=13056 csz=2048 pp=6524 -Operation complete. -2 objects in 1 directories -4 NAND pages -mkyaffs2image: image building tool for YAFFS2 built May 12 2023 -File [/home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin] is exisits,file_size = 27574272 -Processing directory /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/music into image file /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin -Object 257, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/music/test3.txt is a file, 1 data chunks written -tlen=27582720 tp=19584 csz=2048 pp=6524 -Operation complete. -2 objects in 1 directories -4 NAND pages -mkyaffs2image: image building tool for YAFFS2 built May 12 2023 -File [/home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin] is exisits,file_size = 41361408 -Processing directory /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user into image file /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin -Object 257, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/video is a directory -Object 258, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/video/dial.mp4 is a file, 2486 data chunks written -Object 259, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res is a directory -Object 260, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_10.bin is a file, 4 data chunks written -Object 261, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/KUMI_LOGO.bin is a file, 72 data chunks written -Object 262, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_40.bin is a file, 11 data chunks written -Object 263, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks is a directory -Object 264, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao is a directory -Object 265, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/4.bin is a file, 2 data chunks written -Object 266, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/5.bin is a file, 2 data chunks written -Object 267, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/1.bin is a file, 2 data chunks written -Object 268, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/8.bin is a file, 2 data chunks written -Object 269, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/3.bin is a file, 2 data chunks written -Object 270, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/6.bin is a file, 2 data chunks written -Object 271, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/9.bin is a file, 2 data chunks written -Object 272, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/0.bin is a file, 2 data chunks written -Object 273, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/2.bin is a file, 2 data chunks written -Object 274, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/7.bin is a file, 2 data chunks written -Object 275, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/point.bin is a file, 1 data chunks written -Object 276, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background is a directory -Object 277, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/14.bin is a file, 19 data chunks written -Object 278, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/146.bin is a file, 19 data chunks written -Object 279, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/64.bin is a file, 19 data chunks written -Object 280, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/190.bin is a file, 19 data chunks written -Object 281, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/22.bin is a file, 19 data chunks written -Object 282, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/150.bin is a file, 19 data chunks written -Object 283, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/15.bin is a file, 19 data chunks written -Object 284, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/27.bin is a file, 19 data chunks written -Object 285, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/4.bin is a file, 19 data chunks written -Object 286, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/143.bin is a file, 19 data chunks written -Object 287, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/77.bin is a file, 19 data chunks written -Object 288, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/53.bin is a file, 19 data chunks written -Object 289, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/194.bin is a file, 19 data chunks written -Object 290, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/154.bin is a file, 19 data chunks written -Object 291, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/92.bin is a file, 19 data chunks written -Object 292, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/136.bin is a file, 19 data chunks written -Object 293, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/199.bin is a file, 19 data chunks written -Object 294, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/89.bin is a file, 19 data chunks written -Object 295, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/132.bin is a file, 19 data chunks written -Object 296, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/125.bin is a file, 19 data chunks written -Object 297, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/156.bin is a file, 19 data chunks written -Object 298, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/131.bin is a file, 19 data chunks written -Object 299, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/43.bin is a file, 19 data chunks written -Object 300, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/166.bin is a file, 19 data chunks written -Object 301, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/187.bin is a file, 19 data chunks written -Object 302, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/11.bin is a file, 19 data chunks written -Object 303, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/115.bin is a file, 19 data chunks written -Object 304, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/204.bin is a file, 19 data chunks written -Object 305, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/76.bin is a file, 19 data chunks written -Object 306, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/142.bin is a file, 19 data chunks written -Object 307, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/82.bin is a file, 19 data chunks written -Object 308, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/36.bin is a file, 19 data chunks written -Object 309, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/108.bin is a file, 19 data chunks written -Object 310, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/106.bin is a file, 19 data chunks written -Object 311, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/72.bin is a file, 19 data chunks written -Object 312, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/5.bin is a file, 19 data chunks written -Object 313, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/109.bin is a file, 19 data chunks written -Object 314, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/134.bin is a file, 19 data chunks written -Object 315, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/191.bin is a file, 19 data chunks written -Object 316, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/40.bin is a file, 19 data chunks written -Object 317, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/73.bin is a file, 19 data chunks written -Object 318, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/45.bin is a file, 19 data chunks written -Object 319, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/37.bin is a file, 19 data chunks written -Object 320, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/70.bin is a file, 19 data chunks written -Object 321, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/169.bin is a file, 19 data chunks written -Object 322, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/80.bin is a file, 19 data chunks written -Object 323, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/29.bin is a file, 19 data chunks written -Object 324, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/1.bin is a file, 19 data chunks written -Object 325, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/8.bin is a file, 19 data chunks written -Object 326, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/3.bin is a file, 19 data chunks written -Object 327, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/171.bin is a file, 19 data chunks written -Object 328, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/181.bin is a file, 19 data chunks written -Object 329, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/161.bin is a file, 19 data chunks written -Object 330, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/202.bin is a file, 19 data chunks written -Object 331, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/48.bin is a file, 19 data chunks written -Object 332, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/10.bin is a file, 19 data chunks written -Object 333, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/87.bin is a file, 19 data chunks written -Object 334, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/140.bin is a file, 19 data chunks written -Object 335, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/160.bin is a file, 19 data chunks written -Object 336, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/175.bin is a file, 19 data chunks written -Object 337, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/138.bin is a file, 19 data chunks written -Object 338, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/119.bin is a file, 19 data chunks written -Object 339, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/13.bin is a file, 19 data chunks written -Object 340, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/179.bin is a file, 19 data chunks written -Object 341, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/6.bin is a file, 19 data chunks written -Object 342, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/113.bin is a file, 19 data chunks written -Object 343, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/41.bin is a file, 19 data chunks written -Object 344, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/23.bin is a file, 19 data chunks written -Object 345, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/153.bin is a file, 19 data chunks written -Object 346, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/104.bin is a file, 19 data chunks written -Object 347, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/116.bin is a file, 19 data chunks written -Object 348, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/32.bin is a file, 19 data chunks written -Object 349, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/188.bin is a file, 19 data chunks written -Object 350, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/57.bin is a file, 19 data chunks written -Object 351, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/75.bin is a file, 19 data chunks written -Object 352, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/186.bin is a file, 19 data chunks written -Object 353, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/62.bin is a file, 19 data chunks written -Object 354, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/129.bin is a file, 19 data chunks written -Object 355, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/112.bin is a file, 19 data chunks written -Object 356, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/55.bin is a file, 19 data chunks written -Object 357, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/67.bin is a file, 19 data chunks written -Object 358, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/183.bin is a file, 19 data chunks written -Object 359, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/133.bin is a file, 19 data chunks written -Object 360, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/16.bin is a file, 19 data chunks written -Object 361, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/9.bin is a file, 19 data chunks written -Object 362, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/101.bin is a file, 19 data chunks written -Object 363, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/98.bin is a file, 19 data chunks written -Object 364, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/105.bin is a file, 19 data chunks written -Object 365, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/155.bin is a file, 19 data chunks written -Object 366, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/126.bin is a file, 19 data chunks written -Object 367, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/147.bin is a file, 19 data chunks written -Object 368, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/90.bin is a file, 19 data chunks written -Object 369, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/52.bin is a file, 19 data chunks written -Object 370, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/71.bin is a file, 19 data chunks written -Object 371, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/149.bin is a file, 19 data chunks written -Object 372, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/69.bin is a file, 19 data chunks written -Object 373, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/18.bin is a file, 19 data chunks written -Object 374, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/135.bin is a file, 19 data chunks written -Object 375, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/151.bin is a file, 19 data chunks written -Object 376, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/196.bin is a file, 19 data chunks written -Object 377, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/165.bin is a file, 19 data chunks written -Object 378, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/184.bin is a file, 19 data chunks written -Object 379, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/137.bin is a file, 19 data chunks written -Object 380, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/139.bin is a file, 19 data chunks written -Object 381, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/144.bin is a file, 19 data chunks written -Object 382, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/121.bin is a file, 19 data chunks written -Object 383, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/205.bin is a file, 19 data chunks written -Object 384, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/30.bin is a file, 19 data chunks written -Object 385, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/172.bin is a file, 19 data chunks written -Object 386, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/176.bin is a file, 19 data chunks written -Object 387, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/26.bin is a file, 19 data chunks written -Object 388, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/185.bin is a file, 19 data chunks written -Object 389, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/157.bin is a file, 19 data chunks written -Object 390, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/66.bin is a file, 19 data chunks written -Object 391, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/93.bin is a file, 19 data chunks written -Object 392, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/111.bin is a file, 19 data chunks written -Object 393, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/195.bin is a file, 19 data chunks written -Object 394, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/159.bin is a file, 19 data chunks written -Object 395, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/152.bin is a file, 19 data chunks written -Object 396, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/58.bin is a file, 19 data chunks written -Object 397, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/180.bin is a file, 19 data chunks written -Object 398, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/198.bin is a file, 19 data chunks written -Object 399, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/117.bin is a file, 19 data chunks written -Object 400, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/35.bin is a file, 19 data chunks written -Object 401, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/20.bin is a file, 19 data chunks written -Object 402, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/110.bin is a file, 19 data chunks written -Object 403, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/44.bin is a file, 19 data chunks written -Object 404, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/102.bin is a file, 19 data chunks written -Object 405, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/173.bin is a file, 19 data chunks written -Object 406, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/141.bin is a file, 19 data chunks written -Object 407, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/79.bin is a file, 19 data chunks written -Object 408, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/60.bin is a file, 19 data chunks written -Object 409, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/120.bin is a file, 19 data chunks written -Object 410, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/96.bin is a file, 19 data chunks written -Object 411, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/56.bin is a file, 19 data chunks written -Object 412, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/122.bin is a file, 19 data chunks written -Object 413, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/31.bin is a file, 19 data chunks written -Object 414, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/182.bin is a file, 19 data chunks written -Object 415, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/47.bin is a file, 19 data chunks written -Object 416, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/130.bin is a file, 19 data chunks written -Object 417, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/94.bin is a file, 19 data chunks written -Object 418, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/97.bin is a file, 19 data chunks written -Object 419, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/59.bin is a file, 19 data chunks written -Object 420, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/24.bin is a file, 19 data chunks written -Object 421, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/86.bin is a file, 19 data chunks written -Object 422, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/168.bin is a file, 19 data chunks written -Object 423, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/46.bin is a file, 19 data chunks written -Object 424, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/192.bin is a file, 19 data chunks written -Object 425, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/38.bin is a file, 19 data chunks written -Object 426, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/107.bin is a file, 19 data chunks written -Object 427, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/170.bin is a file, 19 data chunks written -Object 428, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/124.bin is a file, 19 data chunks written -Object 429, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/50.bin is a file, 19 data chunks written -Object 430, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/193.bin is a file, 19 data chunks written -Object 431, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/203.bin is a file, 19 data chunks written -Object 432, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/33.bin is a file, 19 data chunks written -Object 433, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/123.bin is a file, 19 data chunks written -Object 434, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/34.bin is a file, 19 data chunks written -Object 435, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/148.bin is a file, 19 data chunks written -Object 436, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/174.bin is a file, 19 data chunks written -Object 437, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/51.bin is a file, 19 data chunks written -Object 438, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/145.bin is a file, 19 data chunks written -Object 439, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/88.bin is a file, 19 data chunks written -Object 440, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/99.bin is a file, 19 data chunks written -Object 441, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/2.bin is a file, 19 data chunks written -Object 442, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/177.bin is a file, 19 data chunks written -Object 443, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/103.bin is a file, 19 data chunks written -Object 444, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/42.bin is a file, 19 data chunks written -Object 445, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/127.bin is a file, 19 data chunks written -Object 446, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/158.bin is a file, 19 data chunks written -Object 447, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/7.bin is a file, 19 data chunks written -Object 448, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/85.bin is a file, 19 data chunks written -Object 449, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/167.bin is a file, 19 data chunks written -Object 450, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/21.bin is a file, 19 data chunks written -Object 451, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/17.bin is a file, 19 data chunks written -Object 452, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/81.bin is a file, 19 data chunks written -Object 453, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/63.bin is a file, 19 data chunks written -Object 454, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/28.bin is a file, 19 data chunks written -Object 455, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/83.bin is a file, 19 data chunks written -Object 456, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/95.bin is a file, 19 data chunks written -Object 457, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/19.bin is a file, 19 data chunks written -Object 458, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/74.bin is a file, 19 data chunks written -Object 459, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/61.bin is a file, 19 data chunks written -Object 460, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/65.bin is a file, 19 data chunks written -Object 461, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/91.bin is a file, 19 data chunks written -Object 462, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/189.bin is a file, 19 data chunks written -Object 463, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/197.bin is a file, 19 data chunks written -Object 464, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/114.bin is a file, 19 data chunks written -Object 465, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/164.bin is a file, 19 data chunks written -Object 466, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/200.bin is a file, 19 data chunks written -Object 467, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/118.bin is a file, 19 data chunks written -Object 468, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/84.bin is a file, 19 data chunks written -Object 469, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/25.bin is a file, 19 data chunks written -Object 470, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/68.bin is a file, 19 data chunks written -Object 471, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/128.bin is a file, 19 data chunks written -Object 472, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/78.bin is a file, 19 data chunks written -Object 473, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/49.bin is a file, 19 data chunks written -Object 474, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/162.bin is a file, 19 data chunks written -Object 475, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/12.bin is a file, 19 data chunks written -Object 476, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/178.bin is a file, 19 data chunks written -Object 477, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/39.bin is a file, 19 data chunks written -Object 478, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/201.bin is a file, 19 data chunks written -Object 479, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/54.bin is a file, 19 data chunks written -Object 480, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/100.bin is a file, 19 data chunks written -Object 481, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao/background/163.bin is a file, 19 data chunks written -Object 482, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/KUMI is a directory -Object 483, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/KUMI/background.bin is a file, 72 data chunks written -Object 484, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo.json is a file, 2 data chunks written -Object 485, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao.json is a file, 1 data chunks written -Object 486, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo is a directory -Object 487, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo/second.bin is a file, 3 data chunks written -Object 488, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo/background.bin is a file, 72 data chunks written -Object 489, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo/minute.bin is a file, 2 data chunks written -Object 490, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/momo/hour.bin is a file, 2 data chunks written -Object 491, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maomao.json is a file, 1 data chunks written -Object 492, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud is a directory -Object 493, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/four.bin is a file, 2 data chunks written -Object 494, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/4.bin is a file, 2 data chunks written -Object 495, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/six.bin is a file, 2 data chunks written -Object 496, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/5.bin is a file, 2 data chunks written -Object 497, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/nine.bin is a file, 2 data chunks written -Object 498, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/seven.bin is a file, 2 data chunks written -Object 499, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/1.bin is a file, 2 data chunks written -Object 500, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/8.bin is a file, 2 data chunks written -Object 501, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/3.bin is a file, 2 data chunks written -Object 502, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/five.bin is a file, 2 data chunks written -Object 503, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/6.bin is a file, 2 data chunks written -Object 504, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/eight.bin is a file, 2 data chunks written -Object 505, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/background.bin is a file, 72 data chunks written -Object 506, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/two.bin is a file, 2 data chunks written -Object 507, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/9.bin is a file, 2 data chunks written -Object 508, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/0.bin is a file, 2 data chunks written -Object 509, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/zero.bin is a file, 2 data chunks written -Object 510, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/three.bin is a file, 2 data chunks written -Object 511, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/2.bin is a file, 2 data chunks written -Object 512, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/7.bin is a file, 2 data chunks written -Object 513, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/point.bin is a file, 1 data chunks written -Object 514, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud/one.bin is a file, 2 data chunks written -Object 515, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/flowerbud.json is a file, 1 data chunks written -Object 516, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/KUMI.json is a file, 1 data chunks written -Object 517, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph is a directory -Object 518, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/KUMI.bin is a file, 23 data chunks written -Object 519, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/momo.bin is a file, 23 data chunks written -Object 520, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maliao.bin is a file, 23 data chunks written -Object 521, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maomao.bin is a file, 23 data chunks written -Object 522, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/flowerbud.bin is a file, 23 data chunks written -Object 523, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/default.json is a file, 1 data chunks written -Object 524, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao is a directory -Object 525, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/4.bin is a file, 2 data chunks written -Object 526, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/5.bin is a file, 2 data chunks written -Object 527, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/1.bin is a file, 2 data chunks written -Object 528, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/8.bin is a file, 2 data chunks written -Object 529, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/3.bin is a file, 2 data chunks written -Object 530, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/6.bin is a file, 2 data chunks written -Object 531, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/background.bin is a file, 72 data chunks written -Object 532, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/9.bin is a file, 2 data chunks written -Object 533, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/0.bin is a file, 2 data chunks written -Object 534, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/2.bin is a file, 2 data chunks written -Object 535, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/7.bin is a file, 2 data chunks written -Object 536, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao/point.bin is a file, 1 data chunks written -Object 537, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_29.bin is a file, 11 data chunks written -Object 538, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/GANTAN.bin is a file, 9 data chunks written -Object 539, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_60.bin is a file, 11 data chunks written -Object 540, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_42.bin is a file, 11 data chunks written -Object 541, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown.bin is a file, 3 data chunks written -Object 542, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_65.bin is a file, 11 data chunks written -Object 543, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_06.bin is a file, 11 data chunks written -Object 544, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_22.bin is a file, 4 data chunks written -Object 545, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_24.bin is a file, 4 data chunks written -Object 546, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_11.bin is a file, 7 data chunks written -Object 547, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_15.bin is a file, 11 data chunks written -Object 548, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/getpic.bin is a file, 3 data chunks written -Object 549, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_CheckOff.bin is a file, 4 data chunks written -Object 550, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_70.bin is a file, 11 data chunks written -Object 551, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/B024_011.bin is a file, 40 data chunks written -Object 552, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_01.bin is a file, 11 data chunks written -Object 553, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_08.bin is a file, 9 data chunks written -Object 554, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_08.bin is a file, 11 data chunks written -Object 555, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_51.bin is a file, 11 data chunks written -Object 556, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_06.bin is a file, 11 data chunks written -Object 557, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_67.bin is a file, 11 data chunks written -Object 558, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind is a directory -Object 559, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/REMIND_DRINK_WATER.bin is a file, 3 data chunks written -Object 560, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin is a directory -Object 561, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/14.bin is a file, 3 data chunks written -Object 562, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/22.bin is a file, 3 data chunks written -Object 563, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/15.bin is a file, 3 data chunks written -Object 564, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/27.bin is a file, 3 data chunks written -Object 565, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/4.bin is a file, 3 data chunks written -Object 566, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/43.bin is a file, 3 data chunks written -Object 567, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/11.bin is a file, 3 data chunks written -Object 568, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/36.bin is a file, 3 data chunks written -Object 569, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/5.bin is a file, 3 data chunks written -Object 570, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/40.bin is a file, 3 data chunks written -Object 571, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/45.bin is a file, 3 data chunks written -Object 572, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/37.bin is a file, 3 data chunks written -Object 573, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/29.bin is a file, 3 data chunks written -Object 574, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/1.bin is a file, 3 data chunks written -Object 575, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/8.bin is a file, 3 data chunks written -Object 576, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/3.bin is a file, 3 data chunks written -Object 577, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/48.bin is a file, 3 data chunks written -Object 578, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/10.bin is a file, 3 data chunks written -Object 579, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/13.bin is a file, 3 data chunks written -Object 580, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/6.bin is a file, 3 data chunks written -Object 581, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/41.bin is a file, 3 data chunks written -Object 582, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/23.bin is a file, 3 data chunks written -Object 583, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/32.bin is a file, 3 data chunks written -Object 584, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/16.bin is a file, 3 data chunks written -Object 585, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/9.bin is a file, 3 data chunks written -Object 586, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/52.bin is a file, 3 data chunks written -Object 587, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/18.bin is a file, 3 data chunks written -Object 588, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/30.bin is a file, 3 data chunks written -Object 589, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/26.bin is a file, 3 data chunks written -Object 590, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/35.bin is a file, 3 data chunks written -Object 591, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/20.bin is a file, 3 data chunks written -Object 592, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/44.bin is a file, 3 data chunks written -Object 593, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/31.bin is a file, 3 data chunks written -Object 594, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/47.bin is a file, 3 data chunks written -Object 595, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/24.bin is a file, 3 data chunks written -Object 596, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/46.bin is a file, 3 data chunks written -Object 597, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/38.bin is a file, 3 data chunks written -Object 598, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/50.bin is a file, 3 data chunks written -Object 599, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/33.bin is a file, 3 data chunks written -Object 600, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/34.bin is a file, 3 data chunks written -Object 601, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/51.bin is a file, 3 data chunks written -Object 602, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/2.bin is a file, 3 data chunks written -Object 603, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/42.bin is a file, 3 data chunks written -Object 604, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/7.bin is a file, 3 data chunks written -Object 605, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/21.bin is a file, 3 data chunks written -Object 606, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/17.bin is a file, 3 data chunks written -Object 607, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/28.bin is a file, 3 data chunks written -Object 608, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/19.bin is a file, 3 data chunks written -Object 609, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/25.bin is a file, 3 data chunks written -Object 610, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/49.bin is a file, 3 data chunks written -Object 611, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/12.bin is a file, 3 data chunks written -Object 612, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/remind/unbind_bin/39.bin is a file, 3 data chunks written -Object 613, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DELETE.bin is a file, 9 data chunks written -Object 614, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_13.bin is a file, 7 data chunks written -Object 615, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/sport.bin is a file, 3 data chunks written -Object 616, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_57.bin is a file, 11 data chunks written -Object 617, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_02.bin is a file, 11 data chunks written -Object 618, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_REV_POINTER.bin is a file, 1 data chunks written -Object 619, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/POP_UP_CLOCK.bin is a file, 8 data chunks written -Object 620, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/STEPS_IMAGE.bin is a file, 25 data chunks written -Object 621, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_02.bin is a file, 11 data chunks written -Object 622, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown is a directory -Object 623, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWN_BUTTON.bin is a file, 16 data chunks written -Object 624, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_TEN_MINUTE.bin is a file, 11 data chunks written -Object 625, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_END.bin is a file, 4 data chunks written -Object 626, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_PLAY.bin is a file, 4 data chunks written -Object 627, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_PAUSE.bin is a file, 4 data chunks written -Object 628, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_VECTOR.bin is a file, 1 data chunks written -Object 629, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWN_COLONE.bin is a file, 1 data chunks written -Object 630, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_RESET.bin is a file, 4 data chunks written -Object 631, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_FIVE_MINUTE.bin is a file, 11 data chunks written -Object 632, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_ONE_MINUTE.bin is a file, 11 data chunks written -Object 633, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWN_ATTENTION.bin is a file, 3 data chunks written -Object 634, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/countdown/COUNTDOWM_THIRTY_MINUTE.bin is a file, 11 data chunks written -Object 635, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/PROGRESS_BAR_TMAGE.bin is a file, 7 data chunks written -Object 636, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_REBOOT.bin is a file, 2 data chunks written -Object 637, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/red.bin is a file, 11 data chunks written -Object 638, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training record.bin is a file, 3 data chunks written -Object 639, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_MEASURE.bin is a file, 12 data chunks written -Object 640, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/MICRO_PHONE_CLOSE.bin is a file, 10 data chunks written -Object 641, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_36.bin is a file, 11 data chunks written -Object 642, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clock is a directory -Object 643, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clock/clock.bin is a file, 142 data chunks written -Object 644, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_31.bin is a file, 11 data chunks written -Object 645, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/logo.bin is a file, 38 data chunks written -Object 646, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_35.bin is a file, 11 data chunks written -Object 647, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SHUTDOWN_BUTTON.bin is a file, 7 data chunks written -Object 648, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_LITTLE_MEASURE.bin is a file, 3 data chunks written -Object 649, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/WALK_BACK_GROUND.bin is a file, 204 data chunks written -Object 650, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTHEAR.bin is a file, 7 data chunks written -Object 651, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_10.bin is a file, 10 data chunks written -Object 652, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_MEASURE_ING.bin is a file, 15 data chunks written -Object 653, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_15.bin is a file, 10 data chunks written -Object 654, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_20.bin is a file, 10 data chunks written -Object 655, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/MICRO_PHONE_OPEN.bin is a file, 10 data chunks written -Object 656, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/dial.bin is a file, 3 data chunks written -Object 657, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/run3.bin is a file, 31 data chunks written -Object 658, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clock.bin is a file, 3 data chunks written -Object 659, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_19.bin is a file, 4 data chunks written -Object 660, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/REBOOT_BUTTON.bin is a file, 7 data chunks written -Object 661, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_21.bin is a file, 10 data chunks written -Object 662, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_09.bin is a file, 10 data chunks written -Object 663, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/bloodpressure.bin is a file, 3 data chunks written -Object 664, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/MEDIA_VOLUME.bin is a file, 13 data chunks written -Object 665, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/NO_CALLER_LOG_IMAGE.bin is a file, 204 data chunks written -Object 666, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/training.bin is a file, 3 data chunks written -Object 667, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_ABOUT_THE_WATCH.bin is a file, 13 data chunks written -Object 668, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_69.bin is a file, 11 data chunks written -Object 669, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COMPASS_CALIBRATE_IMAGE.bin is a file, 68 data chunks written -Object 670, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEART_IMAGE.bin is a file, 25 data chunks written -Object 671, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_09.bin is a file, 11 data chunks written -Object 672, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_03.bin is a file, 11 data chunks written -Object 673, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/A094_051_8888.bin is a file, 97 data chunks written -Object 674, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_CheckOn.bin is a file, 4 data chunks written -Object 675, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_52.bin is a file, 11 data chunks written -Object 676, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_12.bin is a file, 11 data chunks written -Object 677, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_14.bin is a file, 11 data chunks written -Object 678, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SOUND_VIBRATION.bin is a file, 2 data chunks written -Object 679, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/POOR_SIGNAL_OPEN.bin is a file, 6 data chunks written -Object 680, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_64.bin is a file, 11 data chunks written -Object 681, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_56.bin is a file, 11 data chunks written -Object 682, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_03.bin is a file, 10 data chunks written -Object 683, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood is a directory -Object 684, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood/SaO2.bin is a file, 20 data chunks written -Object 685, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood/Vector.bin is a file, 1 data chunks written -Object 686, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood/boutton.bin is a file, 16 data chunks written -Object 687, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood/Error.bin is a file, 3 data chunks written -Object 688, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Blood/beijing.bin is a file, 72 data chunks written -Object 689, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_REBOOT.bin is a file, 13 data chunks written -Object 690, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_01.bin is a file, 5 data chunks written -Object 691, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_15.bin is a file, 4 data chunks written -Object 692, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_04.bin is a file, 4 data chunks written -Object 693, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_01.bin is a file, 9 data chunks written -Object 694, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/GENERIC_SIGNAL_ENCRYPTION.bin is a file, 6 data chunks written -Object 695, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Bluetooth.bin is a file, 3 data chunks written -Object 696, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_14.bin is a file, 4 data chunks written -Object 697, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TIME_IMAGE.bin is a file, 25 data chunks written -Object 698, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SHOE_IMAGE.bin is a file, 2 data chunks written -Object 699, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_14.bin is a file, 9 data chunks written -Object 700, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_23.bin is a file, 11 data chunks written -Object 701, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_54.bin is a file, 11 data chunks written -Object 702, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SECONDHAND.bin is a file, 17 data chunks written -Object 703, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather.bin is a file, 3 data chunks written -Object 704, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CHECKBOX_OFF.bin is a file, 1 data chunks written -Object 705, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTING_BACKGROUND.bin is a file, 13 data chunks written -Object 706, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CALLER_LOG_IMAGE.bin is a file, 10 data chunks written -Object 707, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/blood.bin is a file, 3 data chunks written -Object 708, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_SYSTEM_LANGUAGE.bin is a file, 13 data chunks written -Object 709, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CALLING_PHONE.bin is a file, 3 data chunks written -Object 710, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_24.bin is a file, 11 data chunks written -Object 711, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_16.bin is a file, 9 data chunks written -Object 712, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CS_A094_051_8888_abypass.bin is a file, 48 data chunks written -Object 713, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/B024_009.bin is a file, 40 data chunks written -Object 714, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_FACTORY_RESET.bin is a file, 13 data chunks written -Object 715, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/FULL_SIGNAL_OPEN.bin is a file, 6 data chunks written -Object 716, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SPEED_IMAGE.bin is a file, 25 data chunks written -Object 717, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_POINT.bin is a file, 1 data chunks written -Object 718, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_02.bin is a file, 9 data chunks written -Object 719, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/POOR_SIGNAL_ENCRYPTION.bin is a file, 6 data chunks written -Object 720, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_04.bin is a file, 9 data chunks written -Object 721, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_04.bin is a file, 10 data chunks written -Object 722, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_16.bin is a file, 7 data chunks written -Object 723, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CALL_VOLUME.bin is a file, 13 data chunks written -Object 724, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record is a directory -Object 725, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_PLAY_VOLUME.bin is a file, 1 data chunks written -Object 726, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD3.bin is a file, 10 data chunks written -Object 727, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_PLAY_BACKGROUND.bin is a file, 72 data chunks written -Object 728, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/UNIVERSAL_PLAY.bin is a file, 1 data chunks written -Object 729, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD1.bin is a file, 9 data chunks written -Object 730, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD2.bin is a file, 5 data chunks written -Object 731, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/animator1.bin is a file, 1 data chunks written -Object 732, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_PLAY_NEXT.bin is a file, 1 data chunks written -Object 733, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_PLAY_DELETE.bin is a file, 1 data chunks written -Object 734, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_DELETE_BACKGROUND.bin is a file, 72 data chunks written -Object 735, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/animator2.bin is a file, 3 data chunks written -Object 736, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/UNIVERSAL_PAUSE.bin is a file, 1 data chunks written -Object 737, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Record/RECORD_PLAY_PROVE.bin is a file, 1 data chunks written -Object 738, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_63.bin is a file, 11 data chunks written -Object 739, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_06.bin is a file, 4 data chunks written -Object 740, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_COMPASS_IMAGE.bin is a file, 7 data chunks written -Object 741, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/FastTrainingAttentionVector.bin is a file, 3 data chunks written -Object 742, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_44.bin is a file, 11 data chunks written -Object 743, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_10.bin is a file, 11 data chunks written -Object 744, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_16.bin is a file, 10 data chunks written -Object 745, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player is a directory -Object 746, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage is a directory -Object 747, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/14.bin is a file, 4 data chunks written -Object 748, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/64.bin is a file, 4 data chunks written -Object 749, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/22.bin is a file, 4 data chunks written -Object 750, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/15.bin is a file, 4 data chunks written -Object 751, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/27.bin is a file, 4 data chunks written -Object 752, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/4.bin is a file, 4 data chunks written -Object 753, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/77.bin is a file, 4 data chunks written -Object 754, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/53.bin is a file, 4 data chunks written -Object 755, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/92.bin is a file, 4 data chunks written -Object 756, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/89.bin is a file, 4 data chunks written -Object 757, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/43.bin is a file, 4 data chunks written -Object 758, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/11.bin is a file, 4 data chunks written -Object 759, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/115.bin is a file, 4 data chunks written -Object 760, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/76.bin is a file, 4 data chunks written -Object 761, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/82.bin is a file, 4 data chunks written -Object 762, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/36.bin is a file, 4 data chunks written -Object 763, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/108.bin is a file, 4 data chunks written -Object 764, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/106.bin is a file, 4 data chunks written -Object 765, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/72.bin is a file, 4 data chunks written -Object 766, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/5.bin is a file, 4 data chunks written -Object 767, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/109.bin is a file, 4 data chunks written -Object 768, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/40.bin is a file, 4 data chunks written -Object 769, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/73.bin is a file, 4 data chunks written -Object 770, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/45.bin is a file, 4 data chunks written -Object 771, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/37.bin is a file, 4 data chunks written -Object 772, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/70.bin is a file, 4 data chunks written -Object 773, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/80.bin is a file, 4 data chunks written -Object 774, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/29.bin is a file, 4 data chunks written -Object 775, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/1.bin is a file, 4 data chunks written -Object 776, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/8.bin is a file, 4 data chunks written -Object 777, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/3.bin is a file, 4 data chunks written -Object 778, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/48.bin is a file, 4 data chunks written -Object 779, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/10.bin is a file, 4 data chunks written -Object 780, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/87.bin is a file, 4 data chunks written -Object 781, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/119.bin is a file, 4 data chunks written -Object 782, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/13.bin is a file, 4 data chunks written -Object 783, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/6.bin is a file, 4 data chunks written -Object 784, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/113.bin is a file, 4 data chunks written -Object 785, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/41.bin is a file, 4 data chunks written -Object 786, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/23.bin is a file, 4 data chunks written -Object 787, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/104.bin is a file, 4 data chunks written -Object 788, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/116.bin is a file, 4 data chunks written -Object 789, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/32.bin is a file, 4 data chunks written -Object 790, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/57.bin is a file, 4 data chunks written -Object 791, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/75.bin is a file, 4 data chunks written -Object 792, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/62.bin is a file, 4 data chunks written -Object 793, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/112.bin is a file, 4 data chunks written -Object 794, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/55.bin is a file, 4 data chunks written -Object 795, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/67.bin is a file, 4 data chunks written -Object 796, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/16.bin is a file, 4 data chunks written -Object 797, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/9.bin is a file, 4 data chunks written -Object 798, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/101.bin is a file, 4 data chunks written -Object 799, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/98.bin is a file, 4 data chunks written -Object 800, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/105.bin is a file, 4 data chunks written -Object 801, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/90.bin is a file, 4 data chunks written -Object 802, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/52.bin is a file, 4 data chunks written -Object 803, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/71.bin is a file, 4 data chunks written -Object 804, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/69.bin is a file, 4 data chunks written -Object 805, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/18.bin is a file, 4 data chunks written -Object 806, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/30.bin is a file, 4 data chunks written -Object 807, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/26.bin is a file, 4 data chunks written -Object 808, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/66.bin is a file, 4 data chunks written -Object 809, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/93.bin is a file, 4 data chunks written -Object 810, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/111.bin is a file, 4 data chunks written -Object 811, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/58.bin is a file, 4 data chunks written -Object 812, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/117.bin is a file, 4 data chunks written -Object 813, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/35.bin is a file, 4 data chunks written -Object 814, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/20.bin is a file, 4 data chunks written -Object 815, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/110.bin is a file, 4 data chunks written -Object 816, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/44.bin is a file, 4 data chunks written -Object 817, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/102.bin is a file, 4 data chunks written -Object 818, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/79.bin is a file, 4 data chunks written -Object 819, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/60.bin is a file, 4 data chunks written -Object 820, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/120.bin is a file, 4 data chunks written -Object 821, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/96.bin is a file, 4 data chunks written -Object 822, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/56.bin is a file, 4 data chunks written -Object 823, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/31.bin is a file, 4 data chunks written -Object 824, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/47.bin is a file, 4 data chunks written -Object 825, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/94.bin is a file, 4 data chunks written -Object 826, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/97.bin is a file, 4 data chunks written -Object 827, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/59.bin is a file, 4 data chunks written -Object 828, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/24.bin is a file, 4 data chunks written -Object 829, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/86.bin is a file, 4 data chunks written -Object 830, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/46.bin is a file, 4 data chunks written -Object 831, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/38.bin is a file, 4 data chunks written -Object 832, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/107.bin is a file, 4 data chunks written -Object 833, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/50.bin is a file, 4 data chunks written -Object 834, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/33.bin is a file, 4 data chunks written -Object 835, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/34.bin is a file, 4 data chunks written -Object 836, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/51.bin is a file, 4 data chunks written -Object 837, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/88.bin is a file, 4 data chunks written -Object 838, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/99.bin is a file, 4 data chunks written -Object 839, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/2.bin is a file, 4 data chunks written -Object 840, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/103.bin is a file, 4 data chunks written -Object 841, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/42.bin is a file, 4 data chunks written -Object 842, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/7.bin is a file, 4 data chunks written -Object 843, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/85.bin is a file, 4 data chunks written -Object 844, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/21.bin is a file, 4 data chunks written -Object 845, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/17.bin is a file, 4 data chunks written -Object 846, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/81.bin is a file, 4 data chunks written -Object 847, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/63.bin is a file, 4 data chunks written -Object 848, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/28.bin is a file, 4 data chunks written -Object 849, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/83.bin is a file, 4 data chunks written -Object 850, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/95.bin is a file, 4 data chunks written -Object 851, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/19.bin is a file, 4 data chunks written -Object 852, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/74.bin is a file, 4 data chunks written -Object 853, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/61.bin is a file, 4 data chunks written -Object 854, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/65.bin is a file, 4 data chunks written -Object 855, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/91.bin is a file, 4 data chunks written -Object 856, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/114.bin is a file, 4 data chunks written -Object 857, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/118.bin is a file, 4 data chunks written -Object 858, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/84.bin is a file, 4 data chunks written -Object 859, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/25.bin is a file, 4 data chunks written -Object 860, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/68.bin is a file, 4 data chunks written -Object 861, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/78.bin is a file, 4 data chunks written -Object 862, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/49.bin is a file, 4 data chunks written -Object 863, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/12.bin is a file, 4 data chunks written -Object 864, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/39.bin is a file, 4 data chunks written -Object 865, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/54.bin is a file, 4 data chunks written -Object 866, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/BtReconnectImage/100.bin is a file, 4 data chunks written -Object 867, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/player/player.bin is a file, 98 data chunks written -Object 868, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_11.bin is a file, 4 data chunks written -Object 869, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_19.bin is a file, 10 data chunks written -Object 870, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TOGGLEBUTTON_OFF.bin is a file, 2 data chunks written -Object 871, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_26.bin is a file, 11 data chunks written -Object 872, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/INDOORWALK.bin is a file, 32 data chunks written -Object 873, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_01.bin is a file, 7 data chunks written -Object 874, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_VOCASSIST_IMAGE.bin is a file, 7 data chunks written -Object 875, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/whilte.bin is a file, 13 data chunks written -Object 876, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_16.bin is a file, 11 data chunks written -Object 877, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_25.bin is a file, 11 data chunks written -Object 878, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_31.bin is a file, 4 data chunks written -Object 879, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/WATCH_IMAGE.bin is a file, 6 data chunks written -Object 880, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_39.bin is a file, 11 data chunks written -Object 881, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_IMAGE.bin is a file, 3 data chunks written -Object 882, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/ANSWER_PHONE.bin is a file, 3 data chunks written -Object 883, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DISPLAY_BRIGHTNESS.bin is a file, 2 data chunks written -Object 884, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_14.bin is a file, 7 data chunks written -Object 885, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CS_A094_051_888_abypass.bin is a file, 24 data chunks written -Object 886, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_11.bin is a file, 9 data chunks written -Object 887, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_20.bin is a file, 4 data chunks written -Object 888, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_10.bin is a file, 9 data chunks written -Object 889, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HarmonyOS_Sans_Light_Italic.ttf is a file, 70 data chunks written -Object 890, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_12.bin is a file, 9 data chunks written -Object 891, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_12.bin is a file, 7 data chunks written -Object 892, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_EXIT.bin is a file, 3 data chunks written -Object 893, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/run2.bin is a file, 16 data chunks written -Object 894, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BringhtnessContuolVector.bin is a file, 1 data chunks written -Object 895, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_04.bin is a file, 11 data chunks written -Object 896, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_01.bin is a file, 10 data chunks written -Object 897, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_05.bin is a file, 9 data chunks written -Object 898, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/setting.bin is a file, 3 data chunks written -Object 899, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_13.bin is a file, 10 data chunks written -Object 900, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTING_NEXT.bin is a file, 1 data chunks written -Object 901, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTING_BLUETOOTH.bin is a file, 2 data chunks written -Object 902, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_BACKGROUND.bin is a file, 68 data chunks written -Object 903, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_06.bin is a file, 9 data chunks written -Object 904, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_WARN.bin is a file, 2 data chunks written -Object 905, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/record.bin is a file, 3 data chunks written -Object 906, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_71.bin is a file, 11 data chunks written -Object 907, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_13.bin is a file, 9 data chunks written -Object 908, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_49.bin is a file, 11 data chunks written -Object 909, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_38.bin is a file, 11 data chunks written -Object 910, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VolumeControlVector.bin is a file, 1 data chunks written -Object 911, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPTIONS_BOX2.bin is a file, 20 data chunks written -Object 912, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_ICON_ENTER.bin is a file, 7 data chunks written -Object 913, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_45.bin is a file, 11 data chunks written -Object 914, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_33.bin is a file, 11 data chunks written -Object 915, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_ROTATE.bin is a file, 3 data chunks written -Object 916, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_17.bin is a file, 4 data chunks written -Object 917, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_TRUE.bin is a file, 3 data chunks written -Object 918, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_14.bin is a file, 10 data chunks written -Object 919, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_58.bin is a file, 11 data chunks written -Object 920, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/GENERIC_SIGNAL_OPEN.bin is a file, 6 data chunks written -Object 921, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_04.bin is a file, 11 data chunks written -Object 922, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_32.bin is a file, 4 data chunks written -Object 923, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_17.bin is a file, 10 data chunks written -Object 924, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/line_cj.brk is a file, 24 data chunks written -Object 925, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_47.bin is a file, 11 data chunks written -Object 926, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_43.bin is a file, 11 data chunks written -Object 927, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/PHONE_IMAGE.bin is a file, 6 data chunks written -Object 928, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_37.bin is a file, 11 data chunks written -Object 929, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HOURHAND.bin is a file, 17 data chunks written -Object 930, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_REPORT.bin is a file, 21 data chunks written -Object 931, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_50.bin is a file, 11 data chunks written -Object 932, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_SUPERVISE.bin is a file, 13 data chunks written -Object 933, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/ROTATE_CENTER_IMAGE.bin is a file, 28 data chunks written -Object 934, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_12.bin is a file, 4 data chunks written -Object 935, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_FactoryReset.bin is a file, 72 data chunks written -Object 936, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/MINUTEHAND.bin is a file, 17 data chunks written -Object 937, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CONNECT_PHONE.bin is a file, 2 data chunks written -Object 938, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_16.bin is a file, 4 data chunks written -Object 939, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SELECTION_BOX.bin is a file, 7 data chunks written -Object 940, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH.bin is a file, 3 data chunks written -Object 941, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/music.bin is a file, 3 data chunks written -Object 942, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_05.bin is a file, 4 data chunks written -Object 943, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/AGREEING.bin is a file, 10 data chunks written -Object 944, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/phone.bin is a file, 3 data chunks written -Object 945, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_20.bin is a file, 11 data chunks written -Object 946, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone is a directory -Object 947, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/4.bin is a file, 3 data chunks written -Object 948, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/Phone_Ring.bin is a file, 7 data chunks written -Object 949, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/phone-off.bin is a file, 1 data chunks written -Object 950, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/5.bin is a file, 3 data chunks written -Object 951, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/1.bin is a file, 3 data chunks written -Object 952, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/8.bin is a file, 3 data chunks written -Object 953, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/3.bin is a file, 3 data chunks written -Object 954, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/voice-no.bin is a file, 1 data chunks written -Object 955, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/del.bin is a file, 3 data chunks written -Object 956, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/6.bin is a file, 3 data chunks written -Object 957, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/microphone-no.bin is a file, 1 data chunks written -Object 958, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/little-girl.bin is a file, 2 data chunks written -Object 959, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/little-boy.bin is a file, 2 data chunks written -Object 960, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/call.bin is a file, 3 data chunks written -Object 961, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/9.bin is a file, 3 data chunks written -Object 962, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/0.bin is a file, 3 data chunks written -Object 963, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/microphone.bin is a file, 1 data chunks written -Object 964, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/boy.bin is a file, 8 data chunks written -Object 965, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/phone-call.bin is a file, 1 data chunks written -Object 966, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/phonedir.bin is a file, 8 data chunks written -Object 967, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/girl.bin is a file, 8 data chunks written -Object 968, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/phone-call1.bin is a file, 1 data chunks written -Object 969, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/phone-off-round.bin is a file, 3 data chunks written -Object 970, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/2.bin is a file, 3 data chunks written -Object 971, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/7.bin is a file, 3 data chunks written -Object 972, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/21-avatar-outline 1.bin is a file, 8 data chunks written -Object 973, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/voice.bin is a file, 1 data chunks written -Object 974, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Phone/Phone_Call.bin is a file, 7 data chunks written -Object 975, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/FULL_SIGNAL_ENCRYPTION.bin is a file, 6 data chunks written -Object 976, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_09.bin is a file, 9 data chunks written -Object 977, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_19.bin is a file, 9 data chunks written -Object 978, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_07.bin is a file, 11 data chunks written -Object 979, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CORRESPONDENCE_DEGREE.bin is a file, 2 data chunks written -Object 980, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_32.bin is a file, 11 data chunks written -Object 981, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_30.bin is a file, 11 data chunks written -Object 982, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_27.bin is a file, 4 data chunks written -Object 983, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/earth.bin is a file, 68 data chunks written -Object 984, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_07.bin is a file, 9 data chunks written -Object 985, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_12.bin is a file, 10 data chunks written -Object 986, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_ALARM.bin is a file, 7 data chunks written -Object 987, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_25.bin is a file, 4 data chunks written -Object 988, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_18.bin is a file, 10 data chunks written -Object 989, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_23.bin is a file, 4 data chunks written -Object 990, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_03.bin is a file, 11 data chunks written -Object 991, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_17.bin is a file, 11 data chunks written -Object 992, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPTIONS_BOX1.bin is a file, 13 data chunks written -Object 993, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/ui_list_fps_res.bin is a file, 17 data chunks written -Object 994, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_CALLER_IMAGE.bin is a file, 7 data chunks written -Object 995, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_15.bin is a file, 7 data chunks written -Object 996, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_22.bin is a file, 10 data chunks written -Object 997, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_ICON_ENTER.bin is a file, 19 data chunks written -Object 998, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPTIONS_BOX4.bin is a file, 35 data chunks written -Object 999, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/boold oxygen.bin is a file, 3 data chunks written -Object 1000, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUE_ADD.bin is a file, 9 data chunks written -Object 1001, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_SHUTDOWN.bin is a file, 2 data chunks written -Object 1002, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather is a directory -Object 1003, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_unknown.bin is a file, 2 data chunks written -Object 1004, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_snow.bin is a file, 2 data chunks written -Object 1005, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_HAZE.bin is a file, 6 data chunks written -Object 1006, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_BACKGROUND.bin is a file, 72 data chunks written -Object 1007, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_sunny-cloudy.bin is a file, 2 data chunks written -Object 1008, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_HUMIDITY.bin is a file, 2 data chunks written -Object 1009, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_CLEAR-CLOUDY.bin is a file, 6 data chunks written -Object 1010, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_THUNDERSHOWER.bin is a file, 6 data chunks written -Object 1011, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_thundershower.bin is a file, 2 data chunks written -Object 1012, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_clear-sunny.bin is a file, 2 data chunks written -Object 1013, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_OVERCAST.bin is a file, 6 data chunks written -Object 1014, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_sunny.bin is a file, 2 data chunks written -Object 1015, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_FOGGY.bin is a file, 6 data chunks written -Object 1016, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_foggy.bin is a file, 2 data chunks written -Object 1017, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_DUSTSTORM.bin is a file, 6 data chunks written -Object 1018, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_haze.bin is a file, 2 data chunks written -Object 1019, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_RAIN.bin is a file, 6 data chunks written -Object 1020, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_CLEAR-SUNNY.bin is a file, 6 data chunks written -Object 1021, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_UNKNOWN.bin is a file, 6 data chunks written -Object 1022, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_SNOW.bin is a file, 6 data chunks written -Object 1023, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_clear-cloudy.bin is a file, 2 data chunks written -Object 1024, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_duststorm.bin is a file, 2 data chunks written -Object 1025, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_WINDSPEED.bin is a file, 2 data chunks written -Object 1026, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_overcast.bin is a file, 2 data chunks written -Object 1027, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/weather_rain.bin is a file, 2 data chunks written -Object 1028, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_UVI.bin is a file, 2 data chunks written -Object 1029, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_SUNNY.bin is a file, 6 data chunks written -Object 1030, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/weather/WEATHER_SUNNY-CLOUNDY.bin is a file, 6 data chunks written -Object 1031, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HarmonyOS_Sans_SC_Regular.ttf is a file, 4034 data chunks written -Object 1032, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/NEW_DEVICE.bin is a file, 16 data chunks written -Object 1033, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_TITLE.bin is a file, 2 data chunks written -Object 1034, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/heart is a directory -Object 1035, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/heart/heart.bin is a file, 34 data chunks written -Object 1036, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/haha.bin is a file, 3 data chunks written -Object 1037, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_21.bin is a file, 11 data chunks written -Object 1038, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_15.bin is a file, 9 data chunks written -Object 1039, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_08.bin is a file, 11 data chunks written -Object 1040, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_05.bin is a file, 11 data chunks written -Object 1041, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_19.bin is a file, 11 data chunks written -Object 1042, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_SPO2.bin is a file, 7 data chunks written -Object 1043, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_02.bin is a file, 4 data chunks written -Object 1044, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_59.bin is a file, 11 data chunks written -Object 1045, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_66.bin is a file, 11 data chunks written -Object 1046, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/backGround.bin is a file, 876 data chunks written -Object 1047, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPEN_LOGO.bin is a file, 412 data chunks written -Object 1048, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_ABOUT_STUDY.bin is a file, 3 data chunks written -Object 1049, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/tiger_path.bin is a file, 82 data chunks written -Object 1050, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_13.bin is a file, 11 data chunks written -Object 1051, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/dropdown is a directory -Object 1052, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/dropdown/dropdown.bin is a file, 9 data chunks written -Object 1053, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_03.bin is a file, 9 data chunks written -Object 1054, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_VOLUME.bin is a file, 13 data chunks written -Object 1055, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CLOSE_RING_CLOCK.bin is a file, 13 data chunks written -Object 1056, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SOUND_IMAGE.bin is a file, 8 data chunks written -Object 1057, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_34.bin is a file, 11 data chunks written -Object 1058, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_02.bin is a file, 10 data chunks written -Object 1059, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_10.bin is a file, 7 data chunks written -Object 1060, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/chronometer.bin is a file, 3 data chunks written -Object 1061, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_05.bin is a file, 11 data chunks written -Object 1062, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/QUICK_ACCESS.bin is a file, 2 data chunks written -Object 1063, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_WAITING.bin is a file, 15 data chunks written -Object 1064, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_21.bin is a file, 4 data chunks written -Object 1065, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM.bin is a file, 2 data chunks written -Object 1066, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPEN_LOGO_QSPI.bin is a file, 150 data chunks written -Object 1067, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/MAIN_FACE_IMAGE.bin is a file, 204 data chunks written -Object 1068, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/RIGHT.bin is a file, 9 data chunks written -Object 1069, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BT_LIST.bin is a file, 29 data chunks written -Object 1070, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_UP_DROP.bin is a file, 1 data chunks written -Object 1071, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DISSGREE.bin is a file, 10 data chunks written -Object 1072, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CHECKBOX_ON.bin is a file, 1 data chunks written -Object 1073, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/run1.bin is a file, 22 data chunks written -Object 1074, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele is a directory -Object 1075, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/Save_Error.bin is a file, 4 data chunks written -Object 1076, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/Battery-E.bin is a file, 1 data chunks written -Object 1077, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/finger.bin is a file, 2 data chunks written -Object 1078, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/finger2.bin is a file, 2 data chunks written -Object 1079, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/wathch.bin is a file, 4 data chunks written -Object 1080, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/Battery-F.bin is a file, 1 data chunks written -Object 1081, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/Save_Right.bin is a file, 4 data chunks written -Object 1082, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Save_Ele/SaveEle.bin is a file, 3 data chunks written -Object 1083, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_09.bin is a file, 7 data chunks written -Object 1084, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_18.bin is a file, 4 data chunks written -Object 1085, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_07.bin is a file, 4 data chunks written -Object 1086, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE_07.bin is a file, 11 data chunks written -Object 1087, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_28.bin is a file, 4 data chunks written -Object 1088, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HarmonyOS_Sans_Naskh_Arabic_Light.ttf is a file, 60 data chunks written -Object 1089, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/B024_010.bin is a file, 40 data chunks written -Object 1090, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/RING_CLOCK.bin is a file, 8 data chunks written -Object 1091, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_IMAGE.bin is a file, 6 data chunks written -Object 1092, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_22.bin is a file, 11 data chunks written -Object 1093, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_08.bin is a file, 4 data chunks written -Object 1094, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLUETOOTH_HINTS.bin is a file, 204 data chunks written -Object 1095, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_BUTTON.bin is a file, 4 data chunks written -Object 1096, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM__Reboot.bin is a file, 72 data chunks written -Object 1097, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_05.bin is a file, 10 data chunks written -Object 1098, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/yellow.bin is a file, 26 data chunks written -Object 1099, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_27.bin is a file, 11 data chunks written -Object 1100, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CS_A094_051_8888_hfbc.bin is a file, 48 data chunks written -Object 1101, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TOGGLEBUTTON_ON.bin is a file, 2 data chunks written -Object 1102, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HANDUP.bin is a file, 3 data chunks written -Object 1103, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_13.bin is a file, 4 data chunks written -Object 1104, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_62.bin is a file, 11 data chunks written -Object 1105, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_46.bin is a file, 11 data chunks written -Object 1106, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_SETTING.bin is a file, 7 data chunks written -Object 1107, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery is a directory -Object 1108, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery/Battery_Nomoal.bin is a file, 1 data chunks written -Object 1109, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery/Icon.bin is a file, 1 data chunks written -Object 1110, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery/Battery-E.bin is a file, 1 data chunks written -Object 1111, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery/Battery_Save.bin is a file, 1 data chunks written -Object 1112, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Battery/Battery_Limit.bin is a file, 1 data chunks written -Object 1113, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_UI_SAMPLE.bin is a file, 3 data chunks written -Object 1114, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DISTANCES_IMAGE.bin is a file, 25 data chunks written -Object 1115, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/ANAEROBIC.bin is a file, 34 data chunks written -Object 1116, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_23.bin is a file, 10 data chunks written -Object 1117, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOODOXYGEN_VIEW.bin is a file, 204 data chunks written -Object 1118, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/stopwatch is a directory -Object 1119, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/stopwatch/STOPWATCH_LINE.bin is a file, 1 data chunks written -Object 1120, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/stopwatch/STOPWATH_RESET2.bin is a file, 4 data chunks written -Object 1121, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/stopwatch/STOPWATH_RESET1.bin is a file, 4 data chunks written -Object 1122, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/stopwatch/STOPWATCH_MARK.bin is a file, 4 data chunks written -Object 1123, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_53.bin is a file, 11 data chunks written -Object 1124, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/breath.bin is a file, 38 data chunks written -Object 1125, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training is a directory -Object 1126, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/arrows.bin is a file, 1 data chunks written -Object 1127, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/icon.bin is a file, 1 data chunks written -Object 1128, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/riding-big.bin is a file, 3 data chunks written -Object 1129, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/sport-pause.bin is a file, 4 data chunks written -Object 1130, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/sport-strength.bin is a file, 2 data chunks written -Object 1131, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/More.bin is a file, 7 data chunks written -Object 1132, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/step.bin is a file, 1 data chunks written -Object 1133, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/calories.bin is a file, 1 data chunks written -Object 1134, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/bubble.bin is a file, 2 data chunks written -Object 1135, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/progress.bin is a file, 59 data chunks written -Object 1136, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Fitness.bin is a file, 1 data chunks written -Object 1137, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Swimming.bin is a file, 1 data chunks written -Object 1138, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/riding.bin is a file, 1 data chunks written -Object 1139, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Ball.bin is a file, 1 data chunks written -Object 1140, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/buttonok.bin is a file, 16 data chunks written -Object 1141, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Line 4.bin is a file, 1 data chunks written -Object 1142, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Waking-one.bin is a file, 7 data chunks written -Object 1143, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/mileage_30.bin is a file, 1 data chunks written -Object 1144, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/sport-stop.bin is a file, 4 data chunks written -Object 1145, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/mountaineering-big.bin is a file, 3 data chunks written -Object 1146, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/heartrate_2.bin is a file, 1 data chunks written -Object 1147, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Ice.bin is a file, 1 data chunks written -Object 1148, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/time.bin is a file, 1 data chunks written -Object 1149, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/running-big.bin is a file, 2 data chunks written -Object 1150, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Dance.bin is a file, 1 data chunks written -Object 1151, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Go.bin is a file, 14 data chunks written -Object 1152, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/jumprope.bin is a file, 1 data chunks written -Object 1153, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Line 2.bin is a file, 1 data chunks written -Object 1154, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/green.bin is a file, 1 data chunks written -Object 1155, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win is a directory -Object 1156, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/14.bin is a file, 5 data chunks written -Object 1157, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/64.bin is a file, 5 data chunks written -Object 1158, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/22.bin is a file, 5 data chunks written -Object 1159, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/15.bin is a file, 5 data chunks written -Object 1160, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/27.bin is a file, 5 data chunks written -Object 1161, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/4.bin is a file, 5 data chunks written -Object 1162, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/77.bin is a file, 5 data chunks written -Object 1163, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/53.bin is a file, 5 data chunks written -Object 1164, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/92.bin is a file, 5 data chunks written -Object 1165, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/89.bin is a file, 5 data chunks written -Object 1166, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/43.bin is a file, 5 data chunks written -Object 1167, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/11.bin is a file, 5 data chunks written -Object 1168, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/76.bin is a file, 5 data chunks written -Object 1169, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/82.bin is a file, 5 data chunks written -Object 1170, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/36.bin is a file, 5 data chunks written -Object 1171, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/72.bin is a file, 5 data chunks written -Object 1172, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/5.bin is a file, 5 data chunks written -Object 1173, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/40.bin is a file, 5 data chunks written -Object 1174, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/73.bin is a file, 5 data chunks written -Object 1175, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/45.bin is a file, 5 data chunks written -Object 1176, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/37.bin is a file, 5 data chunks written -Object 1177, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/70.bin is a file, 5 data chunks written -Object 1178, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/80.bin is a file, 5 data chunks written -Object 1179, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/29.bin is a file, 5 data chunks written -Object 1180, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/1.bin is a file, 5 data chunks written -Object 1181, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/8.bin is a file, 5 data chunks written -Object 1182, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/3.bin is a file, 5 data chunks written -Object 1183, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/48.bin is a file, 5 data chunks written -Object 1184, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/10.bin is a file, 5 data chunks written -Object 1185, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/87.bin is a file, 5 data chunks written -Object 1186, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/13.bin is a file, 5 data chunks written -Object 1187, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/6.bin is a file, 5 data chunks written -Object 1188, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/41.bin is a file, 5 data chunks written -Object 1189, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/23.bin is a file, 5 data chunks written -Object 1190, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/32.bin is a file, 5 data chunks written -Object 1191, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/57.bin is a file, 5 data chunks written -Object 1192, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/75.bin is a file, 5 data chunks written -Object 1193, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/62.bin is a file, 5 data chunks written -Object 1194, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/55.bin is a file, 5 data chunks written -Object 1195, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/67.bin is a file, 5 data chunks written -Object 1196, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/16.bin is a file, 5 data chunks written -Object 1197, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/9.bin is a file, 5 data chunks written -Object 1198, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/90.bin is a file, 5 data chunks written -Object 1199, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/52.bin is a file, 5 data chunks written -Object 1200, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/71.bin is a file, 5 data chunks written -Object 1201, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/69.bin is a file, 5 data chunks written -Object 1202, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/18.bin is a file, 5 data chunks written -Object 1203, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/30.bin is a file, 5 data chunks written -Object 1204, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/26.bin is a file, 5 data chunks written -Object 1205, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/66.bin is a file, 5 data chunks written -Object 1206, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/93.bin is a file, 5 data chunks written -Object 1207, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/58.bin is a file, 5 data chunks written -Object 1208, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/35.bin is a file, 5 data chunks written -Object 1209, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/20.bin is a file, 5 data chunks written -Object 1210, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/44.bin is a file, 5 data chunks written -Object 1211, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/79.bin is a file, 5 data chunks written -Object 1212, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/60.bin is a file, 5 data chunks written -Object 1213, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/56.bin is a file, 5 data chunks written -Object 1214, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/31.bin is a file, 5 data chunks written -Object 1215, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/47.bin is a file, 5 data chunks written -Object 1216, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/94.bin is a file, 5 data chunks written -Object 1217, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/59.bin is a file, 5 data chunks written -Object 1218, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/24.bin is a file, 5 data chunks written -Object 1219, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/86.bin is a file, 5 data chunks written -Object 1220, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/46.bin is a file, 5 data chunks written -Object 1221, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/38.bin is a file, 5 data chunks written -Object 1222, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/50.bin is a file, 5 data chunks written -Object 1223, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/33.bin is a file, 5 data chunks written -Object 1224, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/34.bin is a file, 5 data chunks written -Object 1225, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/51.bin is a file, 5 data chunks written -Object 1226, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/88.bin is a file, 5 data chunks written -Object 1227, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/2.bin is a file, 5 data chunks written -Object 1228, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/42.bin is a file, 5 data chunks written -Object 1229, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/7.bin is a file, 5 data chunks written -Object 1230, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/85.bin is a file, 5 data chunks written -Object 1231, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/21.bin is a file, 5 data chunks written -Object 1232, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/17.bin is a file, 5 data chunks written -Object 1233, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/81.bin is a file, 5 data chunks written -Object 1234, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/63.bin is a file, 5 data chunks written -Object 1235, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/28.bin is a file, 5 data chunks written -Object 1236, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/83.bin is a file, 5 data chunks written -Object 1237, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/19.bin is a file, 5 data chunks written -Object 1238, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/74.bin is a file, 5 data chunks written -Object 1239, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/61.bin is a file, 5 data chunks written -Object 1240, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/65.bin is a file, 5 data chunks written -Object 1241, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/91.bin is a file, 5 data chunks written -Object 1242, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/84.bin is a file, 5 data chunks written -Object 1243, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/25.bin is a file, 5 data chunks written -Object 1244, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/68.bin is a file, 5 data chunks written -Object 1245, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/78.bin is a file, 5 data chunks written -Object 1246, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/49.bin is a file, 5 data chunks written -Object 1247, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/12.bin is a file, 5 data chunks written -Object 1248, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/39.bin is a file, 5 data chunks written -Object 1249, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win/54.bin is a file, 5 data chunks written -Object 1250, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Buttonground2.bin is a file, 7 data chunks written -Object 1251, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/path.bin is a file, 22 data chunks written -Object 1252, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/running.bin is a file, 1 data chunks written -Object 1253, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/data_point.bin is a file, 1 data chunks written -Object 1254, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/GPS_1.bin is a file, 1 data chunks written -Object 1255, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/pingpong.bin is a file, 1 data chunks written -Object 1256, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Line.bin is a file, 3 data chunks written -Object 1257, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/inco_up_40.bin is a file, 1 data chunks written -Object 1258, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/orange.bin is a file, 1 data chunks written -Object 1259, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Limit.bin is a file, 1 data chunks written -Object 1260, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/step_30.bin is a file, 1 data chunks written -Object 1261, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Running-one.bin is a file, 7 data chunks written -Object 1262, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/yes.bin is a file, 4 data chunks written -Object 1263, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/black_piont.bin is a file, 1 data chunks written -Object 1264, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/walking.bin is a file, 1 data chunks written -Object 1265, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Line 1.bin is a file, 1 data chunks written -Object 1266, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/bubble_piont.bin is a file, 1 data chunks written -Object 1267, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/control_point.bin is a file, 1 data chunks written -Object 1268, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/sport-continue.bin is a file, 4 data chunks written -Object 1269, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/heartrate.bin is a file, 1 data chunks written -Object 1270, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/heartrate_30.bin is a file, 1 data chunks written -Object 1271, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/pingpong-big.bin is a file, 3 data chunks written -Object 1272, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/heartrate_1.bin is a file, 1 data chunks written -Object 1273, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/jumprope-big.bin is a file, 3 data chunks written -Object 1274, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Line 3.bin is a file, 1 data chunks written -Object 1275, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/riding-big2.bin is a file, 2 data chunks written -Object 1276, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/MoreView.bin is a file, 72 data chunks written -Object 1277, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Go_2.bin is a file, 14 data chunks written -Object 1278, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/yellow.bin is a file, 1 data chunks written -Object 1279, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/back.bin is a file, 3 data chunks written -Object 1280, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/mountaineering.bin is a file, 1 data chunks written -Object 1281, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/bule.bin is a file, 1 data chunks written -Object 1282, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/warning.bin is a file, 3 data chunks written -Object 1283, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/win.bin is a file, 5 data chunks written -Object 1284, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/no.bin is a file, 4 data chunks written -Object 1285, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/GPS_2.bin is a file, 1 data chunks written -Object 1286, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/note.bin is a file, 1 data chunks written -Object 1287, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/calories_30.bin is a file, 1 data chunks written -Object 1288, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Other.bin is a file, 1 data chunks written -Object 1289, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Walking_54.bin is a file, 2 data chunks written -Object 1290, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/walking-big.bin is a file, 2 data chunks written -Object 1291, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/mileage.bin is a file, 1 data chunks written -Object 1292, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Rest.bin is a file, 1 data chunks written -Object 1293, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/Bouttonground.bin is a file, 7 data chunks written -Object 1294, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Training/inco_up.bin is a file, 1 data chunks written -Object 1295, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/blue_argb8888.bin is a file, 18 data chunks written -Object 1296, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_61.bin is a file, 11 data chunks written -Object 1297, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_18.bin is a file, 11 data chunks written -Object 1298, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_11.bin is a file, 10 data chunks written -Object 1299, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_17.bin is a file, 9 data chunks written -Object 1300, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_SHOUTDOWM.bin is a file, 13 data chunks written -Object 1301, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_11.bin is a file, 11 data chunks written -Object 1302, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_06.bin is a file, 10 data chunks written -Object 1303, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_55.bin is a file, 11 data chunks written -Object 1304, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_28.bin is a file, 11 data chunks written -Object 1305, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_26.bin is a file, 4 data chunks written -Object 1306, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/heart rate.bin is a file, 3 data chunks written -Object 1307, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SYSTEM_ShoutDown.bin is a file, 72 data chunks written -Object 1308, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OPTIONS_BOX3.bin is a file, 28 data chunks written -Object 1309, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_30.bin is a file, 4 data chunks written -Object 1310, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/A094_051_565.bin is a file, 49 data chunks written -Object 1311, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/A094_051_888.bin is a file, 73 data chunks written -Object 1312, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_48.bin is a file, 11 data chunks written -Object 1313, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_08.bin is a file, 10 data chunks written -Object 1314, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_07.bin is a file, 10 data chunks written -Object 1315, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/AEROBIC.bin is a file, 34 data chunks written -Object 1316, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime is a directory -Object 1317, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Vector2.bin is a file, 3 data chunks written -Object 1318, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/up.bin is a file, 1 data chunks written -Object 1319, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/room.bin is a file, 3 data chunks written -Object 1320, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Battery-E.bin is a file, 1 data chunks written -Object 1321, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Vector.bin is a file, 1 data chunks written -Object 1322, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/finger.bin is a file, 2 data chunks written -Object 1323, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/button.bin is a file, 7 data chunks written -Object 1324, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Line 2.bin is a file, 1 data chunks written -Object 1325, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/finger2.bin is a file, 2 data chunks written -Object 1326, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/wathch.bin is a file, 4 data chunks written -Object 1327, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Line 1.bin is a file, 1 data chunks written -Object 1328, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Battery-F.bin is a file, 1 data chunks written -Object 1329, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Line 3.bin is a file, 1 data chunks written -Object 1330, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/quan.bin is a file, 1 data chunks written -Object 1331, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SleepTime/Ellipse 185.bin is a file, 48 data chunks written -Object 1332, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COUNTDOWN_IMAGE_24.bin is a file, 10 data chunks written -Object 1333, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_03.bin is a file, 4 data chunks written -Object 1334, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CS_A094_051_565_abypass.bin is a file, 24 data chunks written -Object 1335, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_68.bin is a file, 11 data chunks written -Object 1336, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_29.bin is a file, 4 data chunks written -Object 1337, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/HEARTBEAT_IMAGE_18.bin is a file, 9 data chunks written -Object 1338, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_LIT_TIP.bin is a file, 1 data chunks written -Object 1339, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/APPLIST_WALK.bin is a file, 7 data chunks written -Object 1340, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass is a directory -Object 1341, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/compass.bin is a file, 679 data chunks written -Object 1342, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/compass/file.txt is a file, 0 data chunks written -Object 1343, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial is a directory -Object 1344, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/DialDog.bin is a file, 72 data chunks written -Object 1345, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/second.bin is a file, 3 data chunks written -Object 1346, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/Vector.bin is a file, 3 data chunks written -Object 1347, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/Malio.bin is a file, 23 data chunks written -Object 1348, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/setup.bin is a file, 4 data chunks written -Object 1349, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/KUMI.bin is a file, 23 data chunks written -Object 1350, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/minute.bin is a file, 2 data chunks written -Object 1351, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/dog.bin is a file, 23 data chunks written -Object 1352, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/hour.bin is a file, 2 data chunks written -Object 1353, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/dogmalio.bin is a file, 72 data chunks written -Object 1354, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/Dial/Diallogo.bin is a file, 72 data chunks written -Object 1355, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/ALARM_ADD_BACKGROUND.bin is a file, 13 data chunks written -Object 1356, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/VOICE_ASSISTANT_41.bin is a file, 11 data chunks written -Object 1357, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TRUE_ADD.bin is a file, 9 data chunks written -Object 1358, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/lele.jpg is a file, 2 data chunks written -Object 1359, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/TEMP_DELETE.bin is a file, 3 data chunks written -Object 1360, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/phonebook.bin is a file, 3 data chunks written -Object 1361, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/BLOOD_FLOW_IMAGE_09.bin is a file, 4 data chunks written -Object 1362, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/COMPASS.bin is a file, 204 data chunks written -Object 1363, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music is a directory -Object 1364, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music/mp3_48k_caiqing.mp3 is a file, 464 data chunks written -Object 1365, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music/lan_jing.mp3 is a file, 3335 data chunks written -Object 1366, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music/alarm.mp3 is a file, 674 data chunks written -Object 1367, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music/one.mp3 is a file, 2143 data chunks written -Object 1368, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/music/FolkSongToThePartyDZ.mp3 is a file, 2483 data chunks written -Object 1369, /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/js is a directory -Operation complete. -2226 objects in 33 directories -31251 NAND pages -/home/snicker/hiwatch/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin 1 2 0xcc0000 -/home/snicker/hiwatch/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/update /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin 1 2 0x1980000 -/home/snicker/hiwatch/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/music /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin 1 2 0x2640000 -/home/snicker/hiwatch/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user /home/snicker/hiwatch/code/sdk/build/config/target_config/brandy/mk_fs_image/file_tmp.bin 1 2 -make yaffs image file over! -fs image success! +brandy-native-js takes 23.238997 s packet ing... -['/usr/bin/python3', '/home/snicker/hiwatch/code/sdk/tools/pkg/packet.py', 'brandy', 'brandy-native-js'] +['/usr/bin/python', '/home/snicker/hiwatch/code/sdk/tools/pkg/packet.py', 'brandy', 'brandy-native-js'] Build params success! build nv bin success!! ssb_path: /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.bin -['/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/partition_table.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/bt.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_overlay.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/nv_bin/brandy_all_nv.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/file.bin'] -[1879048192, 1879371776, 1882456064, 1879375872, 1879638016, 1880227840, 1881145344, 1887408128, 4294967295] -[131072, 4096, 4931584, 262144, 589824, 917504, 1310720, 16384, 4294967295] -[105060, 1024, 3959476, 189068, 424360, 348248, 1282060, 8192, 107363520] -[0, 100, 18, 100, 20, 22, 26, 100, 101] +['/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-ssb/ssb.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/partition_table.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js-r/recovery.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/bt.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin', '/home/snicker/hiwatch/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_overlay.bin', '/home/snicker/hiwatch/code/sdk/output/brandy/nv_bin/brandy_all_nv.bin'] +[1879048192, 1879371776, 1881866240, 1879375872, 1879638016, 1880096768, 1880555520, 1887408128] +[131072, 4096, 5541888, 262144, 458752, 458752, 1310720, 16384] +[74172, 1024, 4041116, 237292, 420744, 349776, 1281704, 4096] +[0, 100, 18, 100, 20, 22, 26, 100] packet success! -output_path /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js -Start pack target pack_brandy_native_js -pack_target_path /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js -current_target_file /home/snicker/hiwatch/code/sdk/output/currentbuild.txt +Start pack target brandy-native-js copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.elf -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js/application.elf copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.lst -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js/application.lst -copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/file.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js/file.bin -copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/file.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/file.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js/application.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.bin -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/application.bin copy /home/snicker/hiwatch/code/sdk/output/brandy/acore/brandy-native-js/application.map -> /home/snicker/hiwatch/code/sdk/output/package/brandy/pack_brandy_native_js/brandy-native-js/application.map do release copy -release to /home/snicker/hiwatch/release/pack_brandy_native_js/release/20240120_111202/pack_brandy_native_js_release_20240120_111202_snicker.fwpkg -pack_brandy_native_js_release_20240120_111202_snicker.fwpkg -branch name m_master -commit b8def62a81707423bf66aa8be0aee05207508ff1 -no source changed -build done at 20240120_111236 +release to /home/snicker/hiwatch/release/pack_brandy_native_js/release/20240503_001315/pack_brandy_native_js_release_20240503_001315_snicker.fwpkg +pack_brandy_native_js_release_20240503_001315_snicker.fwpkg +branch name master +commit d0f1e562f64d353f43542d94743aff23ac574565 +source changed +M build.log M code/sdk/application/audio/vendor/CMakeLists.txt M code/sdk/application/brandy/brandy_recovery/main.c M code/sdk/application/brandy/brandy_standard/chip_init.c M code/sdk/application/brandy/brandy_standard/input_app.c M code/sdk/application/wearable/nativeabilityfwk/CMakeLists.txt M code/sdk/application/wearable/nativeabilityfwk/include/Ability.h M code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h M code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h M code/sdk/application/wearable/nativeabilityfwk/include/TransitionCallback.h M code/sdk/application/wearable/nativeabilityfwk/include/TransitionManager.h M code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp M code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp M code/sdk/application/wearable/nativeabilityfwk/src/TransitionManager.cpp M code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.cpp M code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.h M code/sdk/application/wearable/nativeapp/CMakeLists.txt M code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h M code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h M code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h M code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainPresenter.h M code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainView.h M code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp M code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp M code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityModel.h M code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityWeekView.h M code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityWeekView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPopUpPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmSetWeekView.h M code/sdk/application/wearable/nativeapp/nativeui/alarm/include/MainAlarmView.h M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmCloseRingView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmConfigView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmMaxClock.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmRingView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/include/AlarmClockManage.h M code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/src/AlarmClockManage.cpp M code/sdk/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBarCode.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBind.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindAni.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindRes.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayExitBind.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayHelp.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListAdapter.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListItemView.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayMainView.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPayCode.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayRefreshBindCode.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipaySetting.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayGetTransList.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransAni.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransCode.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransEnable.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListAdapter.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListItemView.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransRes.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransTips.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbind.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbindFinish.h M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBarCode.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBind.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindAni.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindRes.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayExitBind.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayHelp.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayList/AlipayListView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayMainView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPayCode.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipaySetting.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbind.cpp M code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbindFinish.cpp M code/sdk/application/wearable/nativeapp/nativeui/applist/include/AppItemView.h M code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistAdapter.h M code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h M code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h M code/sdk/application/wearable/nativeapp/nativeui/applist/src/AppItemView.cpp M code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenModel.h M code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenView.h M code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothItemView.h M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothModel.h M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/MainBluetoothView.h M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/MainBluetoothView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsConnFailMessageView.cpp M code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsSuccMessageView.cpp M code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerItemView.h M code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h M code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogView.h M code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerItemView.cpp M code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogView.cpp M code/sdk/application/wearable/nativeapp/nativeui/clock/include/MainClockView.h M code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp M code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassCalibrationView.h M code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassControlView.h M code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassModel.h M code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassView.h M code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassView.h M code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassCalibrationView.cpp M code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp M code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp M code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/include/ConnectPhonePresenter.h M code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectOpenView.cpp M code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhoneView.cpp M code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartModel.h M code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartRateView.h M code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartRateView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/CustomizationView.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkModel.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkMotionView.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFifth.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFirst.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFourth.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageSecond.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageThird.h M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkView.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFifth.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFirst.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFourth.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageSecond.cpp M code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageThird.cpp M code/sdk/application/wearable/nativeapp/nativeui/key/include/KeyInputListener.h M code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/include/AppGroupView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/HealthModel.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/UiServersMsg.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcLabelView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcProgressView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBaseModel.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialDigitalImgView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialLabelView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelHeartRate.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelPower.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelSteps.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelTime.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialOptionImgView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialRotateImgView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialSequenceImgView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialStaticImgView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialView.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h M code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/ModelDialDataFactory.h M code/sdk/application/wearable/nativeapp/nativeui/main/src/HealthModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelSteps.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelTime.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/ModelDialDataFactory.cpp M code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp D code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.h D code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinTypes.h M code/sdk/application/wearable/nativeapp/nativeui/makephone/include/MainCallingPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallerDisplayView.cpp M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallingView.cpp M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/DialingScreenView.cpp M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingView.cpp M code/sdk/application/wearable/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp M code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h M code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h M code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp M code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneAudio.h M code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h M code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp M code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp M code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h M code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h M code/sdk/application/wearable/nativeapp/nativeui/player/src/BluetoothView.cpp M code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersCaseListAdapter.cpp M code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp M code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/include/RebootModel.h M code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootDeviceView.cpp M code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootView.cpp M code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/ShutdownDeviceView.cpp M code/sdk/application/wearable/nativeapp/nativeui/rtcservice/src/RtcService.cpp M code/sdk/application/wearable/nativeapp/nativeui/screennotify/include/ui_screennotify.h M code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp M code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h M code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingAdapter.h M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItemView.h M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingView.h M code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp M code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp M code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempClickMea.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempContinueWarn.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitInter.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitPrompt.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempInitInter.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempJoinStudy.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempLittleTip.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMainView.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeaProcess.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeasure.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPresenter.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPromptWear.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempRemindWear.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempReport.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempStudyAbout.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempWarn.h M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempClickMea.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempContinueWarn.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitInter.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitPrompt.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempInitInter.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempLittleTip.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMainView.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeaProcess.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeasure.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPromptWear.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempRemindWear.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempReport.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp M code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempWarn.cpp M code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h M code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISamplePresenter.h M code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h M code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp M code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp M code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h M code/sdk/application/wearable/nativeapp/nativeui/uiservice/src/ui_service.cpp M code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c M code/sdk/application/wearable/service/msg_center/CMakeLists.txt M code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a M code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a M code/sdk/application/wearable/service/msg_center/include/msg_center.h M code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h M code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h M code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h M code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h M code/sdk/application/wearable/service/msg_center/include/vendor_app/baidu_app.h M code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp M code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp M code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp M code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp M code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp M code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp M code/sdk/application/wearable/service/power_manager/include/power_display_service.h M code/sdk/application/wearable/service/power_manager/src/actions/display_action.c M code/sdk/application/wearable/service/power_manager/src/filters/gui_event_filter.c M code/sdk/application/wearable/service/power_manager/src/power_display_service.c M code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp M code/sdk/bootloader/flashboot/brandy/main.c M code/sdk/bootloader/flashboot/brandy/nandflash/hal_nandflash.c M code/sdk/bootloader/flashboot/brandy/nandflash/nandflash.c M code/sdk/bootloader/flashboot/brandy/nandflash/nandflash_qspi.c M code/sdk/build/config/target_config/brandy/config.py M code/sdk/build/config/target_config/common_config.py M code/sdk/drivers/boards/brandy_evb/linker/standard/acore.prelds M code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config.h M code/sdk/drivers/boards/brandy_evb/memory_config/include/psram_16.h M code/sdk/drivers/chips/brandy/porting/include/systick_porting.h M code/sdk/drivers/chips/brandy/porting/security/efuse/efuse_porting.c M code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c M code/sdk/drivers/drivers/driver/audio/source/core/common/share_mem/core_msg.c M code/sdk/drivers/drivers/driver/audio/source/include/sea_struct.h M code/sdk/drivers/drivers/driver/i2c/i2c.c M code/sdk/drivers/drivers/driver/nand_flash/nand/hal_nandflash.c M code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash.c M code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c M code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_qspi.c M code/sdk/drivers/drivers/driver/qspi_display/qspi_display.c M code/sdk/drivers/drivers/driver/rtc_unified/rtc.c M code/sdk/drivers/drivers/driver/systick/systick.c M code/sdk/drivers/drivers/driver/touch/tma525b_touch/tma525b_ctrl.c M code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.c M code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.h M code/sdk/drivers/drivers/hal/ipc/hal_ipc_old/hal_ipc.h M code/sdk/drivers/drivers/hal/security/efuse/v100/hal_efuse_v100.c M code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h M code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h M code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h M code/sdk/middleware/chips/brandy/exception/exception.h M code/sdk/middleware/chips/brandy/exception/exception_riscv.c M code/sdk/middleware/chips/brandy/nv/nv_config/cfg/acore/app.json M code/sdk/middleware/chips/brandy/pm/include/pm_definition.h M code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c M code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_lp_stub.c M code/sdk/middleware/services/gpu/api/jpeg/src/soc_jpeg_api.c M code/sdk/middleware/services/gpu/api/vau/draw/vau_draw.c M code/sdk/middleware/services/gpu/drv/dpu/intf/drv_dpu_intf.c M code/sdk/middleware/services/gpu/drv/dpu/layer/dpu_layer.c M code/sdk/middleware/services/gpu/drv/gmmu/intf/drv_gmmu_intf.c M code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.c M code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.h M code/sdk/middleware/services/gpu/drv/jpeg/intf/drv_jpeg_intf.c M code/sdk/middleware/services/gpu/drv/vau/intf/drv_vau_intf.c M code/sdk/middleware/services/gui/hal/common/include/graphic_hardware_config.h M code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a M code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a M code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a M code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a M code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a M code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c M code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a M code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a M code/sdk/middleware/services/gui/uikit/CMakeLists.txt M code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a M code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a M code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a M code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h M code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h M code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h M code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_barcode.h M code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_card_page.h M code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h M code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h M code/sdk/middleware/services/gui/uikit/proprietary/include/service/graphic_service_wrapper.h M code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/low_power_manager.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/ui_card_container.h M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.h M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h M code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h M code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp M code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h M code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h M code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp M code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp M code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp M code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/ui_test_group.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/root_view.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_chart.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_animator.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp M code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/pointer_input_device.h M code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h M code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h M code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h M code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h M code/sdk/middleware/services/gui/uikit/utils/frameworks/geometry2d.cpp M code/sdk/middleware/services/gui/uikit/utils/frameworks/graphic_math.cpp M code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h M code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h M code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp M code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c M code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c M code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c M code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiocommon/audio_base_type.h M code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiomanager/cpp/audio_manager.h M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/include/player_define.h M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.h M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.cpp M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.h M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.cpp M code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.h M code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp M code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp M code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp M code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h M code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp M code/sdk/middleware/utils/dfx/dfx_reboot/cpu_utils/private/cpu_utils.c M code/sdk/middleware/utils/dfx/log/log.c M code/sdk/middleware/utils/dfx/log/log_oml_exception.c M code/sdk/middleware/utils/dfx/log_reader/private/log_uart.c M code/sdk/open_source/openharmony/CMakeLists.txt M code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a M code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_bc.h M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_js.h M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/keys.h M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h M code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h M code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/CMakeLists.txt M code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a M code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a M code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/gt_bundle_manager_service.h M code/sdk/open_source/openharmony/third_party/jerryscript/CMakeLists.txt M code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a M code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Config_Full.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Defaults.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_stdlib.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_string.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.impl.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/byte-code.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/common.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/config.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/debugger.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-alloc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-array-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-arraybuffer-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-boolean-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-iterator-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-global.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-defines.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-undefs.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-internal-routines-template.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-iterator-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-json.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-iterator-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-math.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-iterator-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-iterator-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-type-error-thrower.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-helpers.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype-template.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-template.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror-prototype.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-comparison.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-container-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-conversion.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-dataview-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-eval.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-exceptions.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-function-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-gc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-globals.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-helpers.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-init-finalize.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-iterator-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-jobqueue.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lcache.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lex-env.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-literal-storage.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-module.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-arithmetic.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-arguments.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-general.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-promise-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-property-hashmap.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-reference.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-regexp-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-string-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-symbol-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-try-catch-macro.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-typedarray-object.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/generate-bytecode.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jcontext.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerry-snapshot.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-compiler.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-core.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger-transport.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-port.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-snapshot.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem-allocator-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-bit-fields.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-libc-includes.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-types.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-lexer.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-limits.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-char-helpers.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-globals.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-strings.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-conversions.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-ranges.inc.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/opcodes.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-bytecode.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-compiler.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-parser.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-defines.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-stack.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/arg-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/debugger-sha1.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/handle-scope-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.impl.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.impl.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/debugger.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handle-scope.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handler.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/module.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jext-common.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/jerry-libm-internal.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/math.h D code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryport/jerryscript-port-default.h M code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin M code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin M code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin M code/sdk/tools/pkg/bin/brandy/ssb.bin ?? SDK_1.1.10.602_0425patch.txt ?? autobuild.sh ?? code/sdk/application/audio/vendor/aw88166/aw88166.c ?? code/sdk/application/audio/vendor/aw88166/aw883xx.c ?? code/sdk/application/audio/vendor/aw88166/aw883xx_calib.c ?? code/sdk/application/audio/vendor/aw88166/aw883xx_device.c ?? code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/16bit/aw883xx_acf.bin ?? code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/32bit/aw883xx_acf.bin ?? code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/16bit/aw883xx_acf.bin ?? code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/32bit/aw883xx_acf.bin ?? code/sdk/application/audio/vendor/aw88166/product_init_files/aw88166/aw883xx_pid_2066_init.c ?? code/sdk/application/wearable/nativeabilityfwk/include/TransitionType.h ?? code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.cpp ?? code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.h ?? code/sdk/application/wearable/nativeapp/nativeui/add_card/ ?? code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h ?? code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinTypes.h ?? code/sdk/application/wearable/nativeapp/nativeui/main/include/MainModel.h ?? code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialKaleidoscopeView.h ?? code/sdk/application/wearable/nativeapp/nativeui/main/src/MainModel.cpp ?? code/sdk/application/wearable/nativeapp/nativeui/set_card/ ?? code/sdk/application/wearable/nativeapp/nativeui/set_desktop/ ?? code/sdk/application/wearable/nativeapp/nativeui/set_dial/ ?? code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_component.h ?? code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_location.h ?? code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_msg_center.h ?? code/sdk/application/wearable/service/msg_center/libs/ ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ACTIVITY.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ADD.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_COMPASS.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_DEL.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_HEART.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_PLAYER.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DIAL_CLOCK.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_DESKTOP.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_BG.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_HEXAGONS.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_LIST.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/hexagons.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/kaleidoscope.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/planet.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rabbit454.bin ?? code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rainbow.bin ?? code/sdk/interim_binary/brandy/libs/audio/ ?? code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a ?? code/sdk/interim_binary/brandy/libs/gpu/ ?? code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a ?? code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_custom_hexagons_list.h ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h ?? code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_map_view.h ?? code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp ?? code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/map_svg_parser.h ?? code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/triangular_plane.h ?? code/sdk/middleware/services/gui/uikit/res/hexagons.bin ?? code/sdk/middleware/services/gui/uikit/res/kaleidoscope_dial.bin ?? code/sdk/middleware/services/gui/uikit/res/map.bin ?? code/sdk/middleware/services/gui/uikit/res/panda_first.bin ?? code/sdk/middleware/services/gui/uikit/res/regular_hexagon.bin ?? code/sdk/middleware/services/gui/uikit/res/regular_hexagon_inverse.bin ?? code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ ?? code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ ?? code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ ?? code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.cpp ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.h ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/ ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/ ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.cpp ?? code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.h ?? code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/bundlems/ ?? code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/sign_mode.h ?? code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/ ?? code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-ext/ ?? code/sdk/open_source/openharmony/utils/native/lite/js/ ?? code/sdk/output/ ?? tools/ +build done at 20240503_001359 diff --git a/code/sdk/application/audio/vendor/CMakeLists.txt b/code/sdk/application/audio/vendor/CMakeLists.txt index 47dc090b0..e3152c2ca 100644 --- a/code/sdk/application/audio/vendor/CMakeLists.txt +++ b/code/sdk/application/audio/vendor/CMakeLists.txt @@ -54,3 +54,4 @@ set(COMPONENT_DEF ) #=================================================================================== include(${SAP_TOP_DIR}/build/cmake/audio_common.cmake) +install_sdk(${CMAKE_CURRENT_SOURCE_DIR}/aw88166 "*") diff --git a/code/sdk/application/audio/vendor/aw88166/aw88166.c b/code/sdk/application/audio/vendor/aw88166/aw88166.c new file mode 100644 index 000000000..d25e8db7f --- /dev/null +++ b/code/sdk/application/audio/vendor/aw88166/aw88166.c @@ -0,0 +1,278 @@ +/* + * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. + * Description: source file for aw88166 driver + */ + +#include +#include "soc_osal.h" +#include "audio_debug.h" +#include "gpio.h" +#include "hal_gpio.h" +#include "i2c.h" +#include "pinctrl.h" +#include "vendor_common.h" +#include "soc_uapi_vendor.h" + +#include "aw883xx_init.h" +#include "aw883xx.h" +#include "aw_params.h" + +static td_bool g_aw88166_i2c_inited = TD_FALSE; + +#define AW88166_PWR_ON_PIN S_MGPIO4 +#define AW88166_I2C_BUS_ID I2C_BUS_0 +#define AW88166_I2C_DEV_ADDR 0x34 + +static td_s32 aw_dev0_i2c_write_func(td_u16 dev_addr, td_u8 reg_addr, td_u8 *pdata, td_u16 len) +{ + td_s32 ret; + i2c_data_t data; + const td_u8 reg_addr_len = sizeof(reg_addr); /* data len of reg_addr */ + const td_u8 send_len = len + reg_addr_len; /* pdata bytes && reg_addr len */ + td_u8 *send_data = osal_kmalloc_align(send_len, 0, 8); /* 8 : Align up to 8 bytes */ + + if (send_data == TD_NULL) { + ret = -1; /* -1:FAILED ERR CODE */ + vendor_log_fun_err(malloc, ret); + return ret; + } + + /* pack reg addr & reg data */ + *send_data = reg_addr; /* reg_addr */ + ret = memcpy_s(send_data + reg_addr_len, (send_len - reg_addr_len), pdata, len); /* pdata */ + if (ret != EOK) { + vendor_log_fun_err(memcpy_s, ret); + goto out; + } + + data.send_buf = send_data; + data.send_len = send_len; + data.receive_buf = NULL; + data.receive_len = 0; + ret = (td_s32)uapi_i2c_master_write(AW88166_I2C_BUS_ID, dev_addr, &data); + if (ret != ERRCODE_SUCC) { + vendor_log_fun_err(uapi_i2c_master_write, ret); + goto out; + } + +out: + if (send_data != TD_NULL) { + osal_kfree(send_data); + } + return ret; +} + +static td_s32 aw_dev0_i2c_read_func(td_u16 dev_addr, td_u8 reg_addr, td_u8 *pdata, td_u16 len) +{ + td_s32 ret; + + i2c_data_t data; + + data.send_buf = ®_addr; + data.send_len = sizeof(reg_addr); + data.receive_buf = pdata; + data.receive_len = len; + ret = (td_s32)uapi_i2c_master_writeread(AW88166_I2C_BUS_ID, dev_addr, &data); + if (ret != ERRCODE_SUCC) { + vendor_log_fun_err(uapi_i2c_master_writeread, ret); + return ret; + } + + return AUDIO_SUCCESS; +} + +static td_void aw_dev0_reset_gpio_ctl(bool state) +{ + uapi_gpio_set_val(AW88166_PWR_ON_PIN, state); +} + +static td_void aw88166_pwr_on_pin_init(td_void) +{ + uapi_gpio_set_dir(AW88166_PWR_ON_PIN, GPIO_DIRECTION_OUTPUT); +} + +static td_s32 aw88166_i2c_init(td_void) +{ + td_s32 ret; + audio_func_enter(); + + /* init i2c */ + vendor_trace_log_u32(AW88166_I2C_BUS_ID); + ret = (td_s32)uapi_i2c_master_init(AW88166_I2C_BUS_ID, I2C_BAUDRATE, I2C_HIGH_SPEED_CODE); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(uapi_i2c_master_init, ret); + return ret; + } + + vendor_printf("aw88166 i2c init success\n"); + audio_func_exit(); + return AUDIO_SUCCESS; +} + +static td_s32 aw88166_i2c_deinit(td_void) +{ + td_s32 ret; + audio_func_enter(); + + /* deinit i2c */ + vendor_trace_log_u32(AW88166_I2C_BUS_ID); + ret = (td_s32)uapi_i2c_deinit(AW88166_I2C_BUS_ID); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(uapi_i2c_deinit, ret); + return ret; + } + + vendor_printf("aw88166 i2c deinit success\n"); + audio_func_exit(); + return AUDIO_SUCCESS; +} + +td_s32 aw883xx_pid_2066_dev_init(td_void *aw883xx); + +struct aw_init_info init_info[] = { + { + .dev = AW_DEV_0, + .i2c_addr = AW88166_I2C_DEV_ADDR, + .re_min = 2000, /* awinic:If the re_min(ohms) and re_max(ohms) are not set, the default value is used */ + .re_max = 39000, + .mix_chip_count = AW_DEV0_MIX_CHIP_NUM, + .prof_info = g_dev0_prof_info, + .i2c_read_func = aw_dev0_i2c_read_func, + .i2c_write_func = aw_dev0_i2c_write_func, + .reset_gpio_ctl = aw_dev0_reset_gpio_ctl, + .dev_init_ops = {aw883xx_pid_2066_dev_init}, + } +}; + +static td_s32 audio_aw88166_configuration(const uapi_vendor_codec_attr *attr) +{ + td_s32 ret; + + /* awinic:Control interface of dev0 */ + /* awinic:initialization */ + ret = aw883xx_smartpa_init((td_void *)&init_info[AW_DEV_0]); + if (ret != AUDIO_SUCCESS) { + vendor_printf("aw883xx_smartpa_init already init\n"); + } + /* awinic:set mode "Music", "aw_params.h" contains id information */ + ret = aw883xx_set_profile_byname(AW_DEV_0, "Music"); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw883xx_set_profile_byname, ret); + } + + vendor_unused(attr); + return ret; +} + +static td_s32 audio_aw88166_deconfiguration(td_void) +{ + /* awinic:Free the requested memory when PA is not used */ + aw883xx_smartpa_deinit(AW_DEV_0); + + return AUDIO_SUCCESS; +} + +td_s32 audio_aw88166_init(const uapi_vendor_codec_attr *attr) +{ + td_s32 ret; + + audio_func_enter(); + + aw88166_pwr_on_pin_init(); + + if (g_aw88166_i2c_inited != TD_TRUE) { + ret = aw88166_i2c_init(); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw88166_i2c_init, ret); + return ret; + } + g_aw88166_i2c_inited = TD_TRUE; + } else { + ret = 0; + } + + ret = audio_aw88166_configuration(attr); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(audio_aw88166_configuration, ret); + } + + return AUDIO_SUCCESS; +} + +td_s32 audio_aw88166_deinit(td_void) +{ + td_s32 ret; + audio_func_enter(); + + ret = audio_aw88166_deconfiguration(); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(audio_aw88166_deconfiguration, ret); + } + + if (g_aw88166_i2c_inited != TD_FALSE) { + ret = aw88166_i2c_deinit(); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw88166_i2c_deinit, ret); + return ret; + } + g_aw88166_i2c_inited = TD_FALSE; + } else { + ret = AUDIO_SUCCESS; + } + + audio_func_exit(); + return ret; +} + +td_s32 audio_aw88166_start(const uapi_vendor_codec_attr *attr) +{ + td_s32 ret; + + audio_func_enter(); + + /* awinic:The platform needs to output I2s first, and then ctl start */ + ret = aw883xx_ctrl_state(AW_DEV_0, AW_START); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw883xx_ctrl_state, ret); + } + + vendor_unused(attr); + return ret; +} + +td_s32 audio_aw88166_stop(td_void) +{ + td_s32 ret; + audio_func_enter(); + + /* awinic:The platform needs to control the stop first and then stop I2S */ + ret = aw883xx_ctrl_state(AW_DEV_0, AW_STOP); + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw883xx_ctrl_state, ret); + } + audio_func_exit(); + return ret; +} + +td_s32 audio_aw88166_set_aef_profile(uapi_snd_aef_profile aef_profile) +{ + td_s32 ret; + + audio_func_enter(); + + /* awinic:set mode "Receiver"/"Music", "aw_params.h" contains id information */ + if (aef_profile == UAPI_SND_AEF_PROFILE_VOIP) { + /* awinic:set mode "Receiver" */ + ret = aw883xx_set_profile_byname(AW_DEV_0, "Receiver"); + } else { + /* awinic:set mode "Music" */ + ret = aw883xx_set_profile_byname(AW_DEV_0, "Music"); + } + + if (ret != AUDIO_SUCCESS) { + vendor_log_fun_err(aw883xx_set_profile_byname, ret); + } + + audio_func_exit(); + return ret; +} diff --git a/code/sdk/application/audio/vendor/aw88166/aw883xx.c b/code/sdk/application/audio/vendor/aw88166/aw883xx.c new file mode 100644 index 000000000..3296182aa --- /dev/null +++ b/code/sdk/application/audio/vendor/aw88166/aw883xx.c @@ -0,0 +1,2047 @@ +/* +* aw883xx.c aw883xx codec driver +* +* Copyright (c) 2021 AWINIC Technology CO., LTD +* +* Author: +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ +#include +#include +#include +#include + +#include "aw883xx.h" +#include "aw883xx_base.h" +#include "aw883xx_device.h" +#include "aw883xx_init.h" +#include "aw883xx_calib.h" + +#define AW883XX_DRIVER_VERSION "v0.4.0" +#define AW883xx_I2C_NAME "aw883xx_smartpa" + +#define AW_READ_CHIPID_RETRIES 5 /* 5 times */ + +unsigned int g_aw883xx_dev_cnt = 0; +struct aw883xx *g_aw883xx[AW_DEV_MAX]; + +/****************************************************** + * + * aw883xx i2c write/read + * + ******************************************************/ +int aw883xx_i2c_writes(struct aw883xx *aw883xx, + uint8_t reg_addr, uint8_t *buf, uint16_t len) +{ + int ret = -1; + + ret = aw883xx->i2c_write_func(aw883xx->i2c_addr, reg_addr, buf, len); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error"); + } + return ret; +} + +static int aw883xx_i2c_reads(struct aw883xx *aw883xx, + uint8_t reg_addr, uint8_t *data_buf, uint16_t data_len) +{ + int ret = -1; + + ret = aw883xx->i2c_read_func(aw883xx->i2c_addr, reg_addr, data_buf, data_len); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c read error"); + } + return ret; +} + +int aw883xx_i2c_write(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t reg_data) +{ + int ret = -1; + uint8_t cnt = 0; + uint8_t buf[2] = {0}; + + buf[0] = (reg_data & 0xff00) >> 8; + buf[1] = (reg_data & 0x00ff) >> 0; + + while (cnt < AW_I2C_RETRIES) { + ret = aw883xx_i2c_writes(aw883xx, reg_addr, buf, 2); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c_write cnt=%d error=%d", + cnt, ret); + } else { + break; + } + cnt++; + } + + if (aw883xx->i2c_log_en) { + aw_dev_info(aw883xx->dev, "write: reg = 0x%02x, val = 0x%04x", + reg_addr, reg_data); + } + + return ret; +} + +int aw883xx_i2c_read(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t *reg_data) +{ + int ret = -1; + uint8_t cnt = 0; + uint8_t buf[2] = {0}; + + while (cnt < AW_I2C_RETRIES) { + ret = aw883xx_i2c_reads(aw883xx, reg_addr, buf, 2); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c_read cnt=%d error=%d", + cnt, ret); + } else { + *reg_data = (buf[0] << 8) | (buf[1] << 0); + break; + } + cnt++; + } + + if (aw883xx->i2c_log_en) { + aw_dev_info(aw883xx->dev, "read: reg = 0x%02x, val = 0x%04x", + reg_addr, *reg_data); + } + + return ret; +} + +static int aw883xx_i2c_write_bits(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t mask, + uint16_t reg_data) +{ + int ret = -1; + uint16_t reg_val = 0; + + ret = aw883xx_i2c_read(aw883xx, reg_addr, ®_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c read error, ret=%d", ret); + return ret; + } + reg_val &= mask; + reg_val |= reg_data & (~mask); + ret = aw883xx_i2c_write(aw883xx, reg_addr, reg_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c read error, ret=%d", ret); + return ret; + } + + return 0; +} + +int aw883xx_reg_write(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t reg_data) +{ + int ret = -1; + + aw_mutex_lock(); + ret = aw883xx_i2c_write(aw883xx, reg_addr, reg_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, + "write fail, reg = 0x%02x, val = 0x%04x, ret=%d", + reg_addr, reg_data, ret); + } + aw_mutex_unlock(); + + return ret; +} + +int aw883xx_reg_read(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t *reg_data) +{ + int ret = -1; + + aw_mutex_lock(); + ret = aw883xx_i2c_read(aw883xx, reg_addr, reg_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, + "read fail: reg = 0x%02x, val = 0x%04x, ret=%d", + reg_addr, *reg_data, ret); + } + aw_mutex_unlock(); + + return ret; +} + +int aw883xx_reg_write_bits(struct aw883xx *aw883xx, + uint8_t reg_addr, uint16_t mask, uint16_t reg_data) +{ + int ret = -1; + + aw_mutex_lock(); + ret = aw883xx_i2c_write_bits(aw883xx, reg_addr, mask, reg_data); + + if (ret < 0) { + aw_dev_err(aw883xx->dev, + "aw883xx_reg_write_bits fail, ret=%d", ret); + } + aw_mutex_unlock(); + + return ret; +} + +static int aw883xx_dsp_write_16bit(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t dsp_data) +{ + int ret = -1; + struct aw_dsp_mem_desc *desc = &aw883xx->aw_pa->dsp_mem_desc; + + ret = aw883xx_i2c_write(aw883xx, desc->dsp_madd_reg, dsp_addr); + + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + ret = aw883xx_i2c_write(aw883xx, desc->dsp_mdat_reg, (uint16_t)dsp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + return 0; +} + +static int aw883xx_dsp_write_32bit(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t dsp_data) +{ + int ret = -1; + uint16_t temp_data = 0; + struct aw_dsp_mem_desc *desc = &aw883xx->aw_pa->dsp_mem_desc; + + ret = aw883xx_i2c_write(aw883xx, desc->dsp_madd_reg, dsp_addr); + + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + temp_data = dsp_data & AW883XX_DSP_16_DATA_MASK; + ret = aw883xx_i2c_write(aw883xx, desc->dsp_mdat_reg, temp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + temp_data = dsp_data >> 16; + ret = aw883xx_i2c_write(aw883xx, desc->dsp_mdat_reg, temp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + return 0; +} + +/****************************************************** + * aw883xx clear dsp chip select state + ******************************************************/ +int aw883xx_get_version(char *buf, int size) +{ + if (size > strlen(AW883XX_DRIVER_VERSION)) { + memcpy(buf, AW883XX_DRIVER_VERSION, strlen(AW883XX_DRIVER_VERSION)); + return strlen(AW883XX_DRIVER_VERSION); + } else { + return -ENOMEM; + } +} + +static void aw883xx_clear_dsp_sel_st(struct aw883xx *aw883xx) +{ + uint16_t reg_value; + uint8_t reg = aw883xx->aw_pa->soft_rst.reg; + + aw883xx_i2c_read(aw883xx, reg, ®_value); +} + +int aw883xx_dsp_write(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t dsp_data, uint8_t data_type) +{ + int ret = -1; + + aw_mutex_lock(); + if (data_type == AW_DSP_16_DATA) { + ret = aw883xx_dsp_write_16bit(aw883xx, dsp_addr, dsp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "write dsp_addr[0x%04x] 16 bit dsp_data[%04x] failed", + (uint32_t)dsp_addr, dsp_data); + goto exit; + } + } else if (data_type == AW_DSP_32_DATA) { + ret = aw883xx_dsp_write_32bit(aw883xx, dsp_addr, dsp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "write dsp_addr[0x%04x] 32 bit dsp_data[%08x] failed", + (uint32_t)dsp_addr, dsp_data); + goto exit; + } + } else { + aw_dev_err(aw883xx->dev, "data type[%d] unsupported", data_type); + ret = -EINVAL; + goto exit; + } + +exit: + aw883xx_clear_dsp_sel_st(aw883xx); + aw_mutex_unlock(); + + return ret; +} + + +static int aw883xx_dsp_read_16bit(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t *dsp_data) +{ + int ret = -1; + uint16_t temp_data = 0; + struct aw_dsp_mem_desc *desc = &aw883xx->aw_pa->dsp_mem_desc; + + ret = aw883xx_i2c_write(aw883xx, desc->dsp_madd_reg, dsp_addr); + + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + ret = aw883xx_i2c_read(aw883xx, desc->dsp_mdat_reg, &temp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + *dsp_data = temp_data; + + return 0; +} + +static int aw883xx_dsp_read_32bit(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t *dsp_data) +{ + int ret = -1; + uint16_t temp_data = 0; + struct aw_dsp_mem_desc *desc = &aw883xx->aw_pa->dsp_mem_desc; + + /*write dsp addr*/ + ret = aw883xx_i2c_write(aw883xx, desc->dsp_madd_reg, dsp_addr); + + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c write error, ret=%d", ret); + return ret; + } + + /*get Low 16 bit data*/ + ret = aw883xx_i2c_read(aw883xx, desc->dsp_mdat_reg, &temp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c read error, ret=%d", ret); + return ret; + } + + *dsp_data = temp_data; + + /*get high 16 bit data*/ + ret = aw883xx_i2c_read(aw883xx, desc->dsp_mdat_reg, &temp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "i2c read error, ret=%d", ret); + return ret; + } + *dsp_data |= (temp_data << 16); + + return 0; +} + +int aw883xx_dsp_read(struct aw883xx *aw883xx, + uint16_t dsp_addr, uint32_t *dsp_data, uint8_t data_type) +{ + int ret = -1; + + aw_mutex_lock(); + if (data_type == AW_DSP_16_DATA) { + ret = aw883xx_dsp_read_16bit(aw883xx, dsp_addr, dsp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "read dsp_addr[0x%04x] 16 bit dsp_data[%04x] failed", + (uint32_t)dsp_addr, *dsp_data); + goto exit; + } + } else if (data_type == AW_DSP_32_DATA) { + ret = aw883xx_dsp_read_32bit(aw883xx, dsp_addr, dsp_data); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "read dsp_addr[0x%04x] 32 bit dsp_data[%08x] failed", + (uint32_t)dsp_addr, *dsp_data); + goto exit; + } + } else { + aw_dev_err(aw883xx->dev, "data type[%d] unsupported", data_type); + ret = -EINVAL; + goto exit; + } + +exit: + aw883xx_clear_dsp_sel_st(aw883xx); + aw_mutex_unlock(); + + return ret; +} + +int aw883xx_dsp_write_bits(struct aw883xx *aw883xx, uint16_t dsp_addr, + uint32_t dsp_mask, uint32_t dsp_data, uint8_t data_type) +{ + int ret = -1; + uint32_t read_val = 0; + uint32_t write_val = 0; + + aw_mutex_lock(); + if (data_type == AW_DSP_16_DATA) { + ret = aw883xx_dsp_read_16bit(aw883xx, dsp_addr, &read_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "read dsp_addr[0x%04x] 16 bit dsp_data[%04x] failed", + (uint32_t)dsp_addr, read_val); + goto exit; + } + } else if (data_type == AW_DSP_32_DATA) { + ret = aw883xx_dsp_read_32bit(aw883xx, dsp_addr, &read_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "read dsp_addr[0x%04x] 32 bit dsp_data[%08x] failed", + (uint32_t)dsp_addr, read_val); + goto exit; + } + } + + write_val = read_val & dsp_mask; + write_val |= dsp_data & (~dsp_mask); + + if (data_type == AW_DSP_16_DATA) { + ret = aw883xx_dsp_write_16bit(aw883xx, dsp_addr, write_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "write dsp_addr[0x%04x] 16 bit dsp_data[%04x] failed", + (uint32_t)dsp_addr, write_val); + goto exit; + } + } else if (data_type == AW_DSP_32_DATA) { + ret = aw883xx_dsp_write_32bit(aw883xx, dsp_addr, write_val); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "write dsp_addr[0x%04x] 32 bit dsp_data[%08x] failed", + (uint32_t)dsp_addr, write_val); + goto exit; + } + } +exit: + aw883xx_clear_dsp_sel_st(aw883xx); + aw_mutex_unlock(); + return ret; +} + +/****************************************************** + * aw883xx interface + ******************************************************/ +int aw883xx_get_dev_num(void) +{ + return g_aw883xx_dev_cnt; +} + +struct aw883xx *aw883xx_get_dev(uint8_t dev) +{ + return g_aw883xx[dev]; +} + +static void aw883xx_start_pa(struct aw883xx *aw883xx) +{ + int ret = -1; + int i; + aw_dev_info(aw883xx->dev, "enter"); + + if (aw883xx->allow_pw == false) { + aw_dev_info(aw883xx->dev, "dev can not allow power"); + return; + } + + if (aw883xx->pstream == AW_STREAM_CLOSE) { + aw_dev_info(aw883xx->dev, "pstream is close"); + return; + } + + for (i = 0; i < AW_START_RETRIES; i++) { + ret = aw883xx_device_start(aw883xx->aw_pa); + if (ret) { + aw_dev_err(aw883xx->dev, "start failed"); + ret = aw883xx_device_fw_update(aw883xx->aw_pa, AW_DSP_FW_UPDATE_ON, true); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "fw update failed"); + continue; + } + } else { + aw_dev_info(aw883xx->dev, "start success"); + break; + } + } +} + +static void aw883xx_start(struct aw883xx *aw883xx) +{ + int ret = -1; + int i; + bool sync_start = 0; + + aw_dev_info(aw883xx->dev,"enter"); + + if (aw883xx->aw_pa->fw_status == AW_DEV_FW_OK) { + if (aw883xx->allow_pw == false) { + aw_dev_info(aw883xx->dev, "dev can not allow power"); + return; + } + + if (aw883xx->aw_pa->status == AW_DEV_PW_ON) { + aw_dev_info(aw883xx->dev, "pa already start"); + return; + } + + for (i = 0; i < AW_START_RETRIES; i++) { + ret = aw883xx_device_fw_update(aw883xx->aw_pa, AW_DSP_FW_UPDATE_OFF, + aw883xx->phase_sync); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "fw update failed"); + continue; + } else { + if (sync_start == AW_SYNC_START) { + aw883xx_start_pa(aw883xx); + } + return; + } + } + } +} + +static void aw883xx_stop_pa(struct aw883xx *aw883xx) +{ + aw883xx_device_stop(aw883xx->aw_pa); +} + + +static int aw883xx_hw_reset(struct aw883xx *aw883xx) +{ + aw_dev_info(aw883xx->dev, "enter"); + + aw883xx->reset_gpio_ctl(AW_PIN_RESET); + aw_dev_info(aw883xx->dev, "gpio_ctl=%d", AW_PIN_RESET); + AW_MS_DELAY(1); + aw883xx->reset_gpio_ctl(AW_PIN_SET); + aw_dev_info(aw883xx->dev, "gpio_ctl=%d", AW_PIN_SET); + AW_MS_DELAY(2); + + return 0; +} + +#ifdef AW_DEBUG +int aw883xx_hw_reset_by_index(aw_dev_index_t dev) +{ + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx_hw_reset(g_aw883xx[dev]); + + return 0; +} + +int aw883xx_soft_reset(aw_dev_index_t dev) +{ + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx_device_status(g_aw883xx[dev]->aw_pa, AW_DEV_SOFT_RESET_STATUS, AW_SET_DEV_STATUS); + + return 0; +} + + +int aw883xx_reg_store(aw_dev_index_t dev, uint8_t reg_addr, uint16_t reg_data) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + aw883xx_i2c_write(aw883xx, reg_addr, reg_data); + + return 0; +} + +int aw883xx_reg_show(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + aw883xx_device_status(aw883xx->aw_pa, AW_DEV_REG_DUMP_STATUS, AW_SET_DEV_STATUS); + + return 0; +} + +static int aw883xx_dsp_log_info(struct aw883xx *aw883xx, unsigned int base_addr, + uint32_t data_len, char *format) +{ + uint16_t reg_val = 0; + char *dsp_reg_info = NULL; + uint32_t dsp_info_len = 0; + int i; + + dsp_reg_info = calloc(1, AW_NAME_BUF_MAX); + if (dsp_reg_info == NULL) { + aw_dev_err(aw883xx->dev, "dsp_reg_info calloc failed"); + return -1; + } + + aw_mutex_lock(); + aw883xx_i2c_write(aw883xx, aw883xx->aw_pa->dsp_mem_desc.dsp_madd_reg, base_addr); + + for (i = 0; i < data_len; i+=2) { + aw883xx_i2c_read(aw883xx, aw883xx->aw_pa->dsp_mem_desc.dsp_mdat_reg, ®_val); + dsp_info_len += snprintf(dsp_reg_info + dsp_info_len, AW_NAME_BUF_MAX - dsp_info_len, + "%02x,%02x,", (reg_val >> 0) & 0xff, + (reg_val >> 8) & 0xff); + if ((i / 2 + 1) % 8 == 0) { + aw_dev_info(aw883xx->dev, "%s: %s", format, dsp_reg_info); + dsp_info_len = 0; + memset(dsp_reg_info, 0, AW_NAME_BUF_MAX); + } + + if (((data_len) % 8 != 0) && + (i == (data_len - 2))) { + aw_dev_info(aw883xx->dev, "%s: %s", format, dsp_reg_info); + dsp_info_len = 0; + memset(dsp_reg_info, 0, AW_NAME_BUF_MAX); + } + } + + dsp_info_len = 0; + memset(dsp_reg_info, 0, AW_NAME_BUF_MAX); + free(dsp_reg_info); + dsp_reg_info = NULL; + aw_mutex_unlock(); + + return 0; +} + +int aw883xx_dsp_info_show(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + struct aw_dsp_st *dsp_st_desc = NULL; + uint32_t data_len; + bool status = false; + int ret = -1; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + dsp_st_desc = &aw883xx->aw_pa->dsp_st_desc; + + if (aw883xx->aw_pa->dsp_cfg == AW_DEV_DSP_BYPASS) { + aw_dev_info(aw883xx->dev, "dsp bypass"); + } else { + aw_dev_info(aw883xx->dev, "dsp working"); + status = aw883xx_device_status(aw883xx->aw_pa, AW_DEV_PLL_WDT_STATUS, + AW_GET_DEV_STATUS); + if (!status) { + aw_dev_err(aw883xx->dev, "PA status abnormal"); + return -EINVAL; + } + + aw_dev_info(aw883xx->dev, "dsp_firmware_len:%d", aw883xx->aw_pa->dsp_fw_len); + ret = aw883xx_dsp_log_info(aw883xx, aw883xx->aw_pa->dsp_mem_desc.dsp_fw_base_addr, + aw883xx->aw_pa->dsp_fw_len, "dsp_fw"); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "dsp_fw display failed"); + return -EINVAL; + } + + aw_dev_info(aw883xx->dev, "dsp_config_len:%d", aw883xx->aw_pa->dsp_cfg_len); + ret = aw883xx_dsp_log_info(aw883xx, aw883xx->aw_pa->dsp_mem_desc.dsp_cfg_base_addr, + aw883xx->aw_pa->dsp_cfg_len, "dsp_config"); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "dsp_config display failed"); + return -EINVAL; + } + + aw_dev_info(aw883xx->dev, "dsp_config:0x%04x-0x%04x", + dsp_st_desc->dsp_reg_s1, dsp_st_desc->dsp_reg_e1); + data_len = 2 * (dsp_st_desc->dsp_reg_e1 - dsp_st_desc->dsp_reg_s1); + ret = aw883xx_dsp_log_info(aw883xx, dsp_st_desc->dsp_reg_s1, + data_len, "dsp_st"); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "dsp_config:0x%04x-0x%04x display failed", + dsp_st_desc->dsp_reg_s1, dsp_st_desc->dsp_reg_e1); + return -EINVAL; + } + + aw_dev_info(aw883xx->dev, "dsp_config:0x%04x-0x%04x", + dsp_st_desc->dsp_reg_s2, dsp_st_desc->dsp_reg_e2); + data_len = 2 * (dsp_st_desc->dsp_reg_e2 - dsp_st_desc->dsp_reg_s2); + ret = aw883xx_dsp_log_info(aw883xx, dsp_st_desc->dsp_reg_s2, + data_len , "dsp_st"); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "dsp_config:0x%04x-0x%04x display failed", + dsp_st_desc->dsp_reg_s2, dsp_st_desc->dsp_reg_e2); + return -EINVAL; + } + } + + return 0; +} +#endif + +#ifdef AW_FADE + +static int aw883xx_dev_set_fade_vol_step(struct aw883xx *aw883xx, uint32_t step) +{ + int ret = -1; + + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_STEP_PARAMS, + (void *)&step, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +static int aw883xx_dev_get_fade_vol_step(struct aw883xx *aw883xx, uint32_t *step) +{ + int ret = -1; + int step_val = 0; + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + if (step == NULL) { + aw_pr_err("step is NULL"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_STEP_PARAMS, + (void *)&step_val, msg_len, AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read_params failed"); + return ret; + } + + *step = step_val; + return 0; +} + +static int aw883xx_dev_set_fade_in_time(struct aw883xx *aw883xx, uint32_t time) +{ + int ret = -1; + + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_IN_TIME_PARAMS, + (void *)&time, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +static int aw883xx_dev_get_fade_in_time(struct aw883xx *aw883xx, uint32_t *time) +{ + int ret = -1; + int time_val = 0; + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + if (time == NULL) { + aw_pr_err("time is NULL"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_IN_TIME_PARAMS, + (void *)&time_val, msg_len, AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read_params failed"); + return ret; + } + + *time = time_val; + return 0; +} + +static int aw883xx_dev_set_fade_out_time(struct aw883xx *aw883xx, uint32_t time) +{ + int ret = -1; + + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_OUT_TIME_PARAMS, + (void *)&time, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +static int aw883xx_dev_get_fade_out_time(struct aw883xx *aw883xx, uint32_t *time) +{ + int ret = -1; + int time_val = 0; + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + if (time == NULL) { + aw_pr_err("time is NULL"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw_dev, AW_DEV_FADE_OUT_TIME_PARAMS, + (void *)&time_val, msg_len, AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read_params failed"); + return ret; + } + + *time = time_val; + return 0; +} + +int aw883xx_set_fade_step(aw_dev_index_t dev, uint32_t step) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + aw883xx_dev_set_fade_vol_step(aw883xx, step); + + aw_dev_info(aw883xx->dev, "set step %d DB Done", step); + + return 0; +} + +int aw883xx_get_fade_step(aw_dev_index_t dev, uint32_t *step) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if ((g_aw883xx[dev] == NULL) || (step == NULL)) { + aw_pr_err("g_aw883xx[%d] is NULL or step is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + aw883xx_dev_get_fade_vol_step(aw883xx, step); + aw_dev_info(aw883xx->dev, "get step %d Done", *step); + + return 0; +} + +int aw883xx_set_fade_time(aw_fade_dir_t fade_dir, uint32_t time) +{ + struct aw883xx *aw883xx = NULL; + + if (g_aw883xx[AW_DEV_0] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL or step is NULL", AW_DEV_0); + return -EINVAL; + } + + aw883xx = g_aw883xx[AW_DEV_0]; + + if (fade_dir == AW_FADE_IN) { + aw883xx_dev_set_fade_in_time(aw883xx, time); + } else if (fade_dir == AW_FADE_OUT){ + aw883xx_dev_set_fade_out_time(aw883xx, time); + } else { + aw_dev_err(aw883xx->dev, "unsupported fade type %d", fade_dir); + } + + return 0; +} + +int aw883xx_get_fade_time(aw_fade_dir_t fade_dir, uint32_t *time) +{ + struct aw883xx *aw883xx = NULL; + + if ((g_aw883xx[AW_DEV_0] == NULL) || (time == NULL)) { + aw_pr_err("g_aw883xx[%d] is NULL or step is NULL", AW_DEV_0); + return -EINVAL; + } + + aw883xx = g_aw883xx[AW_DEV_0]; + + if (fade_dir == AW_FADE_IN) { + aw883xx_dev_get_fade_in_time(aw883xx, time); + } else if (fade_dir == AW_FADE_OUT){ + aw883xx_dev_get_fade_out_time(aw883xx, time); + } else { + aw_dev_err(aw883xx->dev, "unsupported fade type %d", fade_dir); + } + + return 0; +} +#endif + +#ifdef AW_VOLUME + +static int aw883xx_dev_get_volume(struct aw883xx *aw883xx, uint32_t *volume) +{ + int ret = -1; + int vol_val = 0; + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + + if (volume == NULL) { + aw_pr_err("volume is NULL"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw_dev, AW_DEV_VOLUME_PARAMS, + (void *)&vol_val, msg_len, AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read_params failed"); + return ret; + } + + *volume = vol_val; + return 0; +} + +static int aw883xx_dev_set_volume(struct aw883xx *aw883xx, uint32_t volume) +{ + int ret = -1; + uint32_t compared_vol = 0; + uint32_t msg_len = sizeof(uint32_t); + struct aw_device *aw_dev = aw883xx->aw_pa; + struct aw_volume_desc *vol_desc = &aw_dev->volume_desc; + + vol_desc->ctl_volume = volume; + + /*get smaller dB*/ + compared_vol = AW_GET_MAX_VALUE(vol_desc->ctl_volume, + vol_desc->monitor_volume); + + ret = aw883xx_device_params(aw_dev, AW_DEV_VOLUME_PARAMS, + (void *)&compared_vol, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +int aw883xx_get_volume(aw_dev_index_t dev, uint32_t *volume) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if ((g_aw883xx[dev] == NULL) || (volume == NULL)) { + aw_pr_err("g_aw883xx[%d] is NULL or volume is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + aw883xx_dev_get_volume(aw883xx, volume); + + aw_dev_info(aw883xx->dev, "get volume %d", *volume); + + return 0; +} + +int aw883xx_set_volume(aw_dev_index_t dev, uint32_t volume) +{ + struct aw883xx *aw883xx = NULL; + int ret = -1; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + ret = aw883xx_dev_set_volume(aw883xx, volume); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "set volume failed"); + return ret; + } + + aw_dev_info(aw883xx->dev, "set volume %d", volume); + + return 0; +} +#endif + +int aw883xx_ctrl_state(aw_dev_index_t dev, aw_ctrl_t aw_ctrl) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (aw_ctrl) { + aw883xx->pstream = AW_STREAM_CLOSE; + aw883xx_stop_pa(aw883xx); + } else { + aw883xx->pstream = AW_STREAM_OPEN; + aw883xx_start(aw883xx); + } + + return 0; +} + +int aw883xx_set_profile_byname(aw_dev_index_t dev, char *prof_name) +{ + int ret = -1; + char *cur_name = NULL; + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + cur_name = aw883xx_dev_get_profile_name(aw883xx->aw_pa); + if (strncmp(cur_name, prof_name, AW_PROF_NAME_MAX) == 0) { + aw_dev_info(aw883xx->dev, "profile no change"); + return 0; + } + + ret = aw883xx_dev_set_profile_name(aw883xx->aw_pa, prof_name); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "set profile [%s] failed", prof_name); + return -EINVAL; + } + + aw_dev_info(aw883xx->dev, "set prof name %s", prof_name); + + return 0; +} + +static int aw883xx_check_init_info(struct aw_init_info *init_info) +{ + int ret = -1; + + /*check dev index*/ + if (init_info->dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", init_info->dev); + return -EINVAL; + } + + if (g_aw883xx[init_info->dev] != NULL) { + aw_pr_err("dev:%d exist", init_info->dev); + return -EINVAL; + } + + /*check i2c funtion*/ + if ((init_info->i2c_read_func == NULL) || + (init_info->i2c_write_func == NULL)) { + aw_dev_err(init_info->dev, "i2c funtion is NULL"); + return -EINVAL; + } + + ret = aw883xx_dev_check_prof(init_info->dev, init_info->prof_info); + if (ret < 0) { + aw_dev_err(init_info->dev, "check prof failed"); + return ret; + } + + return 0; +} + +static struct aw883xx *aw883xx_malloc_init(struct aw_init_info *init_info) +{ + struct aw883xx *aw883xx = calloc(1, sizeof(struct aw883xx)); + if (aw883xx == NULL) { + aw_dev_err(init_info->dev, "calloc aw883xx failed."); + return NULL; + } + + aw883xx->init_info = init_info; + aw883xx->aw_pa = NULL; + aw883xx->dev = init_info->dev; + aw883xx->i2c_addr = init_info->i2c_addr; + aw883xx->i2c_read_func = init_info->i2c_read_func; + aw883xx->i2c_write_func = init_info->i2c_write_func; + + if (init_info->phase_sync) { + aw883xx->phase_sync = init_info->phase_sync; + } else { + aw883xx->phase_sync = AW_PHASE_SYNC_DISABLE; + } + + if (init_info->reset_gpio_ctl) { + aw883xx->reset_gpio_ctl = init_info->reset_gpio_ctl; + } else { + aw883xx->reset_gpio_ctl = NULL; + } + + aw883xx->allow_pw = true; + aw883xx->i2c_log_en = false; + + return aw883xx; +} + +static int aw883xx_read_chipid(struct aw883xx *aw883xx) +{ + int ret = -1; + unsigned int cnt = 0; + uint16_t reg_value = 0; + + while (cnt < AW_READ_CHIPID_RETRIES) { + ret = aw883xx_i2c_read(aw883xx, AW883xx_CHIP_ID_REG, ®_value); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "failed to read REG_ID: %d", ret); + return -EIO; + } + switch (reg_value) { + case PID_2049_ID: { + aw_dev_info(aw883xx->dev, "aw883xx 2049 detected"); + aw883xx->chip_id = reg_value; + return 0; + } + case PID_2066_ID: { + aw_dev_info(aw883xx->dev, "aw883xx 2066 detected"); + aw883xx->chip_id = reg_value; + return 0; + } + case PID_2183_ID: { + aw_dev_info(aw883xx->dev, "aw883xx 2183 detected"); + aw883xx->chip_id = reg_value; + return 0; + } + default: + aw_dev_info(aw883xx->dev, "unsupported device revision (0x%x)", + reg_value); + break; + } + cnt++; + + AW_MS_DELAY(AW_READ_CHIPID_RETRY_DELAY); + } + + return -EINVAL; +} + +static int aw883xx_init(struct aw883xx *aw883xx) +{ + int i = 0; + int ret; + struct aw_init_info *init_info = aw883xx->init_info; + + for (i = 0; i < init_info->mix_chip_count; i++) { + aw_dev_dbg(aw883xx->dev, "%d enter", i); + if (init_info->dev_init_ops[i] == NULL) { + aw_dev_err(aw883xx->dev, "init_info->dev_init_ops[%d] is null", i); + return -EINVAL; + } + + ret = init_info->dev_init_ops[i]((void *)aw883xx); + if (ret < 0) { + aw_dev_dbg(aw883xx->dev, "%d enter", i); + continue; + } else { + aw_dev_dbg(aw883xx->dev, "%d init success", i); + break; + } + } + + return ret; +} + +int aw883xx_smartpa_init(void *aw_info) +{ + int ret = -1; + struct aw_init_info *aw_init_info = NULL; + struct aw883xx *aw883xx = NULL; + + aw_pr_info("enter"); + + if (aw_info == NULL) { + aw_pr_err("aw_info is NULL"); + return -ENOMEM; + } + + aw_init_info = (struct aw_init_info *)aw_info; + + ret = aw883xx_check_init_info(aw_init_info); + if (ret < 0) { + return ret; + } + aw883xx = aw883xx_malloc_init(aw_init_info); + if (aw883xx == NULL) { + aw_dev_err(aw_init_info->dev, "malloc aw883xx failed"); + return -ENOMEM; + } + + /* hardware reset */ + aw883xx_hw_reset(aw883xx); + + /* aw883xx chip id */ + ret = aw883xx_read_chipid(aw883xx); + if (ret < 0) { + aw_dev_err(aw_init_info->dev, "aw883xx_read_chipid failed ret=%d", ret); + goto read_chip_failed; + } + + /*aw pa init*/ + ret = aw883xx_init(aw883xx); + if (ret) { + goto init_failed; + } + + aw883xx->aw_pa->status = AW_DEV_PW_OFF; + aw883xx->aw_pa->fw_status = AW_DEV_FW_OK; + + if (aw_init_info->fade_en) { + aw883xx->aw_pa->fade_en = aw_init_info->fade_en; + } else { + aw883xx->aw_pa->fade_en = AW_FADE_DISABLE; + } + + if (aw_init_info->re_min) { + aw883xx->aw_pa->re_range.re_min = aw_init_info->re_min; + } else { + aw883xx->aw_pa->re_range.re_min = AW_RE_MIN; + } + + if (aw_init_info->re_max) { + aw883xx->aw_pa->re_range.re_max = aw_init_info->re_max; + } else { + aw883xx->aw_pa->re_range.re_max = AW_RE_MAX; + } + + if (aw_init_info->cali_check_st) { + aw883xx->aw_pa->cali_desc.cali_check_st = aw_init_info->cali_check_st; + } else { + aw883xx->aw_pa->cali_desc.cali_check_st = CALI_CHECK_DISABLE; + } + aw883xx->aw_pa->cali_desc.cali_result = CALI_RESULT_NONE; + + g_aw883xx[aw_init_info->dev] = aw883xx; + g_aw883xx_dev_cnt++; + aw_dev_info(aw_init_info->dev, "dev:%d init success", + aw_init_info->dev); + + return 0; + +init_failed: +read_chip_failed: + free(aw883xx); + aw883xx = NULL; + return ret; +} + + +void aw883xx_smartpa_deinit(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev_index:%d", dev); + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + } + + aw883xx = g_aw883xx[dev]; + + if (aw883xx->aw_pa->ops.aw_monitor_deinit != NULL) { + aw883xx->aw_pa->ops.aw_monitor_deinit((void *)aw883xx->aw_pa); + } + + if (aw883xx->aw_pa != NULL) { + free(aw883xx->aw_pa); + aw883xx->aw_pa = NULL; + } + + if (aw883xx != NULL) { + free(aw883xx); + aw883xx = NULL; + } +} + +int aw883xx_dsp_bypass_ctrl(aw_dev_index_t dev, aw_dsp_ctrl_t dsp_ctrl) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_err("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_err("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dsp_ctrl) { + aw883xx->aw_pa->dsp_cfg = AW_DEV_DSP_BYPASS; + } else { + aw883xx->aw_pa->dsp_cfg = AW_DEV_DSP_WORK; + } + + return 0; +} + +/*************************************************************************** + *aw883xx irq + ***************************************************************************/ +#ifdef AW_IRQ + +aw_hw_irq_handle_t aw883xx_get_hw_irq_status(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + } + + aw883xx = g_aw883xx[dev]; + aw_dev_info(aw883xx->dev, "irq_handle=%d", aw883xx->irq_handle); + return aw883xx->irq_handle; +} + +void aw883xx_irq_handler(aw_dev_index_t dev) +{ + int ret = -1; + uint32_t crc_switch_status = 0; + uint32_t crc_check_abnormal = 0; + uint32_t mask_value = AW_DEV_UNMASK_INT_VAL; + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return; + } + + aw883xx = g_aw883xx[dev]; + + if (aw883xx->irq_handle == AW_HW_IRQ_HANDLE_ON){ + /*awinic:Add operations after interrupt triggering*/ + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_REALTIME_CRC_GET_PARAMS, + (void *)&crc_switch_status, sizeof(crc_switch_status), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "get crc_status failed"); + } + + if (crc_switch_status) { + ret = aw883xx_crc_realtime_check(aw883xx->aw_pa, &crc_check_abnormal); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "crc_realtime_check failed"); + } + + if (crc_check_abnormal) { + /*pa stop or stopping just set profile*/ + if (aw883xx->pstream) { + aw883xx_device_stop(aw883xx->aw_pa); + + ret = aw883xx_device_fw_update(aw883xx->aw_pa, AW_DSP_FW_UPDATE_ON, true); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "fw update failed"); + } + aw883xx_start(aw883xx); + } + } + } + + aw883xx_device_status(aw883xx->aw_pa, AW_DEV_INTERRUPT_CLEAR_STATUS, + AW_SET_DEV_STATUS); + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_INT_PARAMS, + (void *)&mask_value, sizeof(mask_value), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "write_params failed"); + } + + aw883xx->irq_handle = AW_HW_IRQ_HANDLE_OFF; + aw_dev_info(aw883xx->dev, "irq_handle=%d",aw883xx->irq_handle); + } +} + +void aw883xx_irq_trigger(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return; + } + + aw883xx = g_aw883xx[dev]; + + aw883xx->irq_handle = AW_HW_IRQ_HANDLE_ON; + aw_dev_info(aw883xx->dev, "irq_handle=%d",aw883xx->irq_handle); +} +#endif + +/*********************************************************************** + * aw883xx monitor + ***********************************************************************/ +#ifdef AW_MONITOR +void aw883xx_monitor_work(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return; + } + + aw883xx = g_aw883xx[dev]; + + if (aw883xx->aw_pa->ops.aw_monitor_work_func) { + aw883xx->aw_pa->ops.aw_monitor_work_func((void *)aw883xx->aw_pa); + } +} + +void aw883xx_monitor_set_status(aw_dev_index_t dev) +{ + struct aw883xx *aw883xx = NULL; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return; + } + + aw883xx = g_aw883xx[dev]; + + if (aw883xx->aw_pa->ops.aw_monitor_set_handle) { + aw883xx->aw_pa->ops.aw_monitor_set_handle((void *)aw883xx->aw_pa); + } +} +#endif + +/*********************************************************************** + * aw883xx cali + ***********************************************************************/ +#ifdef AW_CALIB +int aw883xx_cali_re(aw_dev_index_t dev, aw_single_t is_single, uint32_t *re) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr cali_msg = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (re == NULL) { + aw_pr_info("g_aw883xx[%d] re is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (is_single == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_RE_PARAMS, + (void *)&dev_type, sizeof(dev_type), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali re failed"); + return ret; + } + + cali_msg.opcode_id = is_single; + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_RE_PARAMS, + (void *)&cali_msg, sizeof(cali_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali re show failed"); + return ret; + } + + memcpy(re, &cali_msg.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_cali_f0(aw_dev_index_t dev, aw_single_t is_single, uint32_t *f0) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr cali_msg = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (f0 == NULL) { + aw_pr_info("g_aw883xx[%d] f0 is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_F0_Q_PARAMS, + (void *)&dev_type, sizeof(dev_type), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali f0 failed"); + return ret; + } + + cali_msg.opcode_id = is_single; + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_F0_PARAMS, + (void *)&cali_msg, sizeof(cali_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali f0 show failed"); + return ret; + } + + memcpy(f0, &cali_msg.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_cali_f0_q(aw_dev_index_t dev, aw_single_t is_single, uint32_t *f0, uint32_t *q) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr f0_msg = { 0 }; + struct cali_msg_hdr q_msg = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if ((f0 == NULL) || (q == NULL)) { + aw_pr_info("g_aw883xx[%d] f0/q is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_F0_Q_PARAMS, + (void *)&dev_type, sizeof(dev_type), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali f0 failed"); + return ret; + } + + f0_msg.opcode_id = is_single; + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_F0_PARAMS, + (void *)&f0_msg, sizeof(f0_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali f0 show failed"); + return ret; + } + memcpy(f0, &f0_msg.msg, dev_cnt * sizeof(uint32_t)); + + q_msg.opcode_id = is_single; + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_Q_PARAMS, + (void *)&q_msg, sizeof(q_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali q show failed"); + return ret; + } + + memcpy(q, &q_msg.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_cali_re_f0(aw_dev_index_t dev, aw_single_t is_single, uint32_t *re, uint32_t *f0) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr re_msg = { 0 }; + struct cali_msg_hdr f0_msg = { 0 }; + uint32_t dev_type = is_single; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if ((f0 == NULL) || (re == NULL)) { + aw_pr_info("g_aw883xx[%d] f0/re is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_RE_F0_PARAMS, + (void *)&dev_type, sizeof(dev_type), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali re_f0 failed"); + return ret; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_RE_PARAMS, + (void *)&re_msg, sizeof(re_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali re show failed"); + return ret; + } + + memcpy(re, &re_msg.msg, dev_cnt * sizeof(uint32_t)); + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_F0_PARAMS, + (void *)&f0_msg, sizeof(f0_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali f0 show failed"); + return ret; + } + + memcpy(f0, &f0_msg.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_get_re_range(aw_dev_index_t dev, aw_single_t is_single, uint32_t *range_buf) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr re_range_msg = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (range_buf == NULL) { + aw_pr_info("g_aw883xx[%d] range_buf is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + re_range_msg.opcode_id = dev_type; + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_RE_RANGE_PARAMS, + (void *)&re_range_msg, sizeof(re_range_msg), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "get re range failed"); + return ret; + } + + memcpy(range_buf, &re_range_msg.msg, RE_RANGE_NUM * dev_cnt * sizeof(uint32_t)); + + return 0; +} + + +int aw883xx_get_r0(aw_dev_index_t dev, aw_single_t is_single, uint32_t *r0_data) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr msg_hdr = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (r0_data == NULL) { + aw_pr_info("g_aw883xx[%d] r0_data is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + msg_hdr.opcode_id = dev_type; + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_R0_PARAMS, + (void *)&msg_hdr, sizeof(msg_hdr), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "get r0 failed"); + return ret; + } + + memcpy(r0_data, &msg_hdr.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_get_f0(aw_dev_index_t dev, aw_single_t is_single, uint32_t *f0_data) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr msg_hdr = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (f0_data == NULL) { + aw_pr_info("g_aw883xx[%d] f0_data is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + msg_hdr.opcode_id = dev_type; + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_F0_PARAMS, + (void *)&msg_hdr, sizeof(msg_hdr), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "get r0 failed"); + return ret; + } + + memcpy(f0_data, &msg_hdr.msg, dev_cnt * sizeof(uint32_t)); + + return 0; +} + +int aw883xx_get_te(aw_dev_index_t dev, aw_single_t is_single, int32_t *te_data) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr msg_hdr = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (te_data == NULL) { + aw_pr_info("g_aw883xx[%d] te_data is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + msg_hdr.opcode_id = is_single; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_TE_PARAMS, + (void *)&msg_hdr, sizeof(msg_hdr), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "get te failed"); + return ret; + } + + memcpy(te_data, &msg_hdr.msg, dev_cnt * sizeof(int32_t)); + + return 0; +} + +int aw883xx_cali_re_store(aw_dev_index_t dev, aw_single_t is_single, uint32_t *set_re) +{ + struct aw883xx *aw883xx = NULL; + struct cali_msg_hdr msg_hdr = { 0 }; + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + uint32_t dev_type = is_single; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (set_re == NULL) { + aw_pr_info("g_aw883xx[%d] set_re is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + msg_hdr.opcode_id = dev_type; + + if (dev_type == IS_SINGLE) { + dev_cnt = AW_SINGLE_DEV_COUNT; + } + memcpy(&msg_hdr.msg, set_re, dev_cnt * sizeof(uint32_t)); + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_STORE_CALI_RE_PARAMS, + (void *)&msg_hdr, sizeof(msg_hdr), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "cali re store failed"); + } + return ret; +} + +int aw883xx_read_re_from_dsp(aw_dev_index_t dev, uint32_t *re) +{ + struct aw883xx *aw883xx = NULL; + int ret = -1; + + if (dev >= AW_DEV_MAX) { + aw_pr_info("unsupported dev:%d", dev); + return -EINVAL; + } + + if (g_aw883xx[dev] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", dev); + return -EINVAL; + } + + if (re == NULL) { + aw_pr_info("g_aw883xx[%d] re is NULL", dev); + return -EINVAL; + } + + aw883xx = g_aw883xx[dev]; + + if (aw883xx->pstream == AW_STREAM_OPEN) { + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_DSP_RE_PARAMS, + (void *)re, sizeof(uint32_t), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw883xx->dev, "read re from dsp failed"); + } + } else { + aw_dev_err(aw883xx->dev, "PA not work, please work and retry"); + } + return ret; +} + +int aw883xx_cali_time_show(uint32_t *time) +{ + uint32_t time_val = 0; + int ret = -1; + struct aw883xx *aw883xx = NULL; + + if (g_aw883xx[AW_DEV_0] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", AW_DEV_0); + return -EINVAL; + } + + aw883xx = g_aw883xx[AW_DEV_0]; + + if (time == NULL) { + aw_pr_err("time is NULL"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_TIME_PARAMS, + (void *)&time_val, sizeof(uint32_t), AW_GET_DEV_PARAMS); + if (ret < 0) { + aw_pr_err("set cali_time failed"); + return -EINVAL; + } + *time = time_val; + + return 0; +} + +int aw883xx_cali_time_store(uint32_t time) +{ + int ret = -1; + struct aw883xx *aw883xx = NULL; + + if (g_aw883xx[AW_DEV_0] == NULL) { + aw_pr_info("g_aw883xx[%d] is NULL", AW_DEV_0); + return -EINVAL; + } + + aw883xx = g_aw883xx[AW_DEV_0]; + + ret = aw883xx_device_params(aw883xx->aw_pa, AW_DEV_CALI_TIME_PARAMS, + (void *)&time, sizeof(uint32_t), AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_pr_err("set cali_time failed"); + return -EINVAL; + } + + return 0; +} +#endif diff --git a/code/sdk/application/audio/vendor/aw88166/aw883xx_calib.c b/code/sdk/application/audio/vendor/aw88166/aw883xx_calib.c new file mode 100644 index 000000000..ed3419dcb --- /dev/null +++ b/code/sdk/application/audio/vendor/aw88166/aw883xx_calib.c @@ -0,0 +1,1615 @@ +/* +* aw883xx_calib.c aw883xx codec driver +* +* Copyright (c) 2021 AWINIC Technology CO., LTD +* +* Author: +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + +#include +#include +#include +#include "aw883xx_device.h" +#include "aw883xx_base.h" +#include "aw883xx_calib.h" +#include "aw883xx.h" + +#ifdef AW_CALIB +static unsigned int g_cali_re_time = AW_CALI_RE_DEFAULT_TIMER; + +bool aw883xx_cali_check_result(struct aw_cali_desc *cali_desc) +{ + if (cali_desc->cali_check_st && + (cali_desc->cali_result == CALI_RESULT_ERROR)) { + return false; + } else { + return true; + } +} + +static int aw_cali_svc_get_dev_re_range(struct aw_device *aw_dev, + uint32_t *data_buf) +{ + data_buf[RE_MIN_FLAG] = aw_dev->re_range.re_min; + data_buf[RE_MAX_FLAG] = aw_dev->re_range.re_max; + + return 0; +} + +static int aw_cali_svc_get_devs_re_range(struct aw_device *aw_dev, + uint32_t *data_buf, int num) +{ + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + uint8_t cnt = 0; + uint8_t i; + int dev_cnt = aw883xx_get_dev_num(); + + for (i = 0; i < dev_cnt; i++) { + aw883xx = aw883xx_get_dev(i); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < num) { + data_buf[RE_MIN_FLAG + local_dev->dev * 2] = + local_dev->re_range.re_min; + data_buf[RE_MAX_FLAG + local_dev->dev * 2] = + local_dev->re_range.re_max; + cnt++; + } else { + aw_dev_err(local_dev->dev, "channel num[%d] overflow buf num[%d]", + local_dev->dev, num); + return -EINVAL; + } + } + + return cnt; +} + +static int aw_cali_store_cali_re(struct aw_device *aw_dev, uint32_t re) +{ + if ((re > aw_dev->re_range.re_min) && (re < aw_dev->re_range.re_max)) { + aw_dev->cali_desc.cali_re = re; + } else { + aw_dev_err(aw_dev->dev, "invalid cali re %d!", re); + return -EINVAL; + } + + return 0; +} + +static int aw_cali_devs_store_cali_re(struct aw_device *aw_dev, uint32_t *set_re) +{ + struct aw_device *local_dev = NULL; + struct aw883xx *aw883xx = NULL; + int ret = -1; + uint8_t cnt; + int dev_num = 0; + dev_num = aw883xx_get_dev_num(); + + for (cnt = 0; cnt < dev_num; cnt++) { + aw883xx = aw883xx_get_dev(cnt); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < AW_DEV_CH_MAX) { + ret = aw_cali_store_cali_re(local_dev, set_re[local_dev->dev]); + if (ret < 0) { + aw_dev_err(local_dev->dev, "store cali re failed"); + return ret; + } + } + } + + return 0; +} + +static int aw_cali_svc_get_cali_re_from_hw(struct aw_device *aw_dev, uint32_t *re) +{ + int ret = -1; + uint32_t cali_re = 0; + uint16_t re_hbit = 0; + uint16_t re_lbit = 0; + struct aw_hw_cali_re_desc *hw_cali_re_desc = &aw_dev->cali_desc.hw_cali_re_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, hw_cali_re_desc->hbits_reg, &re_hbit); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read re_hbit failed"); + return ret; + } + + ret = aw_dev->ops.aw_reg_read(aw_dev, hw_cali_re_desc->lbits_reg, &re_lbit); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read re_hbit failed"); + return ret; + } + + cali_re = (re_hbit << hw_cali_re_desc->hbits_shift) | re_lbit; + + *re = AW_DSP_RE_TO_SHOW_RE(cali_re, hw_cali_re_desc->cali_re_shift) - aw_dev->cali_desc.ra; + + return 0; +} + +static int aw_cali_svc_read_cali_re_from_pa(struct aw_device *aw_dev, uint32_t *re) +{ + int ret = -1; + + if (aw_dev->ops.aw_get_cali_re) { + ret = aw_dev->ops.aw_get_cali_re(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read cali re error"); + return ret; + } + } else { + ret = aw_cali_svc_get_cali_re_from_hw(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read cali re error"); + return ret; + } + } + + aw_dev_info(aw_dev->dev, "get cali re:%d", *re); + + return 0; +} + +/*************Calibration base function************/ + +static int aw_cali_set_cali_re_to_hw(struct aw_device *aw_dev) +{ + int ret; + uint32_t cali_re = 0; + uint16_t re_hbits = 0; + uint16_t re_lbits = 0; + + struct aw_hw_cali_re_desc *hw_cali_re_desc = &aw_dev->cali_desc.hw_cali_re_desc; + + cali_re = AW_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re + + aw_dev->cali_desc.ra), hw_cali_re_desc->cali_re_shift); + + re_hbits = (cali_re & (~hw_cali_re_desc->hbits_mask)) >> hw_cali_re_desc->hbits_shift; + + re_lbits = (cali_re & (~hw_cali_re_desc->lbits_mask)) >> hw_cali_re_desc->lbits_shift; + + ret = aw_dev->ops.aw_reg_write(aw_dev, hw_cali_re_desc->hbits_reg, re_hbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write cali re failed"); + return ret; + } + + ret = aw_dev->ops.aw_reg_write(aw_dev, hw_cali_re_desc->lbits_reg, re_lbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write cali re failed"); + return ret; + } + + return 0; +} + +int aw883xx_set_cali_re(void *dev) +{ + int ret = -1; + struct aw_device *aw_dev = dev; + + + if (aw_dev->ops.aw_set_cali_re) { + ret = aw_dev->ops.aw_set_cali_re(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set cali re failed"); + return ret; + } + } else { + ret = aw_cali_set_cali_re_to_hw(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set cali re failed"); + return ret; + } + } + + return 0; +} + +static int aw_cali_set_mute_status(struct aw_device *aw_dev, int32_t mute) +{ + int ret = -1; + uint32_t msg_len = sizeof(uint32_t); + + ret = aw883xx_device_params(aw_dev, AW_DEV_HMUTE_PARAMS, + (void *)&mute, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +static void aw_cali_svc_run_mute(struct aw_device *aw_dev, int8_t cali_result) +{ + aw_dev_dbg(aw_dev->dev, "enter"); + + if (aw_dev->cali_desc.cali_check_st) { + if (cali_result == CALI_RESULT_ERROR) { + aw_cali_set_mute_status(aw_dev, AW_DEV_HMUTE_ENABLE); + } else if (cali_result == CALI_RESULT_NORMAL) { + aw_cali_set_mute_status(aw_dev, AW_DEV_HMUTE_DISABLE); + } + } else { + aw_dev_info(aw_dev->dev, "cali check disable"); + } + + aw_dev_info(aw_dev->dev, "done"); +} + +int aw883xx_cali_init_re_update(void *dev, backup_sec_t flag) +{ + int ret = -1; + struct aw_device *aw_dev = dev; + struct aw_hw_cali_re_desc *hw_cali_re_desc = &aw_dev->cali_desc.hw_cali_re_desc; + + if (aw_dev->ops.aw_init_re_update) { + ret = aw_dev->ops.aw_init_re_update(aw_dev, flag); + if (ret < 0) + aw_dev_err(aw_dev->dev, "read or write init re failed"); + return ret; + } + + if (flag == AW_RECOVERY_SEC_DATA) { + ret = aw_dev->ops.aw_reg_write(aw_dev, hw_cali_re_desc->hbits_reg, hw_cali_re_desc->re_hbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write cali re failed"); + return ret; + } + + ret = aw_dev->ops.aw_reg_write(aw_dev, hw_cali_re_desc->lbits_reg, hw_cali_re_desc->re_lbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write cali re failed"); + return ret; + } + } else if (flag == AW_RECORD_SEC_DATA) { + ret = aw_dev->ops.aw_reg_read(aw_dev, hw_cali_re_desc->hbits_reg, &hw_cali_re_desc->re_hbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read cali re failed"); + return ret; + } + + ret = aw_dev->ops.aw_reg_read(aw_dev, hw_cali_re_desc->lbits_reg, &hw_cali_re_desc->re_lbits); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read cali re failed"); + return ret; + } + } else { + aw_dev_err(aw_dev->dev, "unsupported type:%d", flag); + return -EINVAL; + } + + return 0; +} + +int aw883xx_cali_get_ra(void *dev) +{ + int ret = -1; + uint32_t dsp_ra; + struct aw_device *aw_dev = dev; + + struct aw_ra_desc *desc = &aw_dev->cali_desc.ra_desc; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, desc->dsp_reg, + &dsp_ra, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read ra error"); + return ret; + } + + aw_dev->cali_desc.ra = AW_DSP_RE_TO_SHOW_RE(dsp_ra, + desc->shift); + aw_dev_info(aw_dev->dev, "get ra:%d", aw_dev->cali_desc.ra); + return 0; +} + +static int aw_cali_get_r0_from_dsp(struct aw_device *aw_dev, + uint32_t *r0) +{ + int ret = -1; + uint32_t dsp_re = 0; + struct aw_r0_desc *r0_desc = &aw_dev->cali_desc.r0_desc; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, r0_desc->dsp_reg, &dsp_re, r0_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get_dsp_realtime_re failed"); + return ret; + } + + *r0 = AW_DSP_RE_TO_SHOW_RE(dsp_re, r0_desc->shift); + + return 0; +} + +static int aw_cali_svc_get_dev_r0(struct aw_device *aw_dev, + uint32_t *re) +{ + int ret = -1; + + if (aw_dev->ops.aw_get_r0) { + ret = aw_dev->ops.aw_get_r0(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get_r0 failed"); + return ret; + } + } else { + ret = aw_cali_get_r0_from_dsp(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get_r0 failed"); + return ret; + } + } + + return 0; +} + +static int aw_cali_svc_get_dev_re(struct aw_device *aw_dev, + uint32_t *re) +{ + int ret; + struct aw_dsp_cali_re_desc *desc = &aw_dev->cali_desc.dsp_re_desc; + uint32_t dsp_re = 0; + uint32_t show_re = 0; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, desc->dsp_reg, &dsp_re, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp read re error"); + return ret; + } + + show_re = AW_DSP_RE_TO_SHOW_RE(dsp_re, desc->shift); + + *re = show_re - aw_dev->cali_desc.ra; + aw_dev_dbg(aw_dev->dev, "real_r0:[%d]", *re); + + return 0; +} + + +static int aw_cali_svc_get_devs_r0(struct aw_device *aw_dev, uint32_t *r0_buf, int num) +{ + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + int ret = -1; + uint8_t cnt = 0; + uint8_t i; + + int dev_cnt = aw883xx_get_dev_num(); + + for (i = 0; i < dev_cnt; i++) { + aw883xx = aw883xx_get_dev(i); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < num) { + ret = aw_cali_svc_get_dev_r0(local_dev, &r0_buf[local_dev->dev]); + if (ret) { + aw_dev_err(local_dev->dev, "get r0 failed!"); + return ret; + } + cnt++; + } else { + aw_dev_err(aw_dev->dev, "channel num[%d] overflow buf num[%d] ", + local_dev->dev, num); + } + } + return cnt; +} + +static int aw_cali_svc_get_dev_f0(struct aw_device *aw_dev, + uint32_t *f0) +{ + struct aw_f0_desc *f0_desc = &aw_dev->cali_desc.f0_desc; + uint32_t dsp_val = 0; + int ret = -1; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + f0_desc->dsp_reg, &dsp_val, f0_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read f0 failed"); + return ret; + } + + *f0 = dsp_val >> f0_desc->shift; + aw_dev_dbg(aw_dev->dev, "real_f0:[%d]", *f0); + + return 0; +} + +static int aw_cali_svc_get_devs_f0(struct aw_device *aw_dev, uint32_t *f0_buf, int num) +{ + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + int ret = -1; + uint8_t cnt = 0; + uint8_t i; + int dev_cnt = aw883xx_get_dev_num(); + + for (i = 0; i < dev_cnt; i++) { + aw883xx = aw883xx_get_dev(i); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < num) { + ret = aw_cali_svc_get_dev_f0(local_dev, &f0_buf[local_dev->dev]); + if (ret < 0) { + aw_dev_err(local_dev->dev, "get f0 failed!"); + return ret; + } + cnt++; + } else { + aw_dev_err(aw_dev->dev, "channel num[%d] overflow buf num[%d] ", + local_dev->dev, num); + } + } + return cnt; +} + +static int aw_cali_svc_get_dev_q(struct aw_device *aw_dev, + uint32_t *q) +{ + struct aw_q_desc *q_desc = &aw_dev->cali_desc.q_desc; + uint32_t dsp_val = 0; + int ret = -1; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + q_desc->dsp_reg, &dsp_val, q_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read q failed"); + return ret; + } + + *q = ((dsp_val * 1000) >> q_desc->shift); + + return 0; +} + +int aw_cali_svc_get_dev_te(struct aw_device *aw_dev, struct aw_cali_desc *cali_desc, int32_t *te) +{ + uint16_t reg_val = 0; + int ret = -1; + + ret = aw_dev->ops.aw_reg_read(aw_dev, cali_desc->spkr_temp_desc.reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read temperature failed"); + return ret; + } + + *te = (int32_t)((int16_t)reg_val); + aw_dev_info(aw_dev->dev, "real_te:[%d]", *te); + + return 0; +} + +static int aw_cali_svc_get_devs_te(struct aw_device *aw_dev, int32_t *te_buf, int num) +{ + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + int ret = -1; + uint8_t i; + uint8_t cnt = 0; + int dev_cnt = aw883xx_get_dev_num(); + + for (i = 0; i < dev_cnt; i++) { + aw883xx = aw883xx_get_dev(i); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < num) { + ret = aw_cali_svc_get_dev_te(local_dev, &local_dev->cali_desc, &te_buf[local_dev->dev]); + if (ret) { + aw_dev_err(local_dev->dev, "get temperature failed!"); + return ret; + } + cnt++; + } else { + aw_dev_err(aw_dev->dev, "channel num[%d] overflow buf num[%d]", + local_dev->dev, num); + } + } + return cnt; +} + +static int aw_cali_svc_get_iv_st(struct aw_device *aw_dev) +{ + struct aw_cali_iv_desc *iv_desc = &aw_dev->cali_desc.iv_desc; + int ret; + uint16_t reg_data = 0; + int i; + + aw_dev_info(aw_dev->dev, "enter"); + + for (i = 0; i < AW_GET_IV_CNT_MAX; i++) { + ret = aw_dev->ops.aw_reg_read(aw_dev, iv_desc->reg, ®_data); + if (ret < 0) { + aw_dev_err(aw_dev->dev, + "read 0x%x failed", iv_desc->reg); + return ret; + } + + reg_data &= (~iv_desc->reabs_mask); + if (!reg_data) { + return 0; + } + AW_MS_DELAY(30); + } + + aw_dev_err(aw_dev->dev, "IV data abnormal, please check"); + + return -EINVAL; +} + +static void aw_cali_svc_bubble_sort(uint32_t *data, int data_size) +{ + int loop_num = data_size - 1; + uint16_t temp_store = 0; + int i; + int j; + + if (data == NULL) { + aw_pr_err("data is NULL"); + return; + } + + for (i = 0; i < loop_num; i++) { + for (j = 0; j < loop_num - i; j++) { + if (data[j] > data[j + 1]) { + temp_store = data[j]; + data[j] = data[j + 1]; + data[j + 1] = temp_store; + } + } + } +} + +static int aw_cali_svc_del_max_min_ave_algo(uint32_t *data, int data_size) +{ + int sum = 0; + int ave = 0; + int i = 0; + + aw_cali_svc_bubble_sort(data, data_size); + for (i = 1; i < data_size - 1; i++) + sum += data[i]; + + if ((data_size - AW_CALI_DATA_SUM_RM) == 0) { + aw_pr_err("data_size id :%d less than 2", data_size); + return -EINVAL; + } + + ave = sum / (data_size - AW_CALI_DATA_SUM_RM); + + return ave; +} + +static void aw_cali_svc_set_cali_status(struct aw_device *aw_dev, bool status) +{ + + aw_dev->cali_desc.status = status; + aw_dev_info(aw_dev->dev, "cali %s", + (status == 0) ? ("disable") : ("enable")); +} + +bool aw883xx_cali_get_cali_status(struct aw_cali_desc *cali_desc) +{ + return cali_desc->status; +} + +static int aw_cali_svc_cali_init_check(struct aw_device *aw_dev) +{ + int ret = -1; + bool pa_status =false; + uint32_t hmute_status = AW_DEV_HMUTE_DISABLE; + + aw_dev_dbg(aw_dev->dev, "enter"); + + pa_status = aw883xx_device_status(aw_dev, AW_DEV_PLL_WDT_STATUS, + AW_GET_DEV_STATUS); + if (!pa_status) { + aw_dev_err(aw_dev->dev, "pa status abnormal"); + return -EINVAL; + } + + ret = aw883xx_device_params(aw_dev, AW_DEV_HMUTE_PARAMS, + (void *)&hmute_status, sizeof(hmute_status), AW_GET_DEV_PARAMS); + if ((ret < 0) || (hmute_status == AW_DEV_HMUTE_ENABLE)) { + aw_dev_err(aw_dev->dev, "hmute status abnormal:%d, ret = %d", hmute_status, ret); + return -EINVAL; + } + + return 0; +} + +static int aw_cali_svc_get_cali_cfg(struct aw_device *aw_dev) +{ + int ret = -1; + struct aw_cali_cfg_desc *desc = &aw_dev->cali_desc.cali_cfg_desc; + struct cali_cfg *cali_cfg = &aw_dev->cali_desc.cali_cfg; + + aw_dev_dbg(aw_dev->dev, "enter"); + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->actampth_reg, &cali_cfg->data[0], desc->actampth_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp read reg0x%x error", desc->actampth_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->noiseampth_reg, &cali_cfg->data[1], desc->noiseampth_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp read reg0x%x error", desc->noiseampth_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->ustepn_reg, &cali_cfg->data[2], desc->ustepn_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp read reg0x%x error", desc->ustepn_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->alphan_reg, &cali_cfg->data[3], desc->alphan_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp read reg0x%x error", desc->alphan_reg); + return ret; + } + + return 0; +} + +static int aw_cali_svc_set_cali_cfg(struct aw_device *aw_dev, + struct cali_cfg cali_cfg) +{ + int ret = -1; + struct aw_cali_cfg_desc *desc = &aw_dev->cali_desc.cali_cfg_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + ret = aw_dev->ops.aw_dsp_write(aw_dev, + desc->actampth_reg, cali_cfg.data[0], desc->actampth_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp write reg0x%x error", desc->actampth_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_write(aw_dev, + desc->noiseampth_reg, cali_cfg.data[1], desc->noiseampth_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp write reg0x%x error", desc->noiseampth_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_write(aw_dev, + desc->ustepn_reg, cali_cfg.data[2], desc->ustepn_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp write reg0x%x error", desc->ustepn_reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_write(aw_dev, + desc->alphan_reg, cali_cfg.data[3], desc->alphan_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp write reg0x%x error", desc->alphan_reg); + return ret; + } + + return 0; +} + +static int aw_cali_svc_set_dsp_status(struct aw_device *aw_dev, uint32_t status) +{ + int ret = -1; + uint32_t msg_len = sizeof(uint32_t); + + ret = aw883xx_device_params(aw_dev, AW_DEV_DSP_PARAMS, + (void *)&status, msg_len, AW_SET_DEV_PARAMS); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write_params failed"); + return ret; + } + + return 0; +} + +static int aw_cali_svc_get_smooth_cali_re(struct aw_device *aw_dev) +{ + int ret = -1; + int i = 0; + uint32_t re_temp[AW_CALI_READ_CNT_MAX] = { 0 }; + uint32_t dsp_re; + + aw_dev_dbg(aw_dev->dev, "enter"); + + for (i = 0; i < AW_CALI_READ_CNT_MAX; i++) { + ret = aw_cali_svc_get_dev_re(aw_dev, &re_temp[i]); + if (ret < 0) { + goto cali_re_fail; + } + + AW_MS_DELAY(30);/*delay 30 ms*/ + } + + dsp_re = aw_cali_svc_del_max_min_ave_algo(re_temp, + AW_CALI_READ_CNT_MAX); + + ret = aw_cali_svc_get_iv_st(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, + "get iv data failed"); + goto cali_re_fail; + } + + if (dsp_re < aw_dev->re_range.re_min || dsp_re > aw_dev->re_range.re_max) { + aw_dev_err(aw_dev->dev, + "out range re value: %d", dsp_re); + aw_dev->cali_desc.cali_re = dsp_re; + if (aw_dev->cali_desc.cali_check_st) + aw_dev->cali_desc.cali_result = CALI_RESULT_ERROR; + aw_cali_svc_run_mute(aw_dev, aw_dev->cali_desc.cali_result); + return 0; + } + + if (aw_dev->cali_desc.cali_check_st) + aw_dev->cali_desc.cali_result = CALI_RESULT_NORMAL; + + aw_dev->cali_desc.cali_re = dsp_re; + aw_dev_info(aw_dev->dev, "re[%d]mohm", aw_dev->cali_desc.cali_re); + + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_BYPASS); + aw883xx_set_cali_re((void *)aw_dev); + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_WORK); + + return 0; +cali_re_fail: + if (aw_dev->cali_desc.cali_check_st) + aw_dev->cali_desc.cali_result = CALI_RESULT_ERROR; + aw_cali_svc_run_mute(aw_dev, aw_dev->cali_desc.cali_result); + return -EINVAL; + +} + +static int aw_cali_svc_cali_en(struct aw_device *aw_dev, bool cali_en) +{ + int ret = -1; + struct cali_cfg set_cfg; + + aw_dev_info(aw_dev->dev, "cali_en:%d", cali_en); + + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_BYPASS); + if (cali_en) { + ret = aw_cali_svc_get_cali_cfg(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get cali cfg failed"); + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_WORK); + return ret; + } + set_cfg.data[0] = 0; + set_cfg.data[1] = 0; + set_cfg.data[2] = 0xffffffff; + set_cfg.data[3] = 1; + + ret = aw_cali_svc_set_cali_cfg(aw_dev, set_cfg); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set cali cfg failed"); + aw_cali_svc_set_cali_cfg(aw_dev, aw_dev->cali_desc.cali_cfg); + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_WORK); + return ret; + } + } else { + aw_cali_svc_set_cali_cfg(aw_dev, aw_dev->cali_desc.cali_cfg); + } + aw_cali_svc_set_dsp_status(aw_dev, AW_DEV_DSP_WORK); + + return 0; +} + +static int aw_cali_svc_cali_run_dsp_vol(struct aw_device *aw_dev, + int type, bool enable) +{ + int ret = -1; + uint16_t reg_val = 0; + uint16_t set_vol = 0; + struct aw_dsp_vol_desc *desc = &aw_dev->dsp_vol_desc; + + aw_dev_info(aw_dev->dev, "type:%d, enable:%d", type, enable); + + if (enable) { + /*set dsp vol*/ + if (type == CALI_TYPE_RE) { + set_vol = desc->mute_st; + } else if (type == CALI_TYPE_F0) { + set_vol = desc->noise_st; + } else { + aw_dev_err(aw_dev->dev, "type:%d unsupported", type); + return -EINVAL; + } + + ret = aw_dev->ops.aw_reg_read(aw_dev, + desc->reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read reg 0x%x failed", desc->reg); + return ret; + } + + aw_dev->cali_desc.store_vol = reg_val & (~desc->mask); + reg_val &= desc->mask; + reg_val |= set_vol; + + ret = aw_dev->ops.aw_reg_write(aw_dev, + desc->reg, reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write reg 0x%x failed", desc->reg); + return ret; + } + } else { + /*reset dsp vol*/ + ret = aw_dev->ops.aw_reg_read(aw_dev, + desc->reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read reg 0x%x failed", desc->reg); + return ret; + } + + reg_val &= desc->mask; + reg_val |= aw_dev->cali_desc.store_vol; + + ret = aw_dev->ops.aw_reg_write(aw_dev, + desc->reg, reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write reg 0x%x failed", desc->reg); + return ret; + } + } + + return 0; +} + +static int aw_cali_svc_set_white_noise(struct aw_device *aw_dev, + bool noise_enable) +{ + int ret = -1; + uint32_t reg_val; + struct aw_noise_desc *desc = &aw_dev->cali_desc.noise_desc; + + aw_dev_info(aw_dev->dev, "set noise %s", + (noise_enable == 0) ? ("disable") : ("enable")); + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->dsp_reg, ®_val, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read dsp reg 0x%x failed", desc->dsp_reg); + return ret; + } + + if (noise_enable) { + reg_val |= (~desc->mask); + } else { + reg_val &= desc->mask; + } + + ret = aw_dev->ops.aw_dsp_write(aw_dev, + desc->dsp_reg, reg_val, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write dsp reg 0x%x failed", desc->dsp_reg); + return ret; + } + + return 0; +} + +static int aw_cali_svc_cali_f0_en(struct aw_device *aw_dev, bool f0_enable) +{ + int ret = -1; + struct aw_cali_delay_desc *desc = &aw_dev->cali_desc.cali_delay_desc; + + aw_dev_info(aw_dev->dev, "cali f0 %s", + (f0_enable == 0) ? ("disable") : ("enable")); + + if (f0_enable) { + ret = aw_cali_svc_cali_run_dsp_vol(aw_dev, CALI_TYPE_F0, true); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "run dsp volume error, ret=%d", ret); + return ret; + } + AW_MS_DELAY(desc->delay); + + ret = aw_cali_svc_set_white_noise(aw_dev, true); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write white noise error, ret=%d", ret); + aw_cali_svc_cali_run_dsp_vol(aw_dev, CALI_TYPE_F0, false); + return ret; + } + } else { + aw_cali_svc_set_white_noise(aw_dev, false); + aw_cali_svc_cali_run_dsp_vol(aw_dev, CALI_TYPE_F0, false); + } + + return 0; +} + +static int aw_cali_svc_get_cali_f0_q(struct aw_device *aw_dev) +{ + int ret = -1; + int cnt = 0; + uint32_t f0 = 0; + uint32_t q = 0; + uint32_t f0_sum = 0; + uint32_t q_sum = 0; + struct aw_cali_desc *cali_desc = &aw_dev->cali_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + for (cnt = 0; cnt < F0_READ_CNT_MAX; cnt++) { + /*f0*/ + ret = aw_cali_svc_get_dev_f0(aw_dev, &f0); + if (ret < 0) { + return ret; + } + f0_sum += f0; + + /*q*/ + ret = aw_cali_svc_get_dev_q(aw_dev, &q); + if (ret < 0) { + return ret; + } + q_sum += q; + AW_MS_DELAY(30); + } + + cali_desc->f0 = f0_sum / cnt; + cali_desc->q = q_sum / cnt; + + ret = aw_cali_svc_get_iv_st(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, + "get iv data failed, set default f0: 2600 q: 2600"); + cali_desc->f0 = 2600; + cali_desc->q = 2600; + } + + aw_dev_info(aw_dev->dev, "f0[%d] q[%d]", cali_desc->f0, cali_desc->q); + return 0; +} + +static int aw_cali_svc_cali_mode_enable(struct aw_device *aw_dev, + int type, unsigned int flag, bool is_enable) +{ + int ret = -1; + int32_t crc_switch_set = -1; + + aw_dev_info(aw_dev->dev, "type:%d, flag:0x%x, is_enable:%d", + type, flag, is_enable); + + if (is_enable) { + if (aw_dev->crc_check_realtime_desc.init_switch) { + crc_switch_set = aw_dev->crc_check_realtime_desc.disable; + ret = aw883xx_device_params(aw_dev, AW_DEV_REALTIME_CRC_SET_PARAMS, + (void *)&crc_switch_set, sizeof(crc_switch_set), AW_SET_DEV_PARAMS); + } + + ret = aw_cali_svc_cali_init_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "init check failed"); + return ret; + } + + aw_cali_svc_set_cali_status(aw_dev, true); + + ret = aw_cali_svc_cali_en(aw_dev, true); + if (ret < 0) { + aw_cali_svc_set_cali_status(aw_dev, false); + return ret; + } + + if ((type == CALI_TYPE_RE) && (flag & CALI_OPS_HMUTE)) { + ret = aw_cali_svc_cali_run_dsp_vol(aw_dev, CALI_TYPE_RE, true); + if (ret < 0) { + aw_cali_svc_cali_en(aw_dev, false); + aw_cali_svc_set_cali_status(aw_dev, false); + return ret; + } + } else if ((type == CALI_TYPE_F0) && (flag & CALI_OPS_NOISE)) { + ret = aw_cali_svc_cali_f0_en(aw_dev, true); + if (ret < 0) { + aw_cali_svc_cali_en(aw_dev, false); + aw_cali_svc_set_cali_status(aw_dev, false); + return ret; + } + } + } else { + + if ((type == CALI_TYPE_RE) && (flag & CALI_OPS_HMUTE)) { + aw_cali_svc_cali_run_dsp_vol(aw_dev, CALI_TYPE_RE, false); + } else if ((type == CALI_TYPE_F0) && (flag & CALI_OPS_NOISE)) { + aw_cali_svc_cali_f0_en(aw_dev, false); + } + aw_cali_svc_cali_en(aw_dev, false); + aw883xx_device_status(aw_dev, AW_DEV_CLEAR_INT_STATUS, AW_SET_DEV_STATUS); + aw_cali_svc_set_cali_status(aw_dev, false); + + if (aw_dev->crc_check_realtime_desc.init_switch) { + crc_switch_set = aw_dev->crc_check_realtime_desc.enable; + ret = aw883xx_device_params(aw_dev, AW_DEV_REALTIME_CRC_SET_PARAMS, + (void *)&crc_switch_set, sizeof(crc_switch_set), AW_SET_DEV_PARAMS); + } + } + + return 0; +} + +static int aw_cali_svc_devs_cali_mode_enable(int dev_cnt, + int type, unsigned int flag, + bool is_enable) +{ + int ret; + uint8_t cnt; + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw_pr_info("dev[%d]", cnt); + aw883xx = aw883xx_get_dev(cnt); + local_dev = aw883xx->aw_pa; + if (is_enable) { + aw_cali_svc_run_mute(local_dev, CALI_RESULT_NORMAL); + } + ret = aw_cali_svc_cali_mode_enable(local_dev, type, + flag, is_enable); + if (ret < 0) { + return ret; + } + if (!is_enable && (type == CALI_TYPE_F0)) { + aw_cali_svc_run_mute(local_dev, local_dev->cali_desc.cali_result); + } + } + + return ret; +} + +static int aw_cali_svc_dev_cali_re(struct aw_device *aw_dev, unsigned int flag) +{ + int ret = -1; + + aw_dev_info(aw_dev->dev, "enter"); + + aw_cali_svc_run_mute(aw_dev, CALI_RESULT_NORMAL); + + ret = aw_cali_svc_cali_mode_enable(aw_dev, + CALI_TYPE_RE, flag, true); + if (ret < 0) { + return ret; + } + AW_MS_DELAY(g_cali_re_time); + + ret = aw_cali_svc_get_smooth_cali_re(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "cali re failed"); + } + + aw_cali_svc_cali_mode_enable(aw_dev, + CALI_TYPE_RE, flag, false); + + return ret; +} + +static int aw_cali_svc_devs_get_cali_re(int dev_cnt) +{ + int ret; + uint8_t cnt; + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw883xx = aw883xx_get_dev(cnt); + local_dev = aw883xx->aw_pa; + ret = aw_cali_svc_get_smooth_cali_re(local_dev); + if (ret < 0) { + aw_dev_err(local_dev->dev, "get re failed"); + return ret; + } + } + + return ret; +} + +static int aw_cali_svc_devs_cali_re(struct aw_device *aw_dev, unsigned int flag) +{ + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + + aw_dev_info(aw_dev->dev, "enter"); + + ret = aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_RE, + flag, true); + if (ret < 0) + goto error; + + AW_MS_DELAY(g_cali_re_time); + + ret = aw_cali_svc_devs_get_cali_re(dev_cnt); + if (ret < 0) { + goto error; + } + aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_RE, + flag, false); + + return 0; +error: + aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_RE, + flag, false); + return ret; +} + +static int aw_cali_svc_cali_re(struct aw_device *aw_dev, aw_single_t is_single, unsigned int flag) +{ + if (is_single) { + return aw_cali_svc_dev_cali_re(aw_dev, flag); + } else { + return aw_cali_svc_devs_cali_re(aw_dev, flag); + } +} + +static int aw_cali_svc_dev_cali_f0_q(struct aw_device *aw_dev, unsigned int flag) +{ + int ret = -1; + + aw_cali_svc_run_mute(aw_dev, CALI_RESULT_NORMAL); + + ret = aw_cali_svc_cali_mode_enable(aw_dev, CALI_TYPE_F0, flag, true); + if (ret < 0) { + return ret; + } + AW_MS_DELAY(AW_CALI_F0_TIME); + + ret = aw_cali_svc_get_cali_f0_q(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get f0 q failed"); + } + aw_cali_svc_cali_mode_enable(aw_dev, CALI_TYPE_F0, flag, false); + + aw_cali_svc_run_mute(aw_dev, aw_dev->cali_desc.cali_result); + + return ret; +} + +static int aw_cali_svc_devs_get_cali_f0_q(int dev_cnt) +{ + int ret = -1; + uint8_t cnt; + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw883xx = aw883xx_get_dev(cnt); + local_dev = aw883xx->aw_pa; + ret = aw_cali_svc_get_cali_f0_q(local_dev); + if (ret < 0) { + aw_dev_err(local_dev->dev, "get f0 q failed"); + return ret; + } + } + + return ret; +} + +static int aw_cali_svc_devs_cali_f0_q(struct aw_device *aw_dev, unsigned int flag) +{ + int ret = -1; + int dev_cnt = aw883xx_get_dev_num(); + + ret = aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_F0, + flag, true); + if (ret < 0) { + goto error; + } + AW_MS_DELAY(AW_CALI_F0_TIME); + + ret = aw_cali_svc_devs_get_cali_f0_q(dev_cnt); + if (ret < 0) { + goto error; + } + aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_F0, + flag, false); + + return 0; +error: + aw_cali_svc_devs_cali_mode_enable(dev_cnt,CALI_TYPE_F0, + flag, false); + return ret; +} + +static int aw_cali_svc_cali_f0_q(struct aw_device *aw_dev, aw_single_t is_single, unsigned int flag) +{ + if (is_single) { + return aw_cali_svc_dev_cali_f0_q(aw_dev, flag); + } else { + return aw_cali_svc_devs_cali_f0_q(aw_dev, flag); + } +} + +static int aw_cali_svc_get_dev_cali_val(struct aw_device *aw_dev, int type, uint32_t *data_buf) +{ + switch (type) { + case GET_RE_TYPE: + *data_buf = aw_dev->cali_desc.cali_re; + break; + case GET_F0_TYPE: + *data_buf = aw_dev->cali_desc.f0; + break; + case GET_Q_TYPE: + *data_buf = aw_dev->cali_desc.q; + break; + default: + aw_dev_err(aw_dev->dev, "type:%d not support", type); + return -EINVAL; + } + + return 0; +} + +static int aw_cali_svc_get_devs_cali_val(struct aw_device *aw_dev, int type, uint32_t *data_buf, int num) +{ + struct aw883xx *aw883xx = NULL; + struct aw_device *local_dev = NULL; + uint8_t cnt = 0; + uint8_t i; + int dev_cnt = aw883xx_get_dev_num(); + + for (i = 0; i < dev_cnt; i++) { + aw883xx = aw883xx_get_dev(i); + local_dev = aw883xx->aw_pa; + if (local_dev->dev < num) { + switch (type) { + case GET_RE_TYPE: + data_buf[local_dev->dev] = local_dev->cali_desc.cali_re; + break; + case GET_F0_TYPE: + data_buf[local_dev->dev] = local_dev->cali_desc.f0; + break; + case GET_Q_TYPE: + data_buf[local_dev->dev] = local_dev->cali_desc.q; + break; + default: + aw_dev_err(local_dev->dev, "type:%d not support", type); + return -EINVAL; + } + cnt++; + } else { + aw_dev_err(local_dev->dev, "channel num[%d] overflow buf num[%d]", + local_dev->dev, num); + return -EINVAL; + } + } + return cnt; +} + + + +static int aw_cali_svc_cali_re_f0_q(struct aw_device *aw_dev, aw_single_t is_single, unsigned int flag) +{ + int ret = -1; + + ret = aw_cali_svc_cali_re(aw_dev, is_single, flag); + if (ret < 0) { + return ret; + } + ret = aw_cali_svc_cali_f0_q(aw_dev, is_single, flag); + if (ret < 0) { + return ret; + } + return 0; +} + + + +/*****************************Calibration Interface******************************************************/ + +int aw883xx_cail_re_cali(void *dev, aw_single_t is_single) +{ + int ret = -1; + struct aw_device *aw_dev = dev; + + aw_dev_info(aw_dev->dev, "enter"); + + ret = aw_cali_svc_cali_re(aw_dev, is_single, CALI_OPS_HMUTE); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "cali re failed"); + return -EINVAL; + } + + return 0; +} + +int aw883xx_cali_f0_q_cali(void *dev, aw_single_t is_single) +{ + int ret = -1; + struct aw_device *aw_dev = dev; + + aw_dev_info(aw_dev->dev, "enter"); + + ret = aw_cali_svc_cali_f0_q(aw_dev, is_single, CALI_OPS_NOISE); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "cali f0 failed"); + return -EINVAL; + } + + return 0; +} + +int aw883xx_cali_re_f0_cali(void *dev, aw_single_t is_single) +{ + int ret = -1; + struct aw_device *aw_dev = dev; + + aw_dev_info(aw_dev->dev, "enter"); + + ret = aw_cali_svc_cali_re_f0_q(aw_dev, is_single, CALI_OPS_HMUTE|CALI_OPS_NOISE); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "cali re or f0 failed"); + return -EINVAL; + } + + return 0; +} + + +int aw883xx_cali_get_re_range(void *dev, aw_single_t is_single, uint32_t *range_buf) +{ + struct aw_device *aw_dev = dev; + int ret = -1; + uint8_t cnt; + + int dev_cnt = aw883xx_get_dev_num(); + + if (is_single) { + aw_cali_svc_get_dev_re_range(aw_dev, range_buf); + + aw_dev_info(aw_dev->dev, "re_min value: [%d]", range_buf[RE_MIN_FLAG]); + aw_dev_info(aw_dev->dev, "re_max value: [%d]", range_buf[RE_MAX_FLAG]); + } else { + ret = aw_cali_svc_get_devs_re_range(aw_dev, range_buf, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_dev_err(aw_dev->dev, "get re_range failed"); + return -EINVAL; + } + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw_pr_info("dev[%d]:re_min:%d re_max:%d", cnt, + range_buf[RE_MIN_FLAG + cnt * RE_RANGE_NUM], range_buf[RE_MAX_FLAG + cnt * RE_RANGE_NUM]); + } + } + return 0; +} + + +int aw883xx_cali_get_r0(void *dev, aw_single_t is_single, uint32_t *r0_data) +{ + struct aw_device *aw_dev = dev; + int ret = -1; + uint8_t cnt; + + int dev_cnt = aw883xx_get_dev_num(); + + if (is_single) { + ret = aw_cali_svc_get_dev_r0(aw_dev, r0_data); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get r0 failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "r0:%d mOhms", *r0_data); + } else { + ret = aw_cali_svc_get_devs_r0(aw_dev, r0_data, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_dev_err(aw_dev->dev, "get r0 failed"); + return -EINVAL; + } + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw_pr_info("dev[%d]r0:%d mOhms", cnt, r0_data[cnt]); + } + } + return 0; +} + +int aw883xx_cali_get_f0(void *dev, aw_single_t is_single, uint32_t *f0) +{ + uint8_t cnt; + int ret = -1; + struct aw_device *aw_dev = dev; + + int dev_cnt = aw883xx_get_dev_num(); + + aw_dev_info(aw_dev->dev, "enter"); + + if (is_single) { + aw_cali_svc_get_dev_f0(aw_dev, f0); + aw_dev_info(aw_dev->dev, "f0:%u Hz", *f0); + } else { + ret = aw_cali_svc_get_devs_f0(aw_dev, f0, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_pr_err("dev[%d] get f0 failed", cnt); + return -EINVAL; + } + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw_pr_info("dev[%d]f0:%u Hz", cnt, f0[cnt]); + } + } + return 0; +} + +int aw883xx_cali_get_te(void *dev, aw_single_t is_single, int32_t *te_data) +{ + struct aw_device *aw_dev = dev; + int ret = -1; + uint8_t cnt; + + int dev_cnt = aw883xx_get_dev_num(); + + if (is_single) { + ret = aw_cali_svc_get_dev_te(aw_dev, &aw_dev->cali_desc, te_data); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get te failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "te:%d", *te_data); + } else { + ret = aw_cali_svc_get_devs_te(aw_dev, te_data, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_dev_err(aw_dev->dev, "get te failed"); + return -EINVAL; + } else { + for (cnt = 0; cnt < dev_cnt; cnt++) { + aw_pr_info("dev[%d]te:%d", cnt, te_data[cnt]); + } + } + } + return 0; +} + +int aw883xx_cali_f0_show(void *dev, aw_single_t is_single, uint32_t *f0) +{ + uint8_t cnt; + int ret = -1; + struct aw_device *aw_dev = dev; + int dev_cnt = aw883xx_get_dev_num(); + + aw_dev_info(aw_dev->dev, "enter"); + + if (is_single) { + ret = aw_cali_svc_get_dev_cali_val(aw_dev, GET_F0_TYPE, f0); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get q failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "f0:%u Hz", *f0); + } else { + for (cnt = 0; cnt < dev_cnt; cnt++) { + ret = aw_cali_svc_get_devs_cali_val(aw_dev, GET_F0_TYPE, f0, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_pr_err("dev[%d] get f0 failed", cnt); + return -EINVAL; + } + aw_pr_info("dev[%d]f0:%u Hz", cnt, f0[cnt]); + } + } + return 0; +} + +int aw883xx_cali_q_show(void *dev, aw_single_t is_single, uint32_t *q) +{ + int ret = -1; + uint8_t cnt; + struct aw_device *aw_dev = dev; + + int dev_cnt = aw883xx_get_dev_num(); + + aw_dev_info(aw_dev->dev, "enter"); + + if (is_single) { + ret = aw_cali_svc_get_dev_cali_val(aw_dev, GET_Q_TYPE, q); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get q failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "q:%u", *q); + } else { + for (cnt = 0; cnt < dev_cnt; cnt++) { + ret = aw_cali_svc_get_devs_cali_val(aw_dev, GET_Q_TYPE, q, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_pr_err("dev[%d] get q failed", cnt); + return -EINVAL; + } + aw_pr_info("dev[%d]q:%u", cnt, q[cnt]); + } + } + return 0; +} + +int aw883xx_cali_re_show(void *dev, aw_single_t is_single, uint32_t *re) +{ + int ret = -1; + uint8_t cnt; + struct aw_device *aw_dev = dev; + int dev_cnt = aw883xx_get_dev_num(); + + aw_dev_info(aw_dev->dev, "enter"); + + if (is_single) { + ret = aw_cali_svc_get_dev_cali_val(aw_dev, GET_RE_TYPE, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get re failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "cali_re:%umOhms", *re); + } else { + for (cnt = 0; cnt < dev_cnt; cnt++) { + ret = aw_cali_svc_get_devs_cali_val(aw_dev, GET_RE_TYPE, re, AW_DEV_CH_MAX); + if (ret <= 0) { + aw_pr_err("dev[%d] get re failed", cnt); + return -EINVAL; + } + aw_pr_info("dev[%d]cali_re:%umOhms", cnt, re[cnt]); + } + } + return 0; +} + +int aw883xx_cali_store_cali_re(void *dev, aw_single_t is_single, uint32_t *set_re) +{ + struct aw_device *aw_dev = dev; + uint32_t re; + int ret = -1; + + if (is_single) { + re = set_re[aw_dev->dev]; + ret = aw_cali_store_cali_re(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "store cali re failed!"); + return -EINVAL; + } + } else { + ret = aw_cali_devs_store_cali_re(aw_dev, set_re); + if (ret < 0) { + aw_pr_err("set devs_re failed"); + return -EINVAL; + } + } + return 0; +} + +int aw883xx_cali_read_re_from_dsp(void *dev, uint32_t *re) +{ + struct aw_device *aw_dev = dev; + int ret = -1; + + ret = aw_cali_svc_read_cali_re_from_pa(aw_dev, re); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read re from dsp failed"); + return -EINVAL; + } + aw_dev_info(aw_dev->dev, "dsp_re:%d", *re); + return 0; +} + +int aw883xx_cali_show_cali_time(uint32_t *time) +{ + *time = g_cali_re_time; + aw_pr_info("time:%u", *time); + return 0; +} + + +int aw883xx_cali_store_cali_time(uint32_t time) +{ + if (time < 1000) { + aw_pr_err( "time:%d is too short, no set", time); + return -EINVAL; + } + + g_cali_re_time = time; + aw_pr_info("time:%u", g_cali_re_time); + return 0; +} + +#endif + diff --git a/code/sdk/application/audio/vendor/aw88166/aw883xx_device.c b/code/sdk/application/audio/vendor/aw88166/aw883xx_device.c new file mode 100644 index 000000000..7a1216391 --- /dev/null +++ b/code/sdk/application/audio/vendor/aw88166/aw883xx_device.c @@ -0,0 +1,2341 @@ +/* +* aw883xx_device.c aw883xx codec driver +* +* Copyright (c) 2021 AWINIC Technology CO., LTD +* +* Author: +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + +#include +#include +#include + + +#include "aw883xx_base.h" +#include "aw883xx_device.h" +#include "aw_profile_process.h" + +#define AW_DEV_SYSST_CHECK_MAX (10) + +static unsigned int g_fade_in_time = AW_1_MS; +static unsigned int g_fade_out_time = AW_1_MS; + + +#ifdef AW_MONITOR +extern int aw883xx_monitor_init(void *dev); +extern void aw883xx_monitor_start(void *dev); +extern void aw883xx_monitor_stop(void *dev); +extern void aw883xx_monitor_deinit(void *dev); +extern int aw883xx_monitor_work_func(void *dev); +extern void aw883xx_monitor_set_handle(void *dev); +extern void aw883xx_monitor_update_st(void *dev, monitor_update_t type); + +void aw883xx_dev_get_monitor_func(struct aw_device *aw_dev) +{ + aw_dev->ops.aw_monitor_init = aw883xx_monitor_init; + aw_dev->ops.aw_monitor_start = aw883xx_monitor_start; + aw_dev->ops.aw_monitor_stop = aw883xx_monitor_stop; + aw_dev->ops.aw_monitor_deinit = aw883xx_monitor_deinit; + aw_dev->ops.aw_monitor_work_func = aw883xx_monitor_work_func; + aw_dev->ops.aw_monitor_set_handle = aw883xx_monitor_set_handle; +} + +#else +void aw883xx_dev_get_monitor_func(struct aw_device *aw_dev) +{ + aw_dev->ops.aw_monitor_init = NULL; + aw_dev->ops.aw_monitor_start = NULL; + aw_dev->ops.aw_monitor_stop = NULL; + aw_dev->ops.aw_monitor_deinit = NULL; + aw_dev->ops.aw_monitor_work_func = NULL; + aw_dev->ops.aw_monitor_work_func = NULL; + aw_dev->ops.aw_monitor_set_handle = NULL; +} +#endif + + +int aw883xx_dev_check_prof(uint32_t dev, struct aw_prof_info *prof_info) +{ + struct aw_prof_desc *prof_desc = NULL; + int i = 0; + int j = 0; + + if (prof_info == NULL) { + aw_dev_err(dev, "prof_info is NULL"); + return -EINVAL; + } + + if (prof_info->count <= 0) { + aw_dev_err(dev, "prof count :%d unsupported", prof_info->count); + return -EINVAL; + } + + prof_desc = prof_info->prof_desc; + for (i = 0; i < prof_info->count; i++) { + if (prof_desc == NULL) { + aw_dev_err(dev, "invalid prof_desc"); + return -EINVAL; + } + + if (prof_desc->sec_desc->len <= 0) { + aw_dev_err(dev, "prof len:%d unsupported", prof_desc->sec_desc->len); + return -EINVAL; + } + + if (prof_desc->sec_desc->data == NULL) { + aw_dev_err(dev, "prof data is NULL"); + return -EINVAL; + } + } + + + for (i = 0; i < prof_info->count; i++) { + for (j = i + 1; j < prof_info->count; j++) { + if (strncmp(prof_info->prof_desc[i].name, prof_info->prof_desc[j].name, AW_PROF_NAME_MAX) == 0) { + aw_dev_err(dev, "prof_desc pos[%d] and prof_desc pos[%d] conflict with prof_name[%s]", + i, j, prof_info->prof_desc[j].name); + return -EINVAL; + } + } + } + + aw_dev_info(dev, "aw_dev_check_prof success"); + + return 0; +} + +struct aw_sec_data_desc *aw883xx_dev_get_prof_data_byname(struct aw_device *aw_dev, char *prof_name, int data_type) +{ + struct aw_sec_data_desc *sec_data = NULL; + struct aw_prof_desc *prof_desc = NULL; + struct aw_prof_info *prof_info = aw_dev->prof_info; + int i = 0; + + if (data_type >= AW_DATA_TYPE_MAX) { + aw_dev_err(aw_dev->dev, "unsupport data type id [%d]", data_type); + return NULL; + } + + for (i = 0; i < prof_info->count; i++) { + if (strncmp(prof_name, prof_info->prof_desc[i].name, AW_PROF_NAME_MAX) == 0) { + prof_desc = &aw_dev->prof_info->prof_desc[i]; + sec_data = &prof_desc->sec_desc[data_type]; + aw_dev_dbg(aw_dev->dev, "get prof[%s] data len[%d]", + prof_desc->name, sec_data->len); + return sec_data; + } + } + + aw_dev_err(aw_dev->dev, "not found prof_name[%s]", prof_name); + return NULL; +} + +static int aw_dev_check_profile_name(struct aw_device *aw_dev, const char *prof_name) +{ + int i =0; + struct aw_prof_info *prof_info = aw_dev->prof_info; + + for (i = 0; i < prof_info->count; i++) { + if (strncmp(prof_name, prof_info->prof_desc[i].name, AW_PROF_NAME_MAX) == 0){ + return 0; + } + } + aw_dev_err(aw_dev->dev, "not found prof_name[%s]", prof_name); + return -EINVAL; +} + +int aw883xx_dev_set_profile_name(struct aw_device *aw_dev, const char *prof_name) +{ + if (aw_dev_check_profile_name(aw_dev, prof_name)) { + return -EINVAL; + } else { + strncpy(aw_dev->set_prof_name, prof_name, AW_PROF_NAME_MAX - 1); + aw_dev_info(aw_dev->dev, "set prof_name[%s]", aw_dev->set_prof_name); + } + return 0; +} + +char *aw883xx_dev_get_profile_name(struct aw_device *aw_dev) +{ + return aw_dev->set_prof_name; +} + +static int aw_dev_prof_init(struct aw_device *aw_dev, struct aw_init_info *init_info) +{ + int i =0; + const char *first_prof_name = NULL; + /*find profile*/ + for (i = 0; i < init_info->mix_chip_count; i++) { + if (init_info->prof_info[i].chip_id == aw_dev->chip_id) { + aw_dev->prof_info = &init_info->prof_info[i]; + first_prof_name = init_info->prof_info[i].prof_desc[0].name; + strncpy(aw_dev->first_prof_name, first_prof_name, AW_PROF_NAME_MAX); + aw_dev_info(aw_dev->dev, "first prof_name[%s]", aw_dev->first_prof_name); + return 0; + } + } + + aw_dev_err(aw_dev->dev, "no supported profile"); + return -EINVAL; +} + +/*****************************awinic device*************************************/ +int aw883xx_dev_reg_dump(struct aw_device *aw_dev) +{ + int reg_num = aw_dev->ops.aw_get_reg_num(); + uint8_t i = 0; + uint16_t reg_val = 0; + + for (i = 0; i < reg_num; i++) { + if (aw_dev->ops.aw_check_rd_access(i)) { + aw_dev->ops.aw_reg_read(aw_dev, i, ®_val); + aw_dev_info(aw_dev->dev, "read: reg = 0x%02x, val = 0x%04x", + i, reg_val); + } + } + return 0; +} + +static int aw_dev_set_volume(struct aw_device *aw_dev, uint32_t set_vol) +{ + uint16_t hw_vol = 0; + int ret = -1; + struct aw_volume_desc *vol_desc = &aw_dev->volume_desc; + + hw_vol = set_vol + vol_desc->init_volume; + + ret = aw_dev->ops.aw_set_hw_volume(aw_dev, hw_vol); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set volume failed"); + return ret; + } + + return 0; +} + +static int aw_dev_get_volume(struct aw_device *aw_dev, uint32_t *get_vol) +{ + int ret = -1; + uint16_t hw_vol = 0; + struct aw_volume_desc *vol_desc = &aw_dev->volume_desc; + + ret = aw_dev->ops.aw_get_hw_volume(aw_dev, &hw_vol); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read volume failed"); + return ret; + } + + *get_vol = hw_vol - vol_desc->init_volume; + + return 0; +} + +static void aw_dev_fade_in(struct aw_device *aw_dev) +{ + int i = 0; + struct aw_volume_desc *desc = &aw_dev->volume_desc; + int fade_step = aw_dev->fade_step; + int fade_in_vol = desc->ctl_volume; + if (!aw_dev->fade_en) { + return; + } + + if (fade_step == 0 || g_fade_in_time == 0) { + aw_dev_set_volume(aw_dev, fade_in_vol); + return; + } + /*volume up*/ + for (i = desc->mute_volume; i >= fade_in_vol; i -= fade_step) { + aw_dev_set_volume(aw_dev, i); + AW_MS_DELAY(g_fade_in_time); + } + if (i != fade_in_vol) { + aw_dev_set_volume(aw_dev, fade_in_vol); + } +} + +static void aw_dev_fade_out(struct aw_device *aw_dev) +{ + int i = 0; + struct aw_volume_desc *desc = &aw_dev->volume_desc; + int fade_step = aw_dev->fade_step; + + if (!aw_dev->fade_en) + return; + + if (fade_step == 0 || g_fade_out_time == 0) { + aw_dev_set_volume(aw_dev, desc->mute_volume); + return; + } + + for (i = desc->ctl_volume; i <= desc->mute_volume; i += fade_step) { + aw_dev_set_volume(aw_dev, i); + AW_MS_DELAY(g_fade_out_time); + } + if (i != desc->mute_volume) { + aw_dev_set_volume(aw_dev, desc->mute_volume); + AW_MS_DELAY(g_fade_out_time); + } + +} + +#ifdef AW_FADE +static int aw_dev_get_fade_vol_step(struct aw_device *aw_dev, uint32_t *fade_step) +{ + *fade_step = aw_dev->fade_step; + + return 0; +} + +static int aw_dev_set_fade_vol_step(struct aw_device *aw_dev, unsigned int step) +{ + aw_dev->fade_step = step; + + return 0; +} + +static int aw_dev_get_fade_time(unsigned int *time, fade_time_t fade_type) +{ + if (fade_type == AW_FADE_IN_TIME) { + *time = g_fade_in_time; + } else if (fade_type == AW_FADE_OUT_TIME) { + *time = g_fade_out_time; + } else { + aw_pr_err("unsupported fade type:%d", fade_type); + return -EINVAL; + } + + return 0; +} + +static int aw_dev_set_fade_time(unsigned int time, fade_time_t fade_type) +{ + if (fade_type == AW_FADE_IN_TIME) { + g_fade_in_time = time; + } else if (fade_type == AW_FADE_OUT_TIME) { + g_fade_out_time = time; + } else { + aw_pr_err("unsupported fade type:%d", fade_type); + return -EINVAL; + } + + return 0; +} +#endif + +#ifdef AW_IRQ +static void aw_dev_interrupt_clear(struct aw_device *aw_dev) +{ + uint16_t reg_val; + + aw_dev->ops.aw_i2c_read(aw_dev, aw_dev->sysst_desc.reg, ®_val); + aw_dev_info(aw_dev->dev,"reg SYSST=0x%x", reg_val); + aw_dev->ops.aw_i2c_read(aw_dev, aw_dev->int_desc.st_reg, ®_val); + aw_dev_info(aw_dev->dev,"reg SYSINT=0x%x", reg_val); + aw_dev->ops.aw_i2c_read(aw_dev, aw_dev->int_desc.mask_reg, ®_val); + aw_dev_info(aw_dev->dev,"reg SYSINTM=0x%x", reg_val); +} +#endif + +static void aw_dev_soft_reset(struct aw_device *aw_dev) +{ + struct aw_soft_rst *reset = &aw_dev->soft_rst; + + aw_dev->ops.aw_i2c_write(aw_dev, reset->reg, reset->reg_value); + aw_dev_info(aw_dev->dev, "soft reset done"); +} + +static void aw_dev_pwd(struct aw_device *aw_dev, bool pwd) +{ + struct aw_pwd_desc *pwd_desc = &aw_dev->pwd_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + if (pwd) { + aw_dev->ops.aw_reg_write_bits(aw_dev, pwd_desc->reg, + pwd_desc->mask, + pwd_desc->enable); + } else { + aw_dev->ops.aw_reg_write_bits(aw_dev, pwd_desc->reg, + pwd_desc->mask, + pwd_desc->disable); + } + aw_dev_info(aw_dev->dev, "done"); +} + +static void aw_dev_amppd(struct aw_device *aw_dev, bool amppd) +{ + struct aw_amppd_desc *amppd_desc = &aw_dev->amppd_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + if (amppd) { + aw_dev->ops.aw_reg_write_bits(aw_dev, amppd_desc->reg, + amppd_desc->mask, + amppd_desc->enable); + } else { + aw_dev->ops.aw_reg_write_bits(aw_dev, amppd_desc->reg, + amppd_desc->mask, + amppd_desc->disable); + } + aw_dev_info(aw_dev->dev, "done"); +} + +static int aw_dev_set_hmute(struct aw_device *aw_dev, uint32_t mute) +{ + int ret = -1; + struct aw_mute_desc *mute_desc = &aw_dev->mute_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + if (mute == AW_DEV_HMUTE_ENABLE) { + aw_dev_fade_out(aw_dev); + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, mute_desc->reg, + mute_desc->mask, mute_desc->enable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write mute enable failed"); + return ret; + } + } else if (mute == AW_DEV_HMUTE_DISABLE) { + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, mute_desc->reg, + mute_desc->mask, mute_desc->disable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write mute disable failed"); + return ret; + } + aw_dev_fade_in(aw_dev); + } else { + aw_dev_err(aw_dev->dev, "unsupported mute state: %d", mute); + return -EINVAL; + } + + aw_dev_info(aw_dev->dev, "done"); + return 0; +} + +static int aw_dev_get_hmute(struct aw_device *aw_dev, uint32_t *status) +{ + uint16_t reg_val = 0; + int ret = -1; + struct aw_mute_desc *desc = &aw_dev->mute_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + ret = aw_dev->ops.aw_reg_read(aw_dev, desc->reg, ®_val); + if (ret < 0) { + return ret; + } + + if (reg_val & (~desc->mask)) { + *status = AW_DEV_HMUTE_ENABLE; + } else { + *status = AW_DEV_HMUTE_DISABLE; + } + + return 0; +} + +static int aw_dev_get_icalk(struct aw_device * aw_dev, int16_t *icalk) +{ + int ret = -1; + uint16_t reg_val = 0; + uint16_t icalkh_val = 0; + uint16_t icalkl_val = 0; + uint16_t icalk_val = 0; + struct aw_efuse_check_desc *efuse_check_desc = &aw_dev->efuse_check_desc; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->icalkh_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read icalkh_reg failed"); + return ret; + } + icalkh_val = reg_val & (~vcalb_desc->icalkh_reg_mask); + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->icalkl_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read icalkl_reg failed"); + return ret; + } + icalkl_val = reg_val & (~vcalb_desc->icalkl_reg_mask); + + if (efuse_check_desc->check_val == AW_EF_AND_CHECK) { + icalk_val = (icalkh_val >> vcalb_desc->icalkh_shift) & (icalkl_val >> vcalb_desc->icalkl_shift); + } else if (efuse_check_desc->check_val == AW_EF_OR_CHECK) { + icalk_val = (icalkh_val >> vcalb_desc->icalkh_shift) | (icalkl_val >> vcalb_desc->icalkl_shift); + } else { + aw_dev_err(aw_dev->dev, "unsupported check type:%d", efuse_check_desc->check_val); + return -EINVAL; + } + + if (icalk_val & (~vcalb_desc->icalk_sign_mask)) { + icalk_val = icalk_val | vcalb_desc->icalk_neg_mask; + } + *icalk = (int16_t)icalk_val; + return 0; +} + +static int aw_dev_get_vcalk(struct aw_device * aw_dev, int16_t *vcalk) +{ + int ret = -1; + uint16_t reg_val = 0; + uint16_t vcalkh_val = 0; + uint16_t vcalkl_val = 0; + uint16_t vcalk_val = 0; + struct aw_efuse_check_desc *efuse_check_desc = &aw_dev->efuse_check_desc; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->vcalkh_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read vcalkh_reg failed"); + return ret; + } + vcalkh_val = reg_val & (~vcalb_desc->vcalkh_reg_mask); + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->vcalkl_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read vcalkl_reg failed"); + return ret; + } + vcalkl_val = reg_val & (~vcalb_desc->vcalkl_reg_mask); + + if (efuse_check_desc->check_val == AW_EF_AND_CHECK) { + vcalk_val = (vcalkh_val >> vcalb_desc->vcalkh_shift) & (vcalkl_val >> vcalb_desc->vcalkl_shift); + } else if (efuse_check_desc->check_val == AW_EF_OR_CHECK) { + vcalk_val = (vcalkh_val >> vcalb_desc->vcalkh_shift) | (vcalkl_val >> vcalb_desc->vcalkl_shift); + } else { + aw_dev_err(aw_dev->dev, "unsupported check type:%d", efuse_check_desc->check_val); + return -EINVAL; + } + + if (vcalk_val & (~vcalb_desc->vcalk_sign_mask)) { + vcalk_val = vcalk_val | vcalb_desc->vcalk_neg_mask; + } + *vcalk = (int16_t)vcalk_val; + return 0; +} + +static int aw_dev_get_internal_vcalk(struct aw_device *aw_dev, int16_t *vcalk) +{ + int ret = -1; + uint16_t reg_val = 0; + uint16_t vcalkh_val = 0; + uint16_t vcalkl_val = 0; + uint16_t vcalk_val = 0; + struct aw_efuse_check_desc *efuse_check_desc = &aw_dev->efuse_check_desc; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->vcalkh_dac_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read vcalkh_dac_reg failed"); + return ret; + } + vcalkh_val = reg_val & (~vcalb_desc->vcalkh_dac_reg_mask); + + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->vcalkl_dac_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read vcalkl_dac_reg failed"); + return ret; + } + vcalkl_val = reg_val & (~vcalb_desc->vcalkl_dac_reg_mask); + + if (efuse_check_desc->check_val == AW_EF_AND_CHECK) { + vcalk_val = (vcalkh_val >> vcalb_desc->vcalkh_dac_shift) & (vcalkl_val >> vcalb_desc->vcalkl_dac_shift); + } else if (efuse_check_desc->check_val == AW_EF_OR_CHECK) { + vcalk_val = (vcalkh_val >> vcalb_desc->vcalkh_dac_shift) | (vcalkl_val >> vcalb_desc->vcalkl_dac_shift); + } else { + aw_dev_err(aw_dev->dev, "unsupported check type:%d", efuse_check_desc->check_val); + return -EINVAL; + } + + if (vcalk_val & (~vcalb_desc->vcalk_dac_sign_mask)) { + vcalk_val = vcalk_val | vcalb_desc->vcalk_dac_neg_mask; + } + *vcalk = (int16_t)vcalk_val; + return 0; +} + +static int aw_dev_vsense_select(struct aw_device *aw_dev, int *vsense_select) +{ + int ret = -1; + struct aw_vsense_desc *desc = &aw_dev->vsense_desc; + uint16_t vsense_reg_val; + + ret = aw_dev->ops.aw_reg_read(aw_dev, desc->vcalb_vsense_reg, &vsense_reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read vsense_reg_val failed"); + return ret; + } + aw_dev_dbg(aw_dev->dev, "vsense_reg = 0x%x", vsense_reg_val); + + if (vsense_reg_val & (~desc->vcalk_vdsel_mask)) { + *vsense_select = AW_DEV_VDSEL_VSENSE; + aw_dev_info(aw_dev->dev, "vsense external"); + return 0; + } + + *vsense_select = AW_DEV_VDSEL_DAC; + aw_dev_info(aw_dev->dev, "vsense internal"); + return 0; +} + +static int aw_dev_set_vcalb_to_hw(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t reg_val = 0; + int16_t icalk = 0; + int16_t vcalk = 0; + int32_t ical_k = 0; + int32_t vcal_k = 0; + int32_t vcalb = 0; + int vsense_select = -1; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + if (aw_dev->vsense_desc.vcalb_vsense_reg) { + ret = aw_dev_vsense_select(aw_dev, &vsense_select); + if (ret < 0) { + return ret; + } + aw_dev_dbg(aw_dev->dev, "vsense_select = %d", vsense_select); + } else { + vsense_select = aw_dev->vsense_desc.vcalb_vsense_default; + } + + ret = aw_dev_get_icalk(aw_dev, &icalk); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get icalk failed"); + return ret; + } + aw_dev_info(aw_dev->dev, "icalk = %d", icalk); + + ical_k = icalk * vcalb_desc->icalk_value_factor + vcalb_desc->cabl_base_value; + + if (vsense_select == AW_DEV_VDSEL_VSENSE) { + ret = aw_dev_get_vcalk(aw_dev, &vcalk); + if (ret < 0) { + return ret; + } + vcal_k = vcalk * vcalb_desc->vcalk_value_factor + vcalb_desc->cabl_base_value; + vcalb = vcalb_desc->vcalb_accuracy * + vcalb_desc->vscal_factor / vcalb_desc->iscal_factor * ical_k / vcal_k * vcalb_desc->init_value; + + aw_dev_info(aw_dev->dev, "icalk=%d, vcalk=%d", icalk, vcalk); + } else if (vsense_select == AW_DEV_VDSEL_DAC) { + ret = aw_dev_get_internal_vcalk(aw_dev, &vcalk); + if (ret < 0) { + return ret; + } + vcal_k = vcalk * vcalb_desc->vcalk_dac_value_factor + vcalb_desc->cabl_base_value; + vcalb = vcalb_desc->vcalb_accuracy * + vcalb_desc->vscal_dac_factor / vcalb_desc->iscal_dac_factor * ical_k / vcal_k * vcalb_desc->init_value; + + aw_dev_info(aw_dev->dev, "icalk=%d, vcalk=%d", icalk, vcalk); + } else { + aw_dev_err(aw_dev->dev, "unsupport vsense status"); + return -EINVAL; + } + + vcalb = vcalb >> vcalb_desc->vcalb_adj_shift; + reg_val = (uint32_t)vcalb; + + aw_dev_info(aw_dev->dev, "vcalb = %d, vcalb_adj = %d", + reg_val, vcalb_desc->init_value >> vcalb_desc->vcalb_adj_shift); + + ret = aw_dev->ops.aw_reg_write(aw_dev, vcalb_desc->vcalb_reg, reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write vcalb_reg failed"); + return ret; + } + return 0; +} + +static int aw_dev_set_vcalb(struct aw_device *aw_dev) +{ + int ret = -1; + + if (aw_dev->ops.aw_set_vcalb) { + ret = aw_dev->ops.aw_set_vcalb(aw_dev); + } else { + ret = aw_dev_set_vcalb_to_hw(aw_dev); + } + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set_vcalb failed"); + return ret; + } + + return 0; +} + +static int aw_dev_get_int_status(struct aw_device *aw_dev, uint32_t *int_val) +{ + int ret = -1; + uint16_t reg_val = 0; + + ret = aw_dev->ops.aw_reg_read(aw_dev, aw_dev->int_desc.st_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read interrupt reg fail, ret=%d", ret); + return ret; + } + + *int_val = reg_val; + aw_dev_dbg(aw_dev->dev, "read interrupt reg = 0x%04x", reg_val); + + return 0; +} + +static int aw_dev_clear_int_status(struct aw_device *aw_dev) +{ + uint32_t reg_val = 0; + + /*read int status and clear*/ + aw_dev_get_int_status(aw_dev, ®_val); + /*make sure int status is clear*/ + aw_dev_get_int_status(aw_dev, ®_val); + aw_dev_info(aw_dev->dev, "done"); + + return 0; +} + +static int aw_dev_get_sysst_value(struct aw_device *aw_dev, uint32_t *value) +{ + int ret = -1; + uint16_t reg_val = 0; + struct aw_sysst_desc *desc = &aw_dev->sysst_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, desc->reg, ®_val); + if(ret < 0) { + aw_dev_err(aw_dev->dev, "read sysst failed"); + return ret; + } + + *value = reg_val; + + return 0; +} + +static bool aw_dev_get_iis_status(struct aw_device *aw_dev) +{ + int ret = -1; + bool status = false; + uint16_t reg_val = 0; + struct aw_sysst_desc *desc = &aw_dev->sysst_desc; + + aw_dev_dbg(aw_dev->dev, "enter"); + + ret = aw_dev->ops.aw_reg_read(aw_dev, desc->reg, ®_val); + if(ret < 0) { + aw_dev_err(aw_dev->dev, "read pll failed"); + return false; + } + + if ((reg_val & desc->pll_check) == desc->pll_check) { + status = true; + } else { + status = false; + aw_dev_err(aw_dev->dev, "check pll lock fail,reg_val:0x%04x", reg_val); + } + + return status; +} + +static int aw_dev_mode1_pll_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t i = 0; + + for (i = 0; i < AW_DEV_SYSST_CHECK_MAX; i++) { + if (!(aw_dev_get_iis_status(aw_dev))) { + aw_dev_err(aw_dev->dev, "mode1 iis signal check error"); + AW_MS_DELAY(AW_2_MS); + } else { + return 0; + } + } + + return ret; +} + +static int aw_dev_mode2_pll_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t i = 0; + uint16_t reg_val = 0; + struct aw_cco_mux_desc *cco_mux_desc = &aw_dev->cco_mux_desc; + + aw_dev->ops.aw_reg_read(aw_dev, cco_mux_desc->reg, ®_val); + reg_val &= (~cco_mux_desc->mask); + if (reg_val == cco_mux_desc->divider) { + aw_dev_dbg(aw_dev->dev, "CCO_MUX is already divider"); + return ret; + } + + /* change mode2 */ + aw_dev->ops.aw_reg_write_bits(aw_dev, cco_mux_desc->reg, + cco_mux_desc->mask, cco_mux_desc->divider); + + for (i = 0; i < AW_DEV_SYSST_CHECK_MAX; i++) { + if (!(aw_dev_get_iis_status(aw_dev))) { + aw_dev_err(aw_dev->dev, "mode2 iis signal check error"); + AW_MS_DELAY(AW_2_MS); + ret = -EINVAL; + } else { + ret = 0; + break; + } + } + + /* change mode1*/ + aw_dev->ops.aw_reg_write_bits(aw_dev, cco_mux_desc->reg, + cco_mux_desc->mask, cco_mux_desc->bypass); + + if (ret == 0) { + AW_MS_DELAY(AW_2_MS); + for (i = 0; i < AW_DEV_SYSST_CHECK_MAX; i++) { + ret = aw_dev_mode1_pll_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "mode2 switch to mode1, iis signal check error"); + AW_MS_DELAY(AW_2_MS); + } else { + break; + } + } + } + + return ret; +} + +static int aw_dev_syspll_check(struct aw_device *aw_dev) +{ + int ret = -1; + + ret = aw_dev_mode1_pll_check(aw_dev); + if (ret < 0) { + aw_dev_info(aw_dev->dev, "mode1 check iis failed try switch to mode2 check"); + ret = aw_dev_mode2_pll_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "mode2 check iis failed"); + return ret; + } + } + + return ret; +} + +int aw883xx_dev_sysst_check(struct aw_device *aw_dev) +{ + int ret = -1; + unsigned char i = 0; + uint16_t reg_val = 0; + unsigned int check_value = 0; + struct aw_sysst_desc *desc = &aw_dev->sysst_desc; + struct aw_noise_gate_en *noise_gate_desc = &aw_dev->noise_gate_en; + + check_value = desc->st_check; + + if (noise_gate_desc->reg != AW_REG_NONE) { + aw_dev->ops.aw_reg_read(aw_dev, noise_gate_desc->reg, ®_val); + if (reg_val & (~noise_gate_desc->noise_gate_mask)) { + check_value = desc->st_check; + } else { + check_value = desc->st_sws_check; + } + } + + for (i = 0; i < AW_DEV_SYSST_CHECK_MAX; i++) { + aw_dev->ops.aw_reg_read(aw_dev, desc->reg, ®_val); + if (((reg_val & (~desc->st_mask)) & check_value) == check_value) { + ret = 0; + break; + } else { + aw_dev_dbg(aw_dev->dev, "check fail, cnt=%d, reg_val=0x%04x", + i, reg_val); + AW_MS_DELAY(AW_2_MS); + } + } + if (ret < 0) { + aw_dev_err(aw_dev->dev, "check fail"); + } + return ret; +} + +static int aw_dev_get_monitor_sysint_st(struct aw_device *aw_dev) +{ + int ret = 0; + struct aw_int_desc *desc = &aw_dev->int_desc; + + if ((desc->intst_mask) & (desc->sysint_st)) { + aw_dev_err(aw_dev->dev, + "monitor check fail:0x%04x", desc->sysint_st); + ret = -EINVAL; + } + desc->sysint_st = 0; + + return ret; +} + +static int aw_dev_sysint_check(struct aw_device *aw_dev) +{ + int ret = 0; + uint32_t reg_val = 0; + struct aw_int_desc *desc = &aw_dev->int_desc; + + ret = aw_dev_get_int_status(aw_dev, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get int status fail ret:%d", ret); + return ret; + } + + if (reg_val & (desc->intst_mask)) { + aw_dev_err(aw_dev->dev, "int check fail:0x%04x", reg_val); + ret = -EINVAL; + } + + return ret; +} + +static void aw_dev_get_cur_mode_st(struct aw_device *aw_dev) +{ + uint16_t reg_val; + struct aw_profctrl_desc *profctrl_desc = &aw_dev->profctrl_desc; + + aw_dev->ops.aw_reg_read(aw_dev, aw_dev->pwd_desc.reg, ®_val); + + if ((reg_val & (~profctrl_desc->mask)) == profctrl_desc->rcv_mode_val) { + profctrl_desc->cur_mode = AW_RCV_MODE; + } else { + profctrl_desc->cur_mode = AW_NOT_RCV_MODE; + } +} + +static int aw_dev_set_intmask(struct aw_device *aw_dev, uint32_t flag) +{ + int ret = -1; + struct aw_int_desc *desc = &aw_dev->int_desc; + + if (flag == AW_DEV_UNMASK_INT_VAL) { + ret = aw_dev->ops.aw_reg_write(aw_dev, desc->mask_reg, + desc->int_mask); + } else if (flag == AW_DEV_MASK_INT_VAL) { + ret = aw_dev->ops.aw_reg_write(aw_dev, desc->mask_reg, + desc->mask_default); + } else { + aw_dev_err(aw_dev->dev, "unsupported flag : %d", flag); + return -EINVAL; + } + + aw_dev_info(aw_dev->dev, "done"); + return ret; +} + +static int aw_dev_dsp_enable(struct aw_device *aw_dev, uint32_t dsp) +{ + int ret = -1; + struct aw_dsp_en_desc *desc = &aw_dev->dsp_en_desc; + + if (dsp == AW_DEV_DSP_WORK) { + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, desc->reg, + desc->mask, desc->enable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "enable dsp failed"); + return ret; + } + } else if (dsp == AW_DEV_DSP_BYPASS) { + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, desc->reg, + desc->mask, desc->disable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "disable dsp failed"); + return ret; + } + } else { + aw_dev_err(aw_dev->dev, "unsupported flag : %d", dsp); + return -EINVAL; + } + + aw_dev_info(aw_dev->dev, "done"); + return 0; +} + +static void aw_dev_memclk_select(struct aw_device *aw_dev, unsigned char flag) +{ + struct aw_memclk_desc *desc = &aw_dev->memclk_desc; + int ret = -1; + + if (flag == AW_DEV_MEMCLK_PLL) { + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, desc->reg, + desc->mask, desc->mcu_hclk); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "memclk select pll failed"); + } + } else if (flag == AW_DEV_MEMCLK_OSC) { + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, desc->reg, + desc->mask, desc->osc_clk); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "memclk select OSC failed"); + } + } else { + aw_dev_err(aw_dev->dev, "unknown memclk config, flag=0x%x", flag); + } + + aw_dev_info(aw_dev->dev, "done"); +} + +static int aw_dev_get_dsp_status(struct aw_device *aw_dev) +{ + int i = -1; + int ret = -1; + uint16_t reg_val = 0; + struct aw_watch_dog_desc *desc = &aw_dev->watch_dog_desc; + + aw_dev_info(aw_dev->dev, "enter"); + + for (i = 0; i < AW_DEV_DSP_CHECK_MAX; i++) { + aw_dev->ops.aw_reg_read(aw_dev, desc->reg, ®_val); + if (reg_val & (~desc->mask)) { + return 0; + } + AW_MS_DELAY(AW_1_MS); + } + + return ret; +} + +static bool aw_dev_get_pll_wdt_status(struct aw_device *aw_dev) +{ + int ret = -1; + + ret = aw_dev_syspll_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "pll abnormal"); + return false; + } + + ret = aw_dev_get_dsp_status(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp not work"); + return false; + } + return true; +} + +static int aw_dev_get_cali_f0_delay(struct aw_device *aw_dev) +{ + struct aw_cali_delay_desc *desc = &aw_dev->cali_desc.cali_delay_desc; + uint32_t cali_delay = 0; + int ret = -1; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + desc->dsp_reg, &cali_delay, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read cali delay failed, ret=%d", ret); + return ret; + } + + desc->delay = AW_CALI_DELAY_CACL(cali_delay); + aw_dev_info(aw_dev->dev, "read cali delay: %d ms", desc->delay); + + return 0; +} + +/****************************************************** + * + * aw_dev update cfg + * + ******************************************************/ + +static int aw_dev_get_crc_flag(struct aw_device *aw_dev) +{ + return aw_dev->dsp_crc_st; + +} + +static int aw_dev_set_crc_flag(struct aw_device *aw_dev, uint32_t status) +{ + aw_dev->dsp_crc_st = status; + return 0; +} + +static int aw_dev_cfg_crc_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t reg_val; + uint16_t check_val; + uint16_t cfg_len_val; + struct aw_crc_check_desc *crc_check_desc = &aw_dev->crc_check_desc; + + /*calculate cfg_end_addr*/ + cfg_len_val = ((aw_dev->dsp_cfg_len / AW_FW_ADDR_LEN) - 1) + + crc_check_desc->crc_cfg_base_addr; + aw_dev_info(aw_dev->dev, "cfg_end_addr 0x%x", cfg_len_val); + + /*write cfg_end_addr to crc_end_addr*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_end_addr_mask, cfg_len_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write cfg_len_val failed"); + return ret; + } + + /*enable cfg crc check*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_cfg_check_en_mask, crc_check_desc->crc_cfgcheck_enable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write crc_check_enable failed"); + return ret; + } + + AW_MS_DELAY(AW_1_MS); + /*read crc check result*/ + ret = aw_dev->ops.aw_reg_read(aw_dev, crc_check_desc->crc_check_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read crc_check_reg failed"); + return ret; + } + + check_val = (reg_val & (~crc_check_desc->crc_check_mask)) >> crc_check_desc->crc_check_bits_shift; + + /*disable cfg crc check*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_cfg_check_en_mask, crc_check_desc->crc_cfgcheck_disable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write crc_check_disable failed"); + return ret; + } + + /*compare crc check result and pass value*/ + if (check_val != crc_check_desc->crc_check_pass) { + aw_dev_err(aw_dev->dev, "crc_check failed,check val %x != %x", check_val, + crc_check_desc->crc_check_pass); + return -EINVAL; + } + + return 0; +} + +static int aw_dev_fw_crc_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t reg_val; + uint16_t check_val; + uint16_t fw_len_val; + struct aw_crc_check_desc *crc_check_desc = &aw_dev->crc_check_desc; + + /*calculate fw_end_addr*/ + fw_len_val = ((aw_dev->dsp_fw_len / AW_FW_ADDR_LEN) - 1) + + crc_check_desc->crc_fw_base_addr; + + aw_dev_info(aw_dev->dev, "fw_end_addr 0x%x", fw_len_val); + + /*write fw_end_addr to crc_end_addr*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_end_addr_mask, fw_len_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write fw_len_val failed"); + return ret; + } + /*enable fw crc check*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_fw_check_en_mask, crc_check_desc->crc_fwcheck_enable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write crc_check_enable failed"); + return ret; + } + + AW_MS_DELAY(AW_2_MS); + /*read crc check result*/ + ret = aw_dev->ops.aw_reg_read(aw_dev, crc_check_desc->crc_check_reg, ®_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read crc_check_reg failed"); + return ret; + } + + check_val = (reg_val & (~crc_check_desc->crc_check_mask)) >> crc_check_desc->crc_check_bits_shift; + + /*disable fw crc check*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->crc_ctrl_reg, + crc_check_desc->crc_fw_check_en_mask, crc_check_desc->crc_fwcheck_disable); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write crc_check_disable failed"); + return ret; + } + + /*compare crc check result and pass value*/ + if (check_val != crc_check_desc->crc_check_pass) { + aw_dev_err(aw_dev->dev, "crc_check failed,check val %x != %x", check_val, + crc_check_desc->crc_check_pass); + return -EINVAL; + } + + return 0; +} + +static int aw_dev_hw_crc_check(struct aw_device *aw_dev) +{ + int ret = -1; + struct aw_crc_check_desc *crc_check_desc = &aw_dev->crc_check_desc; + + /*force RAM clock on*/ + ret = aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->ram_clk_reg, + crc_check_desc->ram_clk_mask, crc_check_desc->ram_clk_on); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write ram_clk_on failed"); + return ret; + } + + ret = aw_dev_fw_crc_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, " fw_crc_check failed"); + goto ram_clk_off; + } + + ret = aw_dev_cfg_crc_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, " cfg_crc_check failed"); + goto ram_clk_off; + } + + /*write bin value to crc reg when fw & cfg crc check pass*/ + ret = aw_dev->ops.aw_reg_write(aw_dev, crc_check_desc->crc_ctrl_reg, crc_check_desc->crc_init_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write crc_init_val failed"); + goto ram_clk_off; + } + + /*disable force RAM clock*/ + aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->ram_clk_reg, + crc_check_desc->ram_clk_mask, crc_check_desc->ram_clk_off); + + return 0; +ram_clk_off: + aw_dev->ops.aw_reg_write_bits(aw_dev, crc_check_desc->ram_clk_reg, + crc_check_desc->ram_clk_mask, crc_check_desc->ram_clk_off); + return ret; +} + +static int aw_dev_crc_check(struct aw_device *aw_dev) +{ + int ret = -1; + + if (aw_dev_get_crc_flag(aw_dev) == AW_DSP_CRC_BYPASS) { + aw_dev_info(aw_dev->dev, "CRC Bypass in driver debug process"); + return 0; + } + if (aw_dev->crc_type == AW_SW_CRC_CHECK) { + if (aw_dev->ops.aw_sw_crc_check) { + ret = aw_dev->ops.aw_sw_crc_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp crc check failed"); + return ret; + } + } else { + aw_dev_err(aw_dev->dev, "sw_crc_check ops is NULL"); + return ret; + } + } else if (aw_dev->crc_type == AW_HW_CRC_CHECK) { + ret = aw_dev_hw_crc_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "hw_crc_check failed"); + return ret; + } + } + return 0; +} + +#ifdef AW_MONITOR +static void aw_dev_init_vmax_update(struct aw_device *aw_dev, backup_sec_t flag) +{ + if (flag == AW_RECOVERY_SEC_DATA) { + aw883xx_monitor_update_st(aw_dev, AW_SET_INIT_VMAX); + } else if (flag == AW_RECORD_SEC_DATA) { + aw883xx_monitor_update_st(aw_dev, AW_GET_INIT_VMAX); + } else { + aw_dev_err(aw_dev->dev, "unsupported type:%d", flag); + return; + } +} +#endif + +static int aw_dev_init_vcalb_update(struct aw_device *aw_dev, backup_sec_t flag) +{ + int ret = -1; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + if (aw_dev->ops.aw_init_vcalb_update) { + ret = aw_dev->ops.aw_init_vcalb_update(aw_dev, flag); + if (ret < 0) + aw_dev_err(aw_dev->dev, "write vcalb_reg failed"); + return ret; + } + + if (flag == AW_RECOVERY_SEC_DATA) { + ret = aw_dev->ops.aw_reg_write(aw_dev, vcalb_desc->vcalb_reg, vcalb_desc->init_value); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write vcalb_reg failed"); + return ret; + } + } else if (flag == AW_RECORD_SEC_DATA) { + ret = aw_dev->ops.aw_reg_read(aw_dev, vcalb_desc->vcalb_reg, &vcalb_desc->init_value); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write vcalb_reg failed"); + return ret; + } + } else { + aw_dev_err(aw_dev->dev, "unsupported type:%d", flag); + return -EINVAL; + } + + return 0; +} + +static int aw_dev_get_firmware_ver(struct aw_device *aw_dev) +{ + int ret = -1; + struct aw_fw_ver_desc *fw_ver_desc = &aw_dev->fw_ver_desc; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, + fw_ver_desc->version_reg, &aw_dev->fw_ver, fw_ver_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read firmware version failed, ret=%d", ret); + return ret; + } + + return 0; +} + +/*pwd enable update reg*/ + +static int aw_dev_reg_container_update(struct aw_device *aw_dev, + const uint8_t *data, uint32_t len) +{ + int i = 0; + int ret = -1; + uint8_t reg_addr = 0; + uint16_t reg_val = 0; + uint16_t read_vol = 0; + struct aw_int_desc *int_desc = &aw_dev->int_desc; + struct aw_volume_desc *vol_desc = &aw_dev->volume_desc; + uint16_t *reg_data = NULL; + int data_len; + + aw_dev_dbg(aw_dev->dev, "enter"); + reg_data = (uint16_t *)data; + data_len = len >> 1; + + if (data_len % 2 != 0) { + aw_dev_err(aw_dev->dev, "data len:%d unsupported", + data_len); + return -EINVAL; + } + + for (i = 0; i < data_len; i += 2) { + reg_addr = reg_data[i]; + reg_val = reg_data[i + 1]; + aw_dev_dbg(aw_dev->dev, "reg = 0x%02x, val = 0x%04x", + reg_addr, reg_val); + if (reg_addr == int_desc->mask_reg) { + int_desc->int_mask = reg_val; + reg_val = int_desc->mask_default; + } + if (reg_addr == aw_dev->mute_desc.reg) { + reg_val &= aw_dev->mute_desc.mask; + reg_val |= aw_dev->mute_desc.enable; + } + + if (reg_addr == aw_dev->pwd_desc.reg) { + reg_val &= aw_dev->pwd_desc.mask; + reg_val |= aw_dev->pwd_desc.enable; + } + + if (reg_addr == aw_dev->txen_desc.reg) { + /*get bin value*/ + aw_dev->txen_st = reg_val & (~aw_dev->txen_desc.mask); + aw_dev_dbg(aw_dev->dev, "txen_st=0x%04x", aw_dev->txen_st); + + reg_val &= aw_dev->txen_desc.mask; + reg_val |= aw_dev->txen_desc.disable; + } + + if (reg_addr == aw_dev->dsp_crc_desc.ctl_reg) { + reg_val &= aw_dev->dsp_crc_desc.ctl_mask; + } + + if (reg_addr == aw_dev->volume_desc.reg) { + read_vol = (reg_val & (~aw_dev->volume_desc.mask)) >> + aw_dev->volume_desc.shift; + aw_dev->volume_desc.init_volume = + aw_dev->ops.aw_reg_val_to_db(read_vol); + } + + if (reg_addr == aw_dev->efuse_check_desc.reg) { + if ((reg_val & (~aw_dev->efuse_check_desc.mask)) == + aw_dev->efuse_check_desc.or_val) + aw_dev->efuse_check_desc.check_val = AW_EF_OR_CHECK; + else + aw_dev->efuse_check_desc.check_val = AW_EF_AND_CHECK; + } + + if (reg_addr == aw_dev->crc_check_desc.crc_ctrl_reg) + aw_dev->crc_check_desc.crc_init_val = reg_val; + + if (reg_addr == aw_dev->vcalb_desc.vcalb_reg) { + aw_dev->vcalb_desc.init_value = reg_val; + continue; + } + + if (reg_addr == aw_dev->cali_desc.hw_cali_re_desc.hbits_reg) { + aw_dev->cali_desc.hw_cali_re_desc.re_hbits = reg_val; + continue; + } + + if (reg_addr == aw_dev->cali_desc.hw_cali_re_desc.lbits_reg) { + aw_dev->cali_desc.hw_cali_re_desc.re_lbits = reg_val; + continue; + } + + if (reg_addr == aw_dev->dsp_en_desc.reg) { + if (reg_val & (~aw_dev->dsp_en_desc.mask)) + aw_dev->dsp_cfg = AW_DEV_DSP_BYPASS; + else + aw_dev->dsp_cfg = AW_DEV_DSP_WORK; + reg_val &= aw_dev->dsp_en_desc.mask; + reg_val |= aw_dev->dsp_en_desc.disable; + } + + if(reg_addr == aw_dev->dither_desc.reg) { + aw_dev->dither_st = reg_val & (~aw_dev->dither_desc.mask); + aw_dev_info(aw_dev->dev, "dither_st=0x%04x", aw_dev->dither_st); + } + + ret = aw_dev->ops.aw_reg_write(aw_dev, reg_addr, reg_val); + if (ret < 0) { + break; + } + } + + aw_dev_pwd(aw_dev, false); + AW_MS_DELAY(AW_1_MS);; + + aw_dev_get_cur_mode_st(aw_dev); + + if ((strncmp(aw_dev->cur_prof_name, aw_dev->set_prof_name, AW_PROF_NAME_MAX) != 0)) { + /*clear control volume when PA change profile*/ + vol_desc->ctl_volume = 0; + } else { + /*keep control volume when PA start with sync mode*/ + aw_dev_set_volume(aw_dev, vol_desc->ctl_volume); + } + + /*keep min volume*/ + if (aw_dev->fade_en) { + aw_dev_set_volume(aw_dev, vol_desc->mute_volume); + } + +#ifdef AW_MONITOR + aw883xx_monitor_update_st(aw_dev, AW_HW_MONITOR_ST); +#endif + + aw_dev_dbg(aw_dev->dev, "exit"); + + return ret; +} + + +static int aw_dev_reg_update(struct aw_device *aw_dev) +{ + struct aw_sec_data_desc *reg_data = NULL; + reg_data = aw883xx_dev_get_prof_data_byname(aw_dev, aw_dev->set_prof_name, AW_DATA_TYPE_REG); + + if (reg_data == NULL){ + aw_dev_err(aw_dev->dev, "reg data is null"); + return -EINVAL; + } + + aw_dev_reg_container_update(aw_dev, reg_data->data, reg_data->len); + + aw_dev_dbg(aw_dev->dev, "reg len:%d", reg_data->len); + + return 0; +} + +static int aw_dev_dsp_container_update(struct aw_device *aw_dev, + const uint8_t *dsp_data, uint32_t len, uint16_t base) +{ + uint32_t i; + struct aw_dsp_mem_desc *dsp_mem_desc = &aw_dev->dsp_mem_desc; + uint8_t *data = NULL; + data = (uint8_t *)dsp_data; + +#ifdef AW_DSP_I2C_WRITES + uint32_t tmp_len = 0; +#else + uint16_t reg_val = 0; +#endif + + aw_dev_dbg(aw_dev->dev, "enter"); + aw_mutex_lock(); +#ifdef AW_DSP_I2C_WRITES + /* i2c writes */ + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_madd_reg, base); + + for (i = 0; i < len; i += AW_MAX_RAM_WRITE_BYTE_SIZE) { + if ((len - i) < AW_MAX_RAM_WRITE_BYTE_SIZE) { + tmp_len = len - i; + } else { + tmp_len = AW_MAX_RAM_WRITE_BYTE_SIZE; + } + aw_dev->ops.aw_i2c_writes(aw_dev, dsp_mem_desc->dsp_mdat_reg, + &data[i], tmp_len); + } + +#else + /* i2c write */ + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_madd_reg, base); + + for (i = 0; i < len; i += 2) { + reg_val = (data[i] << 8) + data[i + 1]; + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_mdat_reg, + reg_val); + } +#endif + + aw_mutex_unlock(); + aw_dev_dbg(aw_dev->dev, "exit"); + + return 0; +} + +static int aw_dev_dsp_fw_update(struct aw_device *aw_dev) +{ + struct aw_dsp_mem_desc *dsp_mem_desc = &aw_dev->dsp_mem_desc; + struct aw_sec_data_desc *dsp_fw_data = NULL; + + dsp_fw_data = aw883xx_dev_get_prof_data_byname(aw_dev, aw_dev->set_prof_name, AW_DATA_TYPE_DSP_FW); + + if (dsp_fw_data == NULL) { + aw_dev_err(aw_dev->dev, "dsp firmware data is null"); + return -EINVAL; + } + + aw_dev_dsp_container_update(aw_dev, dsp_fw_data->data, + dsp_fw_data->len, dsp_mem_desc->dsp_fw_base_addr); + aw_dev->dsp_fw_len = dsp_fw_data->len; + aw_dev_dbg(aw_dev->dev, "dsp firmware len:%d", dsp_fw_data->len); + + return 0; +} + +static int aw_dev_crc_realtime_get(struct aw_device *aw_dev, uint32_t *status) +{ + int ret = -1; + struct aw_crc_check_realtime_desc *desc =&aw_dev->crc_check_realtime_desc; + unsigned int crc_realtime_val = 0; + + ret = aw_dev->ops.aw_dsp_read(aw_dev, desc->addr, + &crc_realtime_val, desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get crc_realtime failed"); + return ret; + } + + if (crc_realtime_val & (~desc->mask)) + *status = aw_dev->crc_check_realtime_desc.enable; + else + *status = aw_dev->crc_check_realtime_desc.disable; + + aw_dev_dbg(aw_dev->dev, "get %d", *status); + + return 0; +} + +static int aw_dev_crc_realtime_set(struct aw_device *aw_dev, uint32_t enable) +{ + int ret = -1; + struct aw_crc_check_realtime_desc *crc_desc =&aw_dev->crc_check_realtime_desc; + + aw_dev_dbg(aw_dev->dev, "set %d", enable); + + if (enable) { + ret = aw_dev->ops.aw_dsp_write_bits(aw_dev, crc_desc->addr, + crc_desc->mask, crc_desc->enable, crc_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set enable failed"); + return ret; + } + } else { + ret = aw_dev->ops.aw_dsp_write_bits(aw_dev, crc_desc->addr, + crc_desc->mask, crc_desc->disable, crc_desc->data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "set disable failed"); + return ret; + } + } + + return 0; +} + +int aw883xx_crc_realtime_check(struct aw_device *aw_dev, uint32_t *status) +{ + int ret = -1; + uint16_t sysst_val; + uint32_t crc_check_val; + struct aw_sysst_desc *desc = &aw_dev->sysst_desc; + struct aw_int_desc *int_desc = &aw_dev->int_desc; + struct aw_crc_check_realtime_desc *crc_desc =&aw_dev->crc_check_realtime_desc; + + if (aw_dev_get_crc_flag(aw_dev) == AW_DSP_CRC_BYPASS) { + int_desc->int_mask = int_desc->mask_default; + aw_dev_info(aw_dev->dev, "CRC Bypass in driver debug process"); + return 0; + } + + ret = aw_dev->ops.aw_reg_read(aw_dev, desc->reg, &sysst_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read reg0x%x failed", desc->reg); + return ret; + } + + ret = aw_dev->ops.aw_dsp_read(aw_dev, crc_desc->check_addr, + &crc_check_val, crc_desc->check_data_type); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get crc_check_val failed"); + return ret; + } + + if (((sysst_val & desc->dsp_mask) != desc->dsp_check) && + (crc_check_val & (~crc_desc->check_mask)) == + aw_dev->crc_check_realtime_desc.check_abnormal) { + *status = AW_REALTIME_CRC_CHECK_ABNORMAL; + } else { + *status = AW_REALTIME_CRC_CHECK_NORMAL; + } + + aw_dev_dbg(aw_dev->dev, "check status %d", *status); + + return 0; +} + +static void aw_dev_backup_sec_record(struct aw_device *aw_dev) +{ + aw_dev_init_vcalb_update(aw_dev, AW_RECORD_SEC_DATA); + aw_dev_crc_realtime_get(aw_dev, &aw_dev->crc_check_realtime_desc.init_switch); +#ifdef AW_CALIB + aw883xx_cali_init_re_update(aw_dev, AW_RECORD_SEC_DATA); +#endif +#ifdef AW_MONITOR + aw_dev_init_vmax_update(aw_dev, AW_RECORD_SEC_DATA); +#endif +} + +static void aw_dev_backup_sec_recovery(struct aw_device *aw_dev) +{ + aw_dev_init_vcalb_update(aw_dev, AW_RECOVERY_SEC_DATA); +#ifdef AW_CALIB + aw883xx_cali_init_re_update(aw_dev, AW_RECOVERY_SEC_DATA); +#endif +#ifdef AW_MONITOR + aw_dev_init_vmax_update(aw_dev, AW_RECOVERY_SEC_DATA); +#endif + +} + +static int aw_dev_dsp_cfg_update(struct aw_device *aw_dev) +{ + struct aw_dsp_mem_desc *dsp_mem_desc = &aw_dev->dsp_mem_desc; + struct aw_sec_data_desc *dsp_cfg_data = NULL; + + dsp_cfg_data = aw883xx_dev_get_prof_data_byname(aw_dev, aw_dev->set_prof_name, AW_DATA_TYPE_DSP_CFG); + + if (dsp_cfg_data == NULL) { + aw_dev_err(aw_dev->dev, "dsp config data is null"); + return -EINVAL; + } + + aw_dev_dsp_container_update(aw_dev, + dsp_cfg_data->data, dsp_cfg_data->len, dsp_mem_desc->dsp_cfg_base_addr); + aw_dev->dsp_cfg_len = dsp_cfg_data->len; + aw_dev_dbg(aw_dev->dev, "dsp config len:%d", dsp_cfg_data->len); + + aw_dev_backup_sec_record(aw_dev); + +#ifdef AW_CALIB + aw883xx_cali_get_ra((void *)aw_dev); + aw_dev_get_cali_f0_delay(aw_dev); +#endif + +#ifdef AW_MONITOR + aw883xx_monitor_update_st(aw_dev, AW_DSP_MONITOR_ST); +#endif + + aw_dev_get_firmware_ver(aw_dev); + aw_dev_info(aw_dev->dev, "fw_ver: [%04x]", aw_dev->fw_ver); + + return 0; +} + +static int aw_dev_sram_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t reg_val = 0; + struct aw_dsp_mem_desc *dsp_mem_desc = &aw_dev->dsp_mem_desc; + + aw_mutex_lock(); + + /*read dsp_rom_check_reg*/ + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_madd_reg, + dsp_mem_desc->dsp_rom_check_reg); + aw_dev->ops.aw_i2c_read(aw_dev, dsp_mem_desc->dsp_mdat_reg, ®_val); + if (dsp_mem_desc->dsp_rom_check_data != reg_val) { + aw_dev_err(aw_dev->dev, "check reg 0x40 failed, read[0x%x] does not match write[0x%x]", + reg_val, dsp_mem_desc->dsp_rom_check_data); + goto error; + } + + /*write dsp_cfg_base_addr*/ + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_madd_reg, + dsp_mem_desc->dsp_cfg_base_addr); + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_mdat_reg, + AW_DSP_ODD_NUM_BIT_TEST); + + /*read dsp_cfg_base_addr*/ + aw_dev->ops.aw_i2c_write(aw_dev, dsp_mem_desc->dsp_madd_reg, + dsp_mem_desc->dsp_cfg_base_addr); + aw_dev->ops.aw_i2c_read(aw_dev, dsp_mem_desc->dsp_mdat_reg, ®_val); + if (AW_DSP_ODD_NUM_BIT_TEST != reg_val) { + aw_dev_err(aw_dev->dev, "check dsp cfg failed, read[0x%x] does not match write[0x%x]", + reg_val, AW_DSP_ODD_NUM_BIT_TEST); + goto error; + } + aw_mutex_unlock(); + return 0; + +error: + aw_mutex_unlock(); + return ret; +} + +int aw883xx_device_fw_update(struct aw_device *aw_dev, bool up_dsp_fw_en, bool force_up_en) +{ + int ret = -1; + + aw_dev_info(aw_dev->dev, "enter "); + + if ((strncmp(aw_dev->cur_prof_name, aw_dev->set_prof_name, AW_PROF_NAME_MAX) == 0) && + (force_up_en == AW_FORCE_UPDATE_OFF)) { + aw_dev_info(aw_dev->dev, "scene no change, not update"); + return 0; + } + + /*update reg*/ + ret = aw_dev_reg_update(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "update reg failed"); + return ret; + } + + aw_dev_set_hmute(aw_dev, AW_DEV_HMUTE_ENABLE); + + if (aw_dev->dsp_cfg == AW_DEV_DSP_WORK) { + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); + } + + aw_dev_memclk_select(aw_dev, AW_DEV_MEMCLK_OSC); + + ret = aw_dev_sram_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "check sram failed"); + goto error; + } + + aw_dev_backup_sec_recovery(aw_dev); + + if (up_dsp_fw_en) { + /*update dsp firmware*/ + ret = aw_dev_dsp_fw_update(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "update dsp fw failed"); + goto error; + } + } + + /*update dsp config*/ + ret = aw_dev_dsp_cfg_update(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "update dsp cfg failed"); + goto error; + } + + aw_dev_memclk_select(aw_dev, AW_DEV_MEMCLK_PLL); + + strncpy(aw_dev->cur_prof_name, aw_dev->set_prof_name, AW_PROF_NAME_MAX); + + aw_dev_info(aw_dev->dev, "load [%s] done", aw_dev->cur_prof_name); + return 0; + +error: + aw_dev_memclk_select(aw_dev, AW_DEV_MEMCLK_PLL); + + return ret; +} + +static int aw883xx_dev_dsp_check(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t i = 0; + + aw_dev_dbg(aw_dev->dev, "enter"); + + if (aw_dev->dsp_cfg == AW_DEV_DSP_BYPASS) { + aw_dev_dbg(aw_dev->dev, "dsp bypass"); + return 0; + } else if (aw_dev->dsp_cfg == AW_DEV_DSP_WORK) { + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_WORK); + AW_MS_DELAY(AW_1_MS); + for (i = 0; i < AW_DEV_DSP_CHECK_MAX; i++) { + ret = aw_dev_get_dsp_status(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dsp wdt status error=%d", ret); + AW_MS_DELAY(AW_2_MS); + } else { + return 0; + } + } + } else { + aw_dev_err(aw_dev->dev, "unknown dsp cfg=%d", aw_dev->dsp_cfg); + return -EINVAL; + } + + return -EINVAL; +} + +static void aw_dev_set_dither(struct aw_device *aw_dev, bool dither) +{ + struct aw_dither_desc *dither_desc = &aw_dev->dither_desc; + + aw_dev_dbg(aw_dev->dev, "enter, dither: %d", dither); + + if (dither_desc->reg == AW_REG_NONE) + return; + + if (dither) { + aw_dev->ops.aw_reg_write_bits(aw_dev, dither_desc->reg, + dither_desc->mask, + dither_desc->enable); + } else { + aw_dev->ops.aw_reg_write_bits(aw_dev, dither_desc->reg, + dither_desc->mask, + dither_desc->disable); + } + + aw_dev_info(aw_dev->dev, "done"); +} + +#ifdef AW_CALIB +static void aw_dev_cali_re_update(struct aw_device *aw_dev) +{ + if (aw_dev->cali_desc.cali_re < aw_dev->re_range.re_max && + aw_dev->cali_desc.cali_re > aw_dev->re_range.re_min) { + aw883xx_set_cali_re((void *)aw_dev); + } else { + aw_dev_err(aw_dev->dev, "cali_re:%d is error, no set", + aw_dev->cali_desc.cali_re); + } +} + +static int aw_dev_get_cali_msg(struct aw_device *aw_dev, void *cali_data, dev_params_t type) +{ + int ret = -1; + struct cali_msg_hdr *msg_hdr = NULL; + uint32_t cali_params[AW_DEV_MAX] = { 0 }; + aw_single_t is_single = IS_SINGLE; + + if (cali_data == NULL) { + return -EINVAL; + } + msg_hdr = (struct cali_msg_hdr *)cali_data; + is_single = (aw_single_t)msg_hdr->opcode_id; + + switch (type) { + case AW_DEV_TE_PARAMS: + ret = aw883xx_cali_get_te(aw_dev, is_single, (int32_t *)cali_params); + break; + case AW_DEV_F0_PARAMS: + ret = aw883xx_cali_get_f0(aw_dev, is_single, cali_params); + break; + case AW_DEV_R0_PARAMS: + ret = aw883xx_cali_get_r0(aw_dev, is_single, cali_params); + break; + case AW_DEV_RE_RANGE_PARAMS: + ret = aw883xx_cali_get_re_range(aw_dev, is_single, cali_params); + break; + case AW_DEV_CALI_RE_PARAMS: + ret = aw883xx_cali_re_show(aw_dev, is_single, cali_params); + break; + case AW_DEV_CALI_F0_PARAMS: + ret = aw883xx_cali_f0_show(aw_dev, is_single, cali_params); + break; + case AW_DEV_CALI_Q_PARAMS: + ret = aw883xx_cali_q_show(aw_dev, is_single, cali_params); + break; + case AW_DEV_CALI_TIME_PARAMS: + return aw883xx_cali_show_cali_time((uint32_t *)cali_data); + case AW_DEV_DSP_RE_PARAMS: + return aw883xx_cali_read_re_from_dsp(aw_dev, (uint32_t *)cali_data); + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return -EINVAL; + } + + if (ret < 0) { + return ret; + } + + memcpy(msg_hdr->msg, cali_params, sizeof(cali_params)); + + return 0; +} + +static int aw_dev_set_cali_msg(struct aw_device *aw_dev, void *cali_data, dev_params_t type) +{ + struct cali_msg_hdr *msg_hdr = NULL; + uint32_t *set_params = NULL; + int ret = -1; + + if (cali_data == NULL) { + return -EINVAL; + } + set_params = (uint32_t *)cali_data; + + switch (type) { + case AW_DEV_CALI_RE_PARAMS: + ret = aw883xx_cail_re_cali(aw_dev, (aw_single_t)set_params[0]); + break; + case AW_DEV_CALI_RE_F0_PARAMS: + ret = aw883xx_cali_re_f0_cali(aw_dev, (aw_single_t)set_params[0]); + break; + case AW_DEV_CALI_F0_Q_PARAMS: + ret = aw883xx_cali_f0_q_cali(aw_dev, (aw_single_t)set_params[0]); + break; + case AW_DEV_CALI_TIME_PARAMS: + ret = aw883xx_cali_store_cali_time(set_params[0]); + break; + case AW_DEV_STORE_CALI_RE_PARAMS: + msg_hdr = (struct cali_msg_hdr *)cali_data; + ret = aw883xx_cali_store_cali_re(aw_dev, (aw_single_t)msg_hdr->opcode_id, &msg_hdr->msg[0]); + break; + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return -EINVAL; + } + + return ret; +} +#endif + +static int aw_dev_set_params(struct aw_device *aw_dev, dev_params_t type, void *params, uint8_t len) +{ + uint32_t *set_params = NULL; + if ((params == NULL) || (len == 0)) { + aw_dev_err(aw_dev->dev, "input params error"); + return -EINVAL; + } + + set_params = (uint32_t *)params; + + switch (type) { + case AW_DEV_VOLUME_PARAMS: + return aw_dev_set_volume(aw_dev, set_params[0]); +#ifdef AW_FADE + case AW_DEV_FADE_STEP_PARAMS: + return aw_dev_set_fade_vol_step(aw_dev, set_params[0]); + case AW_DEV_FADE_IN_TIME_PARAMS: + return aw_dev_set_fade_time(set_params[0], AW_FADE_IN_TIME); + case AW_DEV_FADE_OUT_TIME_PARAMS: + return aw_dev_set_fade_time(set_params[0], AW_FADE_OUT_TIME); +#endif + case AW_DEV_DSP_PARAMS: + return aw_dev_dsp_enable(aw_dev, set_params[0]); + case AW_DEV_HMUTE_PARAMS: + return aw_dev_set_hmute(aw_dev, set_params[0]); + case AW_DEV_INT_PARAMS: + return aw_dev_set_intmask(aw_dev, set_params[0]); + case AW_DEV_CRC_FLAG_PARAMS: + return aw_dev_set_crc_flag(aw_dev, set_params[0]); + case AW_DEV_REALTIME_CRC_SET_PARAMS: + return aw_dev_crc_realtime_set(aw_dev, set_params[0]); +#ifdef AW_CALIB + case AW_DEV_CALI_RE_PARAMS: + case AW_DEV_CALI_RE_F0_PARAMS: + case AW_DEV_CALI_F0_Q_PARAMS: + case AW_DEV_CALI_TIME_PARAMS: + case AW_DEV_STORE_CALI_RE_PARAMS: + return aw_dev_set_cali_msg(aw_dev, params, type); +#endif + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return -EINVAL; + } +} + +static int aw_dev_get_params(struct aw_device *aw_dev, dev_params_t type, void *params, uint8_t len) +{ + int ret = -1; + if ((params == NULL) || (len == 0)) { + aw_dev_err(aw_dev->dev, "input params error"); + return -EINVAL; + } + + switch (type) { + case AW_DEV_VOLUME_PARAMS: + ret = aw_dev_get_volume(aw_dev, params); + break; +#ifdef AW_FADE + case AW_DEV_FADE_STEP_PARAMS: + ret = aw_dev_get_fade_vol_step(aw_dev, params); + break; + case AW_DEV_FADE_IN_TIME_PARAMS: + ret = aw_dev_get_fade_time(params, AW_FADE_IN_TIME); + break; + case AW_DEV_FADE_OUT_TIME_PARAMS: + ret = aw_dev_get_fade_time(params, AW_FADE_OUT_TIME); + break; +#endif + case AW_DEV_INT_PARAMS: + ret = aw_dev_get_int_status(aw_dev, params); + break; + case AW_DEV_HMUTE_PARAMS: + ret = aw_dev_get_hmute(aw_dev, params); + break; + case AW_DEV_SYSST_PARAMS: + ret = aw_dev_get_sysst_value(aw_dev, params); + break; + case AW_DEV_REALTIME_CRC_GET_PARAMS: + ret = aw_dev_crc_realtime_get(aw_dev, params); + break; +#ifdef AW_CALIB + case AW_DEV_TE_PARAMS: + case AW_DEV_F0_PARAMS: + case AW_DEV_R0_PARAMS: + case AW_DEV_RE_RANGE_PARAMS: + case AW_DEV_CALI_RE_PARAMS: + case AW_DEV_CALI_F0_PARAMS: + case AW_DEV_CALI_Q_PARAMS: + case AW_DEV_CALI_TIME_PARAMS: + case AW_DEV_DSP_RE_PARAMS: + ret = aw_dev_get_cali_msg(aw_dev, params, type); + break; +#endif + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return -EINVAL; + } + + return ret; +} + +int aw883xx_device_params(struct aw_device *aw_dev, dev_params_t params_type, + void *data, uint8_t size, params_option_t params_ops) +{ + if (params_ops == AW_SET_DEV_PARAMS) { + return aw_dev_set_params(aw_dev, params_type, data, size); + } else if (params_ops == AW_GET_DEV_PARAMS) { + return aw_dev_get_params(aw_dev, params_type, data, size); + } else { + aw_dev_err(aw_dev->dev, "unsupported params_ops:%d", params_ops); + return -EINVAL; + } +} + +static bool aw_dev_get_status(struct aw_device *aw_dev, dev_status_t type) +{ + switch (type) { + case AW_DEV_PLL_WDT_STATUS: + return aw_dev_get_pll_wdt_status(aw_dev); + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return false; + } +} + +static void aw_dev_set_status(struct aw_device *aw_dev, dev_status_t type) +{ + switch (type) { +#ifdef AW_IRQ + case AW_DEV_INTERRUPT_CLEAR_STATUS: + aw_dev_interrupt_clear(aw_dev); + break; +#endif + case AW_DEV_CLEAR_INT_STATUS: + aw_dev_clear_int_status(aw_dev); + break; + case AW_DEV_SOFT_RESET_STATUS: + aw_dev_soft_reset(aw_dev); + break; + case AW_DEV_REG_DUMP_STATUS: + aw883xx_dev_reg_dump(aw_dev); + break; + default: + aw_dev_err(aw_dev->dev, "unsupported type:%d", type); + return; + } +} + +bool aw883xx_device_status(struct aw_device *aw_dev, dev_status_t type, status_option_t status_ops) +{ + if (status_ops == AW_SET_DEV_STATUS) { + aw_dev_set_status(aw_dev, type); + return true; + } else if (status_ops == AW_GET_DEV_STATUS) { + return aw_dev_get_status(aw_dev, type); + } else { + aw_dev_err(aw_dev->dev, "unsupported status_ops:%d", status_ops); + return false; + } +} + +int aw883xx_device_start(struct aw_device *aw_dev) +{ + int ret = -1; + struct aw_dither_desc *dither_desc = &aw_dev->dither_desc; + + aw_dev_info(aw_dev->dev, "enter"); + + if (aw_dev->status == AW_DEV_PW_ON) { + aw_dev_info(aw_dev->dev, "already power on"); + return 0; + } + + aw_dev_set_dither(aw_dev, false); + + /*power on*/ + aw_dev_pwd(aw_dev, false); + AW_MS_DELAY(AW_2_MS); + + ret = aw_dev_syspll_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "pll check failed cannot start"); + aw883xx_dev_reg_dump(aw_dev); + goto pll_check_fail; + } + + /*amppd on*/ + aw_dev_amppd(aw_dev, false); + AW_MS_DELAY(AW_1_MS); + + /*check i2s status*/ + ret = aw883xx_dev_sysst_check(aw_dev); + if (ret < 0) { + /*check failed*/ + aw883xx_dev_reg_dump(aw_dev); + goto sysst_check_fail; + } + + if (aw_dev->dsp_cfg == AW_DEV_DSP_WORK) { + aw_dev_backup_sec_recovery(aw_dev); + ret = aw_dev_crc_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "crc check failed"); + aw883xx_dev_reg_dump(aw_dev); + goto crc_check_fail; + } + + /*dsp bypass*/ + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); + + aw_dev_set_vcalb(aw_dev); +#ifdef AW_CALIB + aw_dev_cali_re_update(aw_dev); +#endif + + ret = aw883xx_dev_dsp_check(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "check dsp status failed"); + aw883xx_dev_reg_dump(aw_dev); + goto dsp_check_fail; + } + } else { + aw_dev_dbg(aw_dev->dev, "start pa with dsp bypass"); + } + + /*enable tx feedback*/ + if (aw_dev->ops.aw_i2s_tx_enable) { + if (aw_dev->txen_st) { + aw_dev->ops.aw_i2s_tx_enable(aw_dev, true); + } + } + + if(aw_dev->dither_st == dither_desc->enable) { + aw_dev_set_dither(aw_dev, true); + } + + /*close mute*/ + if (aw883xx_cali_check_result(&aw_dev->cali_desc)) { + aw_dev_set_hmute(aw_dev, AW_DEV_HMUTE_DISABLE); + } else { + aw_dev_set_hmute(aw_dev, AW_DEV_HMUTE_ENABLE); + } + /*clear inturrupt*/ + aw_dev_clear_int_status(aw_dev); + /*set inturrupt mask*/ + aw_dev_set_intmask(aw_dev, AW_DEV_UNMASK_INT_VAL); + + if (aw_dev->ops.aw_monitor_start) { + aw_dev->ops.aw_monitor_start((void *)aw_dev); + } + + aw_dev->status = AW_DEV_PW_ON; + + aw_dev_info(aw_dev->dev, "done"); + + return 0; + +dsp_check_fail: +crc_check_fail: + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); +sysst_check_fail: + /*clear interrupt*/ + aw_dev_clear_int_status(aw_dev); + aw_dev_amppd(aw_dev, true); +pll_check_fail: + aw_dev_pwd(aw_dev, true); + aw_dev->status = AW_DEV_PW_OFF; + return ret; +} + +int aw883xx_device_stop(struct aw_device *aw_dev) +{ + int int_st = 0; + int monitor_int_st = 0; + uint16_t reg_data = 0; + + aw_dev_info(aw_dev->dev, "enter"); + + aw_dev->ops.aw_reg_read(aw_dev, aw_dev->pwd_desc.reg, ®_data); + + if ((aw_dev->status == AW_DEV_PW_OFF) && + (reg_data & aw_dev->pwd_desc.enable)) { + aw_dev_info(aw_dev->dev, "already power off"); + return 0; + } + + aw_dev->status = AW_DEV_PW_OFF; + + if (aw_dev->ops.aw_monitor_stop) { + aw_dev->ops.aw_monitor_stop((void *)aw_dev); + } + + /*set mute*/ + aw_dev_set_hmute(aw_dev, AW_DEV_HMUTE_ENABLE); + AW_MS_DELAY(AW_4_MS); + + /*close tx feedback*/ + if (aw_dev->ops.aw_i2s_tx_enable) { + aw_dev->ops.aw_i2s_tx_enable(aw_dev, false); + } + AW_MS_DELAY(AW_1_MS); + + /*set defaut int mask*/ + aw_dev_set_intmask(aw_dev, AW_DEV_MASK_INT_VAL); + + /*check sysint state*/ + int_st = aw_dev_sysint_check(aw_dev); + + /*close dsp*/ + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); + + /*enable amppd*/ + aw_dev_amppd(aw_dev, true); + + /*check monitor process sysint state*/ + monitor_int_st = aw_dev_get_monitor_sysint_st(aw_dev); + + if (int_st < 0 || monitor_int_st < 0) { + /*system status anomaly*/ + aw_dev_memclk_select(aw_dev, AW_DEV_MEMCLK_OSC); + aw_dev_sram_check(aw_dev); + aw_dev_dsp_fw_update(aw_dev); + aw_dev_dsp_cfg_update(aw_dev); + aw_dev_memclk_select(aw_dev, AW_DEV_MEMCLK_PLL); + } + + /*set power down*/ + aw_dev_pwd(aw_dev, true); + + aw_dev_info(aw_dev->dev, "done"); + return 0; +} + +static int aw_device_init(struct aw_device *aw_dev) +{ + int ret = -1; + + if (aw_dev == NULL) { + aw_pr_err("aw_dev is NULL"); + return -ENOMEM; + } + + strncpy(aw_dev->cur_prof_name, aw_dev->first_prof_name, AW_PROF_NAME_MAX); + strncpy(aw_dev->set_prof_name, aw_dev->first_prof_name, AW_PROF_NAME_MAX); + + ret = aw883xx_device_fw_update(aw_dev, AW_FORCE_UPDATE_ON, + AW_DSP_FW_UPDATE_ON); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "fw update failed"); + return ret; + } + + aw_dev_set_intmask(aw_dev, AW_DEV_MASK_INT_VAL); + + /*set mute*/ + aw_dev_set_hmute(aw_dev, AW_DEV_HMUTE_ENABLE); + + /*close tx feedback*/ + if (aw_dev->ops.aw_i2s_tx_enable) { + aw_dev->ops.aw_i2s_tx_enable(aw_dev, false); + } + AW_MS_DELAY(AW_1_MS); + + /*enable amppd*/ + aw_dev_amppd(aw_dev, true); + /*close dsp*/ + aw_dev_dsp_enable(aw_dev, AW_DEV_DSP_BYPASS); + /*set power down*/ + aw_dev_pwd(aw_dev, true); + + aw_dev_info(aw_dev->dev, "init done"); + + return 0; +} + +int aw883xx_device_probe(struct aw_device *aw_dev, struct aw_init_info *init_info) +{ + int ret = -1; + + ret = aw_dev_prof_init(aw_dev, init_info); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "prof init failed"); + return ret; + } + + aw883xx_dev_get_monitor_func(aw_dev); + + if(aw_dev->ops.aw_monitor_init) { + ret = aw_dev->ops.aw_monitor_init((void *)aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "monitor init failed"); + return ret; + } + } + + ret = aw_device_init(aw_dev); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "dev init failed"); + return ret; + } + + return 0; +} + diff --git a/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/16bit/aw883xx_acf.bin b/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/16bit/aw883xx_acf.bin new file mode 100644 index 000000000..ece91f406 Binary files /dev/null and b/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/16bit/aw883xx_acf.bin differ diff --git a/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/32bit/aw883xx_acf.bin b/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/32bit/aw883xx_acf.bin new file mode 100644 index 000000000..521a7c16d Binary files /dev/null and b/code/sdk/application/audio/vendor/aw88166/config/aw88166/mono/32bit/aw883xx_acf.bin differ diff --git a/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/16bit/aw883xx_acf.bin b/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/16bit/aw883xx_acf.bin new file mode 100644 index 000000000..470afce26 Binary files /dev/null and b/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/16bit/aw883xx_acf.bin differ diff --git a/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/32bit/aw883xx_acf.bin b/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/32bit/aw883xx_acf.bin new file mode 100644 index 000000000..ae441aecb Binary files /dev/null and b/code/sdk/application/audio/vendor/aw88166/config/aw88166/stereo/32bit/aw883xx_acf.bin differ diff --git a/code/sdk/application/audio/vendor/aw88166/product_init_files/aw88166/aw883xx_pid_2066_init.c b/code/sdk/application/audio/vendor/aw88166/product_init_files/aw88166/aw883xx_pid_2066_init.c new file mode 100644 index 000000000..67785f63e --- /dev/null +++ b/code/sdk/application/audio/vendor/aw88166/product_init_files/aw88166/aw883xx_pid_2066_init.c @@ -0,0 +1,612 @@ +/* +* aw883xx_pid_2066_init.c aw883xx codec driver +* +* Copyright (c) 2021 AWINIC Technology CO., LTD +* +* Author: +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + +#include +#include + +#include "aw883xx.h" +#include "aw883xx_pid_2066_reg.h" +#include "aw883xx_base.h" + +static int aw883xx_dev_i2c_writes(struct aw_device *aw_dev, + uint8_t reg_addr, uint8_t *buf, uint16_t len) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_i2c_writes(aw883xx, reg_addr, buf, len); +} + +static int aw883xx_dev_i2c_write(struct aw_device *aw_dev, + uint8_t reg_addr, uint16_t reg_data) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_i2c_write(aw883xx, reg_addr, reg_data); +} + +static int aw883xx_dev_i2c_read(struct aw_device *aw_dev, + uint8_t reg_addr, uint16_t *reg_data) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_i2c_read(aw883xx, reg_addr, reg_data); +} + + +static int aw883xx_dev_reg_read(struct aw_device *aw_dev, + uint8_t reg_addr, uint16_t *reg_data) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_reg_read(aw883xx, reg_addr, reg_data); +} + +static int aw883xx_dev_reg_write(struct aw_device *aw_dev, + uint8_t reg_addr, uint16_t reg_data) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_reg_write(aw883xx, reg_addr, reg_data); +} + +static int aw883xx_dev_reg_write_bits(struct aw_device *aw_dev, + uint8_t reg_addr, uint16_t mask, uint16_t reg_data) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_reg_write_bits(aw883xx, reg_addr, mask, reg_data); +} + +static int aw883xx_dev_dsp_write(struct aw_device *aw_dev, + uint16_t dsp_addr, uint32_t dsp_data, uint8_t data_type) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_dsp_write(aw883xx, dsp_addr, dsp_data, data_type); +} + +static int aw883xx_dev_dsp_read(struct aw_device *aw_dev, + uint16_t dsp_addr, uint32_t *dsp_data, uint8_t data_type) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + return aw883xx_dsp_read(aw883xx, dsp_addr, dsp_data, data_type); +} + +static void aw_pid_2066_i2s_tx_enable(struct aw_device *aw_dev, bool flag) +{ + struct aw883xx *aw883xx = (struct aw883xx *)aw_dev->private_data; + + aw_dev_dbg(aw883xx->dev, "enter"); + + if (flag) { + aw883xx_reg_write_bits(aw883xx, AW_PID_2066_I2SCTRL3_REG, + AW_PID_2066_I2STXEN_MASK, + AW_PID_2066_I2STXEN_ENABLE_VALUE); + } else { + aw883xx_reg_write_bits(aw883xx, AW_PID_2066_I2SCTRL3_REG, + AW_PID_2066_I2STXEN_MASK, + AW_PID_2066_I2STXEN_DISABLE_VALUE); + } +} + +static bool aw_pid_2066_check_rd_access(int reg) +{ + if (reg >= AW_PID_2066_REG_MAX) + return false; + + if (aw_pid_2066_reg_access[reg] & REG_RD_ACCESS) + return true; + else + return false; +} + +static bool aw_pid_2066_check_wr_access(int reg) +{ + if (reg >= AW_PID_2066_REG_MAX) + return false; + + if (aw_pid_2066_reg_access[reg] & REG_WR_ACCESS) + return true; + else + return false; +} + +static int aw_pid_2066_get_reg_num(void) +{ + return AW_PID_2066_REG_MAX; +} + +static unsigned int aw_pid_2066_reg_val_to_db(unsigned int reg_val) +{ + return reg_val; +} + +static int aw_pid_2066_db_to_reg_val(uint16_t db_val) +{ + return db_val; +} + +static int aw_pid_2066_set_volume(struct aw_device *aw_pa, uint16_t volume) +{ + int ret = -1; + uint16_t reg_value = 0; + uint16_t real_value = 0; + uint16_t reg_vol = 0; + uint16_t min_vol = 0; + struct aw883xx *aw883xx = (struct aw883xx*)aw_pa->private_data; + struct aw_volume_desc *vol_desc = &aw883xx->aw_pa->volume_desc; + + min_vol = AW_GET_MIN_VALUE(volume, vol_desc->mute_volume); + reg_vol = aw_pid_2066_db_to_reg_val(min_vol); + + ret = aw883xx_reg_read(aw883xx, AW_PID_2066_SYSCTRL2_REG, ®_value); + if (ret < 0) { + aw_dev_err(aw_pa->dev, "read vol reg failed"); + return ret; + } + + real_value = (reg_vol << AW_PID_2066_VOL_START_BIT) | + (reg_value & AW_PID_2066_VOL_MASK); + + ret = aw883xx_reg_write(aw883xx, AW_PID_2066_SYSCTRL2_REG, real_value); + if (ret < 0) { + aw_dev_err(aw_pa->dev, "write vol reg failed"); + return ret; + } + + return 0; +} + +static int aw_pid_2066_get_volume(struct aw_device *aw_pa, uint16_t *volume) +{ + int ret = -1; + uint16_t reg_value = 0; + uint16_t reg_vol = 0; + uint16_t real_vol = 0; + struct aw883xx *aw883xx = (struct aw883xx*)aw_pa->private_data; + + ret = aw883xx_reg_read(aw883xx, AW_PID_2066_SYSCTRL2_REG, ®_value); + if (ret < 0) { + aw_dev_err(aw_pa->dev, "read vol reg failed"); + return ret; + } + + reg_vol = reg_value & (~AW_PID_2066_VOL_MASK); + real_vol = aw_pid_2066_reg_val_to_db(reg_vol); + + *volume = real_vol; + + return 0; +} + +static int aw_pid_2066_get_icalk(struct aw_device * aw_dev, int16_t *icalk) +{ + int ret = -1; + uint16_t efrm_reg_val = 0; + uint16_t efrl_reg_val = 0; + uint16_t ef_isn_geslp = 0; + uint16_t ef_isn_h5bits = 0; + uint16_t icalk_val = 0; + struct aw_efuse_check_desc *efuse_check_desc = &aw_dev->efuse_check_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, AW_PID_2066_EFRM2_REG, &efrm_reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read efrm_reg failed"); + return ret; + } + + ef_isn_geslp = (efrm_reg_val & (~AW_PID_2066_EF_ISN_GESLP_MASK)) >> + AW_PID_2066_EF_ISN_GESLP_SHIFT; + + ret = aw_dev->ops.aw_reg_read(aw_dev, AW_PID_2066_EFRL_REG, &efrl_reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read efrl_reg failed"); + return ret; + } + + ef_isn_h5bits = (efrl_reg_val & (~AW_PID_2066_EF_ISN_H5BITS_MASK)) >> + AW_PID_2066_EF_ISN_H5BITS_SHIFT; + + if (efuse_check_desc->check_val == AW_EF_AND_CHECK) { + icalk_val = ef_isn_geslp & (ef_isn_h5bits | AW_PID_2066_EF_ISN_H5BITS_SIGN_MASK); + } else if (efuse_check_desc->check_val == AW_EF_OR_CHECK) { + icalk_val = ef_isn_geslp | (ef_isn_h5bits & (~AW_PID_2066_EF_ISN_H5BITS_SIGN_MASK)); + } else { + aw_dev_err(aw_dev->dev, "unsupported check type:%d", efuse_check_desc->check_val); + return -EINVAL; + } + if (icalk_val & (~AW_PID_2066_ICALK_SIGN_MASK)) + icalk_val = icalk_val | AW_PID_2066_ICALK_NEG_MASK; + *icalk = (int16_t)icalk_val; + return 0; +} + +static int aw_pid_2066_get_vcalk(struct aw_device * aw_dev, int16_t *vcalk) +{ + int ret = -1; + uint16_t efrm_reg_val = 0; + uint16_t efrl_reg_val = 0; + uint16_t ef_vsn_geslp = 0; + uint16_t ef_vsn_h3bits = 0; + uint16_t vcalk_val = 0; + struct aw_efuse_check_desc *efuse_check_desc = &aw_dev->efuse_check_desc; + + ret = aw_dev->ops.aw_reg_read(aw_dev, AW_PID_2066_EFRM2_REG, &efrm_reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read efrm_reg failed"); + return ret; + } + + ef_vsn_geslp = (efrm_reg_val & (~AW_PID_2066_EF_VSN_GESLP_MASK)) >> + AW_PID_2066_EF_VSN_GESLP_SHIFT; + + ret = aw_dev->ops.aw_reg_read(aw_dev, AW_PID_2066_EFRL_REG, &efrl_reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "read efrl_reg failed"); + return ret; + } + + ef_vsn_h3bits = (efrl_reg_val & (~AW_PID_2066_EF_VSN_H3BITS_MASK)) >> + AW_PID_2066_EF_VSN_H3BITS_SHIFT; + + if (efuse_check_desc->check_val == AW_EF_AND_CHECK) { + vcalk_val = ef_vsn_geslp & (ef_vsn_h3bits | AW_PID_2066_EF_VSN_H3BITS_SIGN_MASK); + } else if (efuse_check_desc->check_val == AW_EF_OR_CHECK) { + vcalk_val = ef_vsn_geslp | (ef_vsn_h3bits & (~AW_PID_2066_EF_VSN_H3BITS_SIGN_MASK)); + } else { + aw_dev_err(aw_dev->dev, "unsupported check type:%d", efuse_check_desc->check_val); + return -EINVAL; + } + if (vcalk_val & (~AW_PID_2066_VCALK_SIGN_MASK)) + vcalk_val = vcalk_val | AW_PID_2066_VCALK_NEG_MASK; + *vcalk = (int16_t)vcalk_val; + return 0; +} + +static int aw_pid_2066_set_vcalb(struct aw_device *aw_dev) +{ + int ret = -1; + uint16_t reg_val = 0; + int16_t icalk = 0; + int16_t vcalk = 0; + int32_t ical_k = 0; + int32_t vcal_k = 0; + int32_t vcalb = 0; + struct aw_vcalb_desc *vcalb_desc = &aw_dev->vcalb_desc; + + ret = aw_pid_2066_get_vcalk(aw_dev, &vcalk); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get vcalk failed"); + return ret; + } + aw_dev_info(aw_dev->dev, "vcalk = %d", vcalk); + + ret = aw_pid_2066_get_icalk(aw_dev, &icalk); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "get icalk failed"); + return ret; + } + aw_dev_info(aw_dev->dev, "icalk = %d", icalk); + + ical_k = icalk * AW_PID_2066_ICABLK_FACTOR + AW_PID_2066_CABL_BASE_VALUE; + vcal_k = vcalk * AW_PID_2066_VCABLK_FACTOR + AW_PID_2066_CABL_BASE_VALUE; + + aw_dev_info(aw_dev->dev, "ical_k = %d, vcal_k = %d", ical_k, vcal_k); + vcalb = AW_PID_2066_VCALB_ACCURACY * AW_PID_2066_VSCAL_FACTOR / + AW_PID_2066_ISCAL_FACTOR * ical_k / vcal_k * vcalb_desc->init_value; + + + vcalb = vcalb >> AW_PID_2066_VCALB_ADJ_FACTOR; + reg_val = (uint32_t)vcalb; + + aw_dev_info(aw_dev->dev, "vcalb = %d, vcalb_adj = %d", + reg_val, vcalb_desc->init_value >> AW_PID_2066_VCALB_ADJ_FACTOR); + + ret = aw_dev->ops.aw_reg_write(aw_dev, AW_PID_2066_DSPVCALB_REG, reg_val); + if (ret < 0) { + aw_dev_err(aw_dev->dev, "write vcalb_reg failed"); + return ret; + } + + return 0; +} + +int aw883xx_pid_2066_dev_init(void *aw883xx_val) +{ + int ret = -1; + struct aw_device *aw_pa = NULL; + struct aw883xx *aw883xx = (struct aw883xx *)aw883xx_val; + + aw_pr_dbg("enter"); + + if (aw883xx == NULL) { + aw_pr_err("aw883xx is null"); + return -EINVAL; + } + + if (aw883xx->chip_id != PID_2066_ID) { + aw_dev_dbg(aw883xx->dev, "The id:0x%x does not match:0x%x", + aw883xx->chip_id, PID_2066_ID); + return -EINVAL; + } + + aw_pa = calloc(1, sizeof(struct aw_device)); + if (aw_pa == NULL) { + aw_dev_err(aw883xx->dev, "calloc failed"); + return -ENOMEM; + } + + /*call aw device init func*/ + + aw_pa->chip_id = aw883xx->chip_id; + aw_pa->dev = aw883xx->dev; + aw_pa->private_data = (void *)aw883xx; + aw_pa->fw_status = AW_DEV_FW_FAILED; + aw_pa->fade_step = AW_PID_2066_VOLUME_STEP_DB; + aw_pa->crc_type = AW_HW_CRC_CHECK; + + aw_pa->ops.aw_set_cali_re = NULL; + aw_pa->ops.aw_get_cali_re = NULL; + aw_pa->ops.aw_get_r0 = NULL; + aw_pa->ops.aw_sw_crc_check = NULL; + aw_pa->ops.aw_init_vcalb_update = NULL; + + aw_pa->ops.aw_get_version = aw883xx_get_version; + aw_pa->ops.aw_i2c_writes = aw883xx_dev_i2c_writes; + aw_pa->ops.aw_i2c_write = aw883xx_dev_i2c_write; + aw_pa->ops.aw_reg_write = aw883xx_dev_reg_write; + aw_pa->ops.aw_reg_write_bits = aw883xx_dev_reg_write_bits; + aw_pa->ops.aw_i2c_read = aw883xx_dev_i2c_read; + aw_pa->ops.aw_reg_read = aw883xx_dev_reg_read; + aw_pa->ops.aw_dsp_read = aw883xx_dev_dsp_read; + aw_pa->ops.aw_dsp_write = aw883xx_dev_dsp_write; + aw_pa->ops.aw_get_dev_num = aw883xx_get_dev_num; + + aw_pa->ops.aw_get_hw_volume = aw_pid_2066_get_volume; + aw_pa->ops.aw_set_hw_volume = aw_pid_2066_set_volume; + aw_pa->ops.aw_reg_val_to_db = aw_pid_2066_reg_val_to_db; + + aw_pa->ops.aw_check_rd_access = aw_pid_2066_check_rd_access; + aw_pa->ops.aw_check_wr_access = aw_pid_2066_check_wr_access; + aw_pa->ops.aw_get_reg_num = aw_pid_2066_get_reg_num; + + aw_pa->ops.aw_i2s_tx_enable = aw_pid_2066_i2s_tx_enable; + aw_pa->ops.aw_set_vcalb = aw_pid_2066_set_vcalb; + + aw_pa->dsp_crc_desc.ctl_reg = AW_REG_NONE; + + aw_pa->int_desc.mask_reg = AW_PID_2066_SYSINTM_REG; + aw_pa->int_desc.mask_default = AW_PID_2066_SYSINTM_DEFAULT; + aw_pa->int_desc.int_mask = AW_PID_2066_SYSINTM_DEFAULT; + aw_pa->int_desc.st_reg = AW_PID_2066_SYSINT_REG; + aw_pa->int_desc.intst_mask = AW_PID_2066_BIT_SYSINT_CHECK; + + aw_pa->pwd_desc.reg = AW_PID_2066_SYSCTRL_REG; + aw_pa->pwd_desc.mask = AW_PID_2066_PWDN_MASK; + aw_pa->pwd_desc.enable = AW_PID_2066_PWDN_POWER_DOWN_VALUE; + aw_pa->pwd_desc.disable = AW_PID_2066_PWDN_WORKING_VALUE; + + aw_pa->mute_desc.reg = AW_PID_2066_SYSCTRL_REG; + aw_pa->mute_desc.mask = AW_PID_2066_HMUTE_MASK; + aw_pa->mute_desc.enable = AW_PID_2066_HMUTE_ENABLE_VALUE; + aw_pa->mute_desc.disable = AW_PID_2066_HMUTE_DISABLE_VALUE; + + aw_pa->txen_desc.reg = AW_PID_2066_I2SCTRL3_REG; + aw_pa->txen_desc.mask = AW_PID_2066_I2STXEN_MASK; + aw_pa->txen_desc.enable = AW_PID_2066_I2STXEN_ENABLE_VALUE; + aw_pa->txen_desc.disable = AW_PID_2066_I2STXEN_DISABLE_VALUE; + + aw_pa->vcalb_desc.vcalb_reg = AW_PID_2066_DSPVCALB_REG; + + aw_pa->efuse_check_desc.reg = AW_PID_2066_DBGCTRL_REG; + aw_pa->efuse_check_desc.mask = AW_PID_2066_EF_DBMD_MASK; + aw_pa->efuse_check_desc.or_val = AW_PID_2066_EF_DBMD_OR_VALUE; + aw_pa->efuse_check_desc.and_val = AW_PID_2066_EF_DBMD_AND_VALUE; + + aw_pa->sysst_desc.reg = AW_PID_2066_SYSST_REG; + aw_pa->sysst_desc.st_check = AW_PID_2066_BIT_SYSST_NOSWS_CHECK; + aw_pa->sysst_desc.st_mask = AW_PID_2066_BIT_SYSST_CHECK_MASK; + aw_pa->sysst_desc.pll_check = AW_PID_2066_BIT_PLL_CHECK; + aw_pa->sysst_desc.dsp_check = AW_PID_2066_DSPS_NORMAL_VALUE; + aw_pa->sysst_desc.dsp_mask = AW_PID_2066_DSPS_MASK; + aw_pa->sysst_desc.st_sws_check = AW_PID_2066_BIT_SYSST_SWS_CHECK; + + aw_pa->noise_gate_en.reg = AW_PID_2066_PWMCTRL3_REG; + aw_pa->noise_gate_en.noise_gate_mask = AW_PID_2066_NOISE_GATE_EN_MASK; + + aw_pa->profctrl_desc.reg = AW_PID_2066_SYSCTRL_REG; + aw_pa->profctrl_desc.mask = AW_PID_2066_EN_TRAN_MASK; + aw_pa->profctrl_desc.rcv_mode_val = AW_PID_2066_EN_TRAN_RCV_VALUE; + + aw_pa->volume_desc.reg = AW_PID_2066_SYSCTRL2_REG; + aw_pa->volume_desc.mask = AW_PID_2066_VOL_MASK; + aw_pa->volume_desc.shift = AW_PID_2066_VOL_START_BIT; + aw_pa->volume_desc.mute_volume = AW_PID_2066_MUTE_VOLUME; + aw_pa->volume_desc.max_volume = AW_PID_2066_VOL_DEFAULT_VALUE; + aw_pa->volume_desc.ctl_volume = AW_PID_2066_VOL_DEFAULT_VALUE; + + aw_pa->dsp_en_desc.reg = AW_PID_2066_SYSCTRL_REG; + aw_pa->dsp_en_desc.mask = AW_PID_2066_DSPBY_MASK; + aw_pa->dsp_en_desc.enable = AW_PID_2066_DSPBY_WORKING_VALUE; + aw_pa->dsp_en_desc.disable = AW_PID_2066_DSPBY_BYPASS_VALUE; + + aw_pa->memclk_desc.reg = AW_PID_2066_DBGCTRL_REG; + aw_pa->memclk_desc.mask = AW_PID_2066_MEM_CLKSEL_MASK; + aw_pa->memclk_desc.mcu_hclk = AW_PID_2066_MEM_CLKSEL_DAP_HCLK_VALUE; + aw_pa->memclk_desc.osc_clk = AW_PID_2066_MEM_CLKSEL_OSC_CLK_VALUE; + + aw_pa->watch_dog_desc.reg = AW_PID_2066_WDT_REG; + aw_pa->watch_dog_desc.mask = AW_PID_2066_WDT_CNT_MASK; + + aw_pa->dsp_mem_desc.dsp_madd_reg = AW_PID_2066_DSPMADD_REG; + aw_pa->dsp_mem_desc.dsp_mdat_reg = AW_PID_2066_DSPMDAT_REG; + aw_pa->dsp_mem_desc.dsp_cfg_base_addr = AW_PID_2066_DSP_CFG_ADDR; + aw_pa->dsp_mem_desc.dsp_fw_base_addr = AW_PID_2066_DSP_FW_ADDR; + aw_pa->dsp_mem_desc.dsp_rom_check_reg = AW_PID_2066_DSP_ROM_CHECK_ADDR; + aw_pa->dsp_mem_desc.dsp_rom_check_data = AW_PID_2066_DSP_ROM_CHECK_DATA; + + aw_pa->soft_rst.reg = AW_PID_2066_ID_REG; + aw_pa->soft_rst.reg_value = AW_PID_2066_SOFT_RESET_VALUE; + + aw_pa->dsp_vol_desc.reg = AW_PID_2066_DSPCFG_REG; + aw_pa->dsp_vol_desc.mask = AW_PID_2066_DSP_VOL_MASK; + aw_pa->dsp_vol_desc.mute_st = AW_PID_2066_DSP_VOL_MUTE; + aw_pa->dsp_vol_desc.noise_st = AW_PID_2066_DSP_VOL_NOISE_ST; + + aw_pa->amppd_desc.reg = AW_PID_2066_SYSCTRL_REG; + aw_pa->amppd_desc.mask = AW_PID_2066_AMPPD_MASK; + aw_pa->amppd_desc.enable = AW_PID_2066_AMPPD_POWER_DOWN_VALUE; + aw_pa->amppd_desc.disable = AW_PID_2066_AMPPD_WORKING_VALUE; + + aw_pa->cali_desc.spkr_temp_desc.reg = AW_PID_2066_ASR2_REG; + + /*32-bit data types need bypass dsp*/ + aw_pa->cali_desc.ra_desc.dsp_reg = AW_PID_2066_DSP_REG_CFG_ADPZ_RA; + aw_pa->cali_desc.ra_desc.data_type = AW_DSP_32_DATA; + aw_pa->cali_desc.ra_desc.shift = AW_PID_2066_DSP_CFG_ADPZ_RA_SHIFT; + + /*32-bit data types need bypass dsp*/ + aw_pa->cali_desc.cali_cfg_desc.actampth_reg = AW_PID_2066_DSP_REG_CFG_MBMEC_ACTAMPTH; + aw_pa->cali_desc.cali_cfg_desc.actampth_data_type = AW_DSP_32_DATA; + + /*32-bit data types need bypass dsp*/ + aw_pa->cali_desc.cali_cfg_desc.noiseampth_reg = AW_PID_2066_DSP_REG_CFG_MBMEC_NOISEAMPTH; + aw_pa->cali_desc.cali_cfg_desc.noiseampth_data_type = AW_DSP_32_DATA; + + aw_pa->cali_desc.cali_cfg_desc.ustepn_reg = AW_PID_2066_DSP_REG_CFG_ADPZ_USTEPN; + aw_pa->cali_desc.cali_cfg_desc.ustepn_data_type = AW_DSP_16_DATA; + + aw_pa->cali_desc.cali_cfg_desc.alphan_reg = AW_PID_2066_DSP_REG_CFG_RE_ALPHA; + aw_pa->cali_desc.cali_cfg_desc.alphan_data_type = AW_DSP_16_DATA; + + /*32-bit data types need bypass dsp*/ + aw_pa->cali_desc.r0_desc.dsp_reg = AW_PID_2066_DSP_REG_CFG_ADPZ_RE; + aw_pa->cali_desc.r0_desc.data_type = AW_DSP_16_DATA; + aw_pa->cali_desc.r0_desc.shift = AW_PID_2066_ADPZ_RE_SHIFT; + + aw_pa->cali_desc.dsp_re_desc.shift = AW_PID_2066_DSP_REG_CALRE_SHIFT; + aw_pa->cali_desc.dsp_re_desc.dsp_reg = AW_PID_2066_DSP_REG_CALRE; + aw_pa->cali_desc.dsp_re_desc.data_type = AW_DSP_16_DATA; + + aw_pa->cali_desc.hw_cali_re_desc.hbits_reg = AW_PID_2066_ACR1_REG; + aw_pa->cali_desc.hw_cali_re_desc.hbits_mask = AW_PID_2066_CALI_RE_HBITS_MASK; + aw_pa->cali_desc.hw_cali_re_desc.hbits_shift = AW_PID_2066_CALI_RE_HBITS_SHIFT; + aw_pa->cali_desc.hw_cali_re_desc.lbits_reg = AW_PID_2066_ACR2_REG; + aw_pa->cali_desc.hw_cali_re_desc.lbits_mask = AW_PID_2066_CALI_RE_LBITS_MASK; + aw_pa->cali_desc.hw_cali_re_desc.lbits_shift = AW_PID_2066_CALI_RE_LBITS_SHIFT; + aw_pa->cali_desc.hw_cali_re_desc.cali_re_shift = AW_PID_2066_DSP_RE_SHIFT; + + aw_pa->cali_desc.noise_desc.dsp_reg = AW_PID_2066_DSP_REG_CFG_MBMEC_GLBCFG; + aw_pa->cali_desc.noise_desc.data_type = AW_DSP_16_DATA; + aw_pa->cali_desc.noise_desc.mask = AW_PID_2066_DSP_REG_NOISE_MASK; + + aw_pa->cali_desc.f0_desc.dsp_reg = AW_PID_2066_DSP_REG_RESULT_F0; + aw_pa->cali_desc.f0_desc.shift = AW_PID_2066_DSP_F0_SHIFT; + aw_pa->cali_desc.f0_desc.data_type = AW_DSP_16_DATA; + + aw_pa->cali_desc.q_desc.dsp_reg = AW_PID_2066_DSP_REG_RESULT_Q; + aw_pa->cali_desc.q_desc.shift = AW_PID_2066_DSP_Q_SHIFT; + aw_pa->cali_desc.q_desc.data_type = AW_DSP_16_DATA; + + aw_pa->cali_desc.iv_desc.reg = AW_PID_2066_ASR1_REG; + aw_pa->cali_desc.iv_desc.reabs_mask = AW_PID_2066_REABS_MASK; + + aw_pa->cali_desc.cali_delay_desc.dsp_reg = AW_PID_2066_DSP_CALI_F0_DELAY; + aw_pa->cali_desc.cali_delay_desc.data_type = AW_DSP_16_DATA; + + aw_pa->cco_mux_desc.reg = AW_PID_2066_PLLCTRL2_REG; + aw_pa->cco_mux_desc.mask = AW_PID_2066_CCO_MUX_MASK; + aw_pa->cco_mux_desc.divider = AW_PID_2066_CCO_MUX_DIVIDED_VALUE; + aw_pa->cco_mux_desc.bypass = AW_PID_2066_CCO_MUX_BYPASS_VALUE; + +#ifdef AW_MONITOR + + aw_pa->monitor_desc.voltage_desc.reg = AW_PID_2066_VBAT_REG; + aw_pa->monitor_desc.voltage_desc.vbat_range = AW_PID_2066_VBAT_RANGE; + aw_pa->monitor_desc.voltage_desc.int_bit = AW_PID_2066_INT_10BIT; + + aw_pa->monitor_desc.temp_desc.reg = AW_PID_2066_TEMP_REG; + aw_pa->monitor_desc.temp_desc.sign_mask = AW_PID_2066_TEMP_SIGN_MASK; + aw_pa->monitor_desc.temp_desc.neg_mask = AW_PID_2066_TEMP_NEG_MASK; + + aw_pa->monitor_desc.vmax_desc.dsp_reg = AW_PID_2066_DSP_REG_VMAX; + aw_pa->monitor_desc.vmax_desc.data_type = AW_DSP_16_DATA; + + aw_pa->monitor_desc.ipeak_desc.reg = AW_PID_2066_BSTCTRL2_REG; + aw_pa->monitor_desc.ipeak_desc.mask = AW_PID_2066_BST_IPEAK_MASK; + aw_pa->monitor_desc.dsp_monitor_delay = AW_DSP_MONITOR_DELAY; + + aw_pa->monitor_desc.dsp_monitor_desc.extn_temp_reg = AW_PID_2066_DSP_REG_EXTERN_TEMP_ADDR; + aw_pa->monitor_desc.dsp_monitor_desc.extn_temp_reg_type = AW_DSP_16_DATA; + + aw_pa->monitor_desc.dsp_monitor_desc.extn_temp_en_reg = AW_PID_2066_DSP_MONITOR_TEMPEN_ADDR; + aw_pa->monitor_desc.dsp_monitor_desc.extn_temp_en_mask = AW_PID_2066_DSP_MONITOR_EXTERN_TEMP_MASK; + aw_pa->monitor_desc.dsp_monitor_desc.extn_temp_en_reg_type = AW_DSP_16_DATA; + + aw_pa->monitor_desc.dsp_monitor_desc.dsp_temp_reg = AW_PID_2066_DSP_MONITOR_TEMPEN_ADDR; + aw_pa->monitor_desc.dsp_monitor_desc.dsp_temp_en_mask = AW_PID_2066_DSP_MONITOR_TEMPEN_MASK; + aw_pa->monitor_desc.dsp_monitor_desc.dsp_temp_reg_type = AW_DSP_16_DATA; + + aw_pa->monitor_desc.dsp_monitor_desc.dsp_volt_reg = AW_PID_2066_DSP_REG_CFG_MBMEC_GLBCFG; + aw_pa->monitor_desc.dsp_monitor_desc.dsp_volt_en_mask = AW_PID_2066_DSP_MONITOR_VOLTEN_MASK; + aw_pa->monitor_desc.dsp_monitor_desc.dsp_volt_reg_type = AW_DSP_16_DATA; + + aw_pa->monitor_desc.hw_monitor_desc.reg = AW_PID_2066_SYSCTRL2_REG; + aw_pa->monitor_desc.hw_monitor_desc.bop_mask = AW_PID_2066_BOP_EN_MASK; + aw_pa->monitor_desc.hw_monitor_desc.vol_mask = AW_PID_2066_BOP_VOL_EN_MASK; + aw_pa->monitor_desc.hw_monitor_desc.ipeak_mask = AW_PID_2066_BOP_IPEAK_EN_MASK; +#endif + aw_pa->dsp_st_desc.dsp_reg_s1 = AW_PID_2066_DSP_ST_S1; + aw_pa->dsp_st_desc.dsp_reg_e1 = AW_PID_2066_DSP_ST_E1; + aw_pa->dsp_st_desc.dsp_reg_s2 = AW_PID_2066_DSP_ST_S2; + aw_pa->dsp_st_desc.dsp_reg_e2 = AW_PID_2066_DSP_ST_E2; + + aw_pa->crc_check_desc.ram_clk_reg = AW_PID_2066_I2SCFG1_REG; + aw_pa->crc_check_desc.ram_clk_mask = AW_PID_2066_RAM_CG_BYP_MASK; + aw_pa->crc_check_desc.ram_clk_on = AW_PID_2066_RAM_CG_BYP_BYPASS_VALUE; + aw_pa->crc_check_desc.ram_clk_off = AW_PID_2066_RAM_CG_BYP_WORK_VALUE; + + aw_pa->crc_check_desc.crc_cfg_base_addr = AW_PID_2066_CRC_CFG_BASE_ADDR; + aw_pa->crc_check_desc.crc_fw_base_addr = AW_PID_2066_CRC_FW_BASE_ADDR; + + aw_pa->crc_check_desc.crc_ctrl_reg = AW_PID_2066_CRCCTRL_REG; + aw_pa->crc_check_desc.crc_end_addr_mask = AW_PID_2066_CRC_END_ADDR_MASK; + aw_pa->crc_check_desc.crc_cfg_check_en_mask = AW_PID_2066_CRC_CFG_EN_MASK; + aw_pa->crc_check_desc.crc_cfgcheck_disable = AW_PID_2066_CRC_CFGCHECK_DISABLE_VAL; + aw_pa->crc_check_desc.crc_cfgcheck_enable = AW_PID_2066_CRC_CFGCHECK_ENABLE_VAL; + aw_pa->crc_check_desc.crc_fw_check_en_mask = AW_PID_2066_CRC_CODE_EN_MASK; + aw_pa->crc_check_desc.crc_fwcheck_disable = AW_PID_2066_CRC_FWCHECK_DISABLE_VAL; + aw_pa->crc_check_desc.crc_fwcheck_enable = AW_PID_2066_CRC_FWCHECK_ENABLE_VAL; + + aw_pa->crc_check_desc.crc_check_reg = AW_PID_2066_HAGCST_REG; + aw_pa->crc_check_desc.crc_check_mask = AW_PID_2066_CRC_CHECK_BITS_MASK; + aw_pa->crc_check_desc.crc_check_pass = AW_PID_2066_CRC_CHECK_PASS_VAL; + aw_pa->crc_check_desc.crc_check_bits_shift = AW_PID_2066_CRC_CHECK_START_BIT; + + aw_pa->fw_ver_desc.version_reg = AW_PID_2066_FIRMWARE_VERSION_REG; + aw_pa->fw_ver_desc.data_type = AW_DSP_16_DATA; + + aw_pa->dither_desc.reg = AW_PID_2066_DBGCTRL_REG; + aw_pa->dither_desc.mask = AW_PID_2066_DITHER_EN_MASK; + aw_pa->dither_desc.enable = AW_PID_2066_DITHER_EN_ENABLE_VALUE; + aw_pa->dither_desc.disable = AW_PID_2066_DITHER_EN_DISABLE_VALUE; + + + aw883xx->aw_pa = aw_pa; + ret = aw883xx_device_probe(aw_pa, aw883xx->init_info); + + return ret; + +} + diff --git a/code/sdk/application/brandy/brandy_recovery/main.c b/code/sdk/application/brandy/brandy_recovery/main.c index 9d77e378f..3f761f3c5 100644 --- a/code/sdk/application/brandy/brandy_recovery/main.c +++ b/code/sdk/application/brandy/brandy_recovery/main.c @@ -279,7 +279,6 @@ static void chip_init(void) cpu_trace_enable_mcpu_repeat(); - // otp_init(); uapi_pm_control(PM_SDIO_POWER_UP_AND_RUN); } diff --git a/code/sdk/application/brandy/brandy_standard/chip_init.c b/code/sdk/application/brandy/brandy_standard/chip_init.c index 1ce1d2979..1e2d853c3 100644 --- a/code/sdk/application/brandy/brandy_standard/chip_init.c +++ b/code/sdk/application/brandy/brandy_standard/chip_init.c @@ -12,7 +12,6 @@ #include "rtc.h" #include "gpio.h" #include "ipc.h" -#include "otp.h" #include "cpu_trace.h" #include "uart_porting.h" #include "log_memory_region.h" @@ -158,7 +157,6 @@ void chip_init(void) log_memory_region_init(); - // otp_init(); #if ENABLE_LOW_POWER == YES copy_from_flash_to_pm_text(); #endif diff --git a/code/sdk/application/brandy/brandy_standard/input_app.c b/code/sdk/application/brandy/brandy_standard/input_app.c index 0248cadb5..e4e8b39f5 100644 --- a/code/sdk/application/brandy/brandy_standard/input_app.c +++ b/code/sdk/application/brandy/brandy_standard/input_app.c @@ -166,19 +166,23 @@ uint32_t button_close(void) return ERRCODE_SUCC; } -void button_report_event_to_gui(int state) +void button_report_event_to_gui(button_id_t id, uint16_t state) { input_dev_data_t data; if (g_button_event_cb != NULL) { data.type = INDEV_TYPE_KEY; - data.keyId = INDEV_KEY_POWER; - data.state = state; // 1:press 0:release + if (id == BUTTON_PWR) { + data.keyId = INDEV_KEY_POWER; + } else { + data.keyId = INDEV_KEY_FUNC; + } + data.state = state; // 2:longpress 1:press 0:release g_button_event_cb(&data); } } -static void button_report_event(event_button_t event) +void button_report_event(button_id_t id, event_button_t event) { input_dev_data_t data; @@ -191,10 +195,13 @@ static void button_report_event(event_button_t event) } button_report_event_to_pms(); #endif - button_report_event_to_gui(1); + button_report_event_to_gui(id, 1); // 1:press break; case BUTTON_PWR_CLICKUP: - button_report_event_to_gui(0); + button_report_event_to_gui(id, 0); // 0:release + break; + case BUTTON_PWR_LONGPRESS_3S: + button_report_event_to_gui(id, 2); // 2:longpress break; default: break; @@ -283,7 +290,7 @@ static void button_send_event_to_ui(button_id_t id, button_report_state_t state) event_button_t event = BUTTON_BUTT; event = button_event_get(id, state); #if defined(ENABLE_UIKIT) || defined(ENABLE_LVGL) - button_report_event(event); + button_report_event(id, event); #endif if (g_button_common_event_cb[event] != NULL) { g_button_common_event_cb[event](); diff --git a/code/sdk/application/wearable/nativeabilityfwk/CMakeLists.txt b/code/sdk/application/wearable/nativeabilityfwk/CMakeLists.txt index ae350bcb1..cbd47f638 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeabilityfwk/CMakeLists.txt @@ -30,6 +30,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/SliceTransition.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionManager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/transition/ZoomTransition.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/transition/HexagonsTransition.cpp ) set(COMPONENT_PUBLIC_CCFLAGS diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h b/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h index 1ec869455..986ca7f45 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h @@ -23,8 +23,9 @@ #include "Slice.h" #include "wearable_log.h" -#include "TransitionManager.h" +#include "TransitionType.h" #include "SliceTransition.h" +#include "soc_osal.h" namespace OHOS { const static uint16_t gSliceInvalid = 0; @@ -33,16 +34,13 @@ const static uint16_t gMaxHistorySlices = 3; // 默认最多保存三个历史 class Ability { public: - Ability() {}; - ~Ability() {}; - void AddSliceProxy(const uint16_t sliceId, SliceProxy* proxy); - void ChangeSlice(const uint16_t targetSliceId, const uint16_t transitionId = TRANSITION_INVALID, + void ChangeSlice(const uint16_t targetSliceId, TransitionType type = TransitionType::TRANSITION_INVALID, const uint16_t priority = gSliceDefaultPriority); - void SetDefaultSliceId(const uint16_t defaultSliceId) { defaultSliceId_ = defaultSliceId; } + void OnTransitionEnd(); uint16_t GetCurSliceId(void) { if (allSlices_.empty()) { @@ -68,6 +66,8 @@ public: return curSlicePriority_; } protected: + Ability() = default; + virtual ~Ability() = default; struct ProxyStruct { uint16_t sliceId; SliceProxy* proxy; @@ -86,17 +86,18 @@ protected: std::vector allSlices_; SliceStruct curSlice_; + SliceStruct prevSlice_; uint16_t defaultSliceId_ = gSliceInvalid; uint16_t curSlicePriority_ = gSliceDefaultPriority; SliceTransition sliceTransition_; + osal_atomic transitionCount_{0}; void ResumeSlice(const uint16_t priority = gSliceDefaultPriority); void StartSlice(const uint16_t sliceId, const uint16_t priority); void StopSlice(); - void ReleaseCurSlice(); - void PostChangeSlice(const uint16_t targetSliceId, const uint16_t transitionId, const uint16_t priority); + void PostChangeSlice(const uint16_t targetSliceId, TransitionType type, const uint16_t priority); ListsNode* Find(const uint16_t sliceId); diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h b/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h index e846865fd..f03c2da9a 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/NativeAbility.h @@ -58,7 +58,7 @@ public: int GetNativeAbilityState() const; private: NativeAbility() {} - ~NativeAbility() {} + ~NativeAbility() override {} int nativeAbilityState_ = 0; }; } diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h b/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h index cb5ebf1e1..e7b25f52e 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/SliceTransition.h @@ -9,60 +9,46 @@ #define SLICE_TRANSITION_H #include "Slice.h" #include "TransitionCallback.h" +#include "TransitionType.h" #include "animator/animator.h" namespace OHOS { -struct TransitionInfo { - uint32_t duration; - TransitionCallback* transitionCallback; - UIImageView* current; - UIImageView* target; -}; class SliceTransition; class TransitionAnimatorCallback : public AnimatorCallback { public: - TransitionAnimatorCallback(SliceTransition* transition) : transition_(transition) {} + TransitionAnimatorCallback(SliceTransition* transition) : sliceTransition_(transition) {} virtual ~TransitionAnimatorCallback() {} void Callback(UIView* view) override; void OnStop(UIView& view) override; - bool SetAnimationInfo(TransitionInfo info); - private: + bool isStarted_ = false; uint32_t startTime_ = 0; - uint32_t elapseTime_ = 0; - TransitionInfo info_ = {0}; - SliceTransition* transition_ = nullptr; + SliceTransition* sliceTransition_ = nullptr; }; class SliceTransition : public HeapBase { public: - SliceTransition(); + friend class TransitionAnimatorCallback; + SliceTransition() {}; ~SliceTransition(); - void Transition(Slice* targetSlice, TransitionCallback* transition, uint32_t duration = 800); - void TransitionEnd(); + bool SetTransitionType(TransitionType type); + void Transition(UIView* current, UIView* target); + bool IsCurrentSnapshotEnabled(); bool SaveCurrentSnapshot(UIView* view); void StopAnimator(); - bool IsRunning() - { - return isAnimatorRunning_; - } - - bool needWaitFirstVideoFrame_ = false; private: - bool initialized_ = false; - bool isAnimatorRunning_ = false; Animator* animator_ = nullptr; TransitionAnimatorCallback* animatorCallback_ = nullptr; - UIImageView currentSnapshot_; - UIImageView targetSnapshot_; - UIView* targetContainer_ = nullptr; - - void clearImgs(); + UIImageView* currentSnapshot_ = nullptr; + UIImageView* targetSnapshot_ = nullptr; + UIView* currentView_ = nullptr; + UIView* targetView_ = nullptr; + TransitionCallback* transitionCallback_ = nullptr; + void ClearTransitionResource(); void TransitionStart(TransitionCallback* transition, uint32_t duration); - bool GetTargetSnapshot(UIView* view); + bool SaveTargetSnapshot(UIView* view); ImageInfo RectifySnapshot(ImageInfo& dstInfo); - bool IsVideoContained(UIView* view); }; } // namespace OHOS #endif // SLICE_TRANSITION_H diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/TransitionCallback.h b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionCallback.h index 8e0d2f3a7..3c5adce3e 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/include/TransitionCallback.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionCallback.h @@ -12,19 +12,92 @@ namespace OHOS { class TransitionCallback : public HeapBase { public: - TransitionCallback() {} - virtual ~TransitionCallback() {} + /** + * @brief constructor of base class for Transition algorithm + * Note that: + * 1. The transition parameters will impact process flow: + * if enableCurrentSnapshot is true and enableTargetSnapshot is true + * Snap (current slice) -> OnStop(current slice) -> OnStart(target slice) -> OnResume(target slice) + * -> Snap (target slice) -> Add snapshot views -> Transition animator -> Destroy Snapshots + * if enableCurrentSnapshot is true and enableTargetSnapshot is false + * Snap (current slice) -> OnStop(current slice) -> OnStart(target slice) -> OnResume(target slice) + * -> Add snapshot view -> Transition animator -> Destroy Snapshot + * if enableCurrentSnapshot is false and enableTargetSnapshot is true + * OnStart(target slice) -> OnResume(target slice) -> Snap (target slice) + * -> Add snapshot view -> Transition animator -> Destroy Snapshots -> OnStop(current slice) + * if enableCurrentSnapshot is true and enableTargetSnapshot is true + * OnStart(target slice) -> OnResume(target slice) + * -> Transition animator -> OnStop(current slice) + * 2. Memory usage is diffrent when using different transition parameters refer to above process flow + * - Snapshot will cost memory: stride (of screen) * height (of screen) * 3 (RGB888) + * - Start slice will cost new memory usage + * - Stop slice will release its memory usage + * 3. Diffrent methods are invoked when using different parameters, refer to comments of below methods + * @param time Snapshot of current slice + * @param enableCurrentSnapshot Whether use snapshot for current slice in the transition + * @param enableTargetSnapshot Whether use snapshot for target slice in the transition + */ + TransitionCallback(uint32_t time, bool enableCurrentSnapshot, bool enableTargetSnapshot) + { + duration_ = time; + enableCurrentSnapshot_ = enableCurrentSnapshot; + enableTargetSnapshot_ = enableTargetSnapshot; + } + + virtual ~TransitionCallback() = default; + + /* * + * @brief Invoked when transition start if enableCurrentSnapshot is true and enableTargetSnapshot is true + * @param current Snapshot of current slice + * @param target Snapshot of target slice + * @param time Elapse milliseconds since start time of the transition + * Note that:Both current and target UIImageViews are full screen and have aleady been added into Root View, + * and target view is on top of current UIImageView. you can modify it in this function if necessary + */ + virtual void OnTransitionStart(UIImageView* current, UIImageView* target) {}; /* * - * @brief Switch algorithm when slice switching. - * @param current Snapshot for current slice. - * @param target Snapshot for target slice. - * @param time Time elapse to animator start. - * @param duration Time duration for animation. - * @since 1.0 - * @version 1.0 + * @brief Invoked when transition start if enableCurrentSnapshot is true and enableTargetSnapshot is false + * @param current Snapshot of current slice + * @param target Container view of target slice + * @param time Elapse milliseconds since start time of the transition + * Note that: Both current and target views have aleady been added into Root View, current UIImageView is full + * screen, and current view is on top of target view. you can modify it in this function if necessary */ - virtual void TransitionAlg(UIImageView* current, UIImageView* target, uint32_t time, uint32_t duration) {} + virtual void OnTransitionStart(UIImageView* current, UIView* target) {}; + + /* * + * @brief Invoked when transition start if enableCurrentSnapshot is false and enableTargetSnapshot is true + * @param current Container view of current slice + * @param target Snapshot of target slice + * @param time Elapse milliseconds since start time of the transition + * Note that: Both current and target views have aleady been added into Root View, target UIImageView is full + * screen, and target view is on top of current view. you can modify it in this function if necessary + */ + virtual void OnTransitionStart(UIView* current, UIImageView* target) {}; + + /* * + * @brief Invoked when transition start if enableCurrentSnapshot is false and enableTargetSnapshot is false + * @param current Container view of current slice + * @param target Container view of target slice + * Note that: Both current and target views have aleady been added into Root View, + * and target view is on top of current view. you can modify it in this function if necessary + */ + virtual void OnTransitionStart(UIView* current, UIView* target) {}; + + /* * + * @brief Invoked in the transition animator + * @param time Elapse milliseconds since start time of the transition + */ + virtual void TransitionAlg(uint32_t time) {}; + /* * + * @brief Invoked when the transition ends + */ + virtual void OnTransitionEnd() {}; + + uint32_t duration_ = 0; + bool enableCurrentSnapshot_ = true; + bool enableTargetSnapshot_ = true; }; } // namespace OHOS #endif // SLICE_SWITCH_CALLBACK_H diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/TransitionManager.h b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionManager.h index 18006d5e0..1ac16365f 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/include/TransitionManager.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionManager.h @@ -8,18 +8,45 @@ #ifndef TRANSITION_MANAGER_H #define TRANSITION_MANAGER_H +#include "gfx_utils/vector.h" #include "TransitionCallback.h" +#include "TransitionType.h" namespace OHOS { -typedef enum : uint16_t { - TRANSITION_INVALID = 0, - TRANSITION_ZOOM = 1, - TRANSITION_MAX, -} TransitionId; +struct TransitionMap { + TransitionType type; + TransitionCallback* transition; +}; class TransitionManager : public HeapBase { public: - static TransitionCallback* GetTransition(uint16_t id); + static TransitionManager& GetInstance() + { + static TransitionManager instance; + return instance; + } + TransitionCallback* GetTransition(TransitionType type); + void RegisterTransition(TransitionType type, TransitionCallback* transition); + +private: + TransitionManager() {}; + ~TransitionManager(); + TransitionManager(const TransitionManager &) = delete; + TransitionManager &operator=(const TransitionManager &) = delete; + TransitionManager(TransitionManager &&) = delete; + TransitionManager &operator=(TransitionManager &&) = delete; + Graphic::Vector transitions_; +}; + +class TransitionRegister : public HeapBase { +public: + TransitionRegister(TransitionType type, TransitionCallback* transition) + { + TransitionManager::GetInstance().RegisterTransition(type, transition); + } }; } // namespace OHOS + +#define REGIST_TRANSITION(type, func, time, enableCurSnapShot, enableTargetSnapShot) \ + const static OHOS::TransitionRegister (STATIC_VAR)(type, new func(time, enableCurSnapShot, enableTargetSnapShot)) #endif // TRANSITION_MANAGER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/TransitionType.h b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionType.h new file mode 100644 index 000000000..c969472db --- /dev/null +++ b/code/sdk/application/wearable/nativeabilityfwk/include/TransitionType.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. + * Description: Transition + * Author: + * Create: 2024-03 + */ + +#ifndef TRANSITION_TYPES_H +#define TRANSITION_TYPES_H +namespace OHOS { +enum class TransitionType { + TRANSITION_INVALID = 0, + TRANSITION_ZOOM, + TRANSITION_HEXAGONS, + TRANSITION_MAX +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp index 2da2024b1..31e2962a2 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp @@ -16,11 +16,12 @@ #include "Ability.h" #include "graphic_service.h" #include "abilityms_slite_client.h" +#include "common/input_device_manager.h" namespace OHOS { void Ability::AddSliceProxy(const uint16_t sliceId, SliceProxy* proxy) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::AddSliceProxy sliceId = %d", sliceId); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::AddSliceProxy sliceId = %d", sliceId); if (sliceId <= gSliceInvalid || proxy == nullptr) { return; } @@ -35,7 +36,7 @@ void Ability::AddSliceProxy(const uint16_t sliceId, SliceProxy* proxy) void Ability::StartSlice(const uint16_t sliceId, const uint16_t priority) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::StartSlice sliceId = %d", sliceId); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::StartSlice sliceId = %d", sliceId); if (sliceId <= gSliceInvalid) { return; } @@ -44,18 +45,22 @@ void Ability::StartSlice(const uint16_t sliceId, const uint16_t priority) if (node == nullptr) { return; } - + InputDeviceManager::GetInstance()->ClearPressableViews(); Slice* nextSlice = node->value_.proxy->CreateSlice(); if (nextSlice == nullptr) { return; } - WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::StartSlice Size = %d", allSlices_.size()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::StartSlice Size = %d", allSlices_.size()); // 记录最多gMaxHistorySlices个页面id if (allSlices_.size() == gMaxHistorySlices) { allSlices_.erase(allSlices_.begin()); } allSlices_.push_back(sliceId); + if (curSlice_.slice != nullptr) { + prevSlice_.sliceId = curSlice_.sliceId; + prevSlice_.slice = curSlice_.slice; + } curSlice_.sliceId = sliceId; curSlice_.slice = nextSlice; @@ -65,17 +70,6 @@ void Ability::StartSlice(const uint16_t sliceId, const uint16_t priority) nextSlice->OnResume(); } -void Ability::ReleaseCurSlice() { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::ReleaseCurSlice"); - if (curSlice_.slice != nullptr) { - curSlice_.sliceId = gSliceInvalid; - delete curSlice_.slice; - curSlice_.slice = nullptr; - } - - curSlicePriority_ = gSliceDefaultPriority; -} - ListsNode* Ability::Find(const uint16_t sliceId) { if (sliceId <= gSliceInvalid) { @@ -97,24 +91,30 @@ ListsNode* Ability::Find(const uint16_t sliceId) return nullptr; } -void Ability::ChangeSlice(const uint16_t targetSliceId, const uint16_t transitionId, const uint16_t priority) +void Ability::ChangeSlice(const uint16_t targetSliceId, TransitionType type, const uint16_t priority) { - if (sliceTransition_.IsRunning()) { - return; + if (osal_atomic_read(&transitionCount_) <= 0) { + osal_atomic_inc(&transitionCount_); + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, + type, priority)); } - // onStop释放当前页面需要和当前页面的事件监听异步执行,否则会出现自己杀掉自己的情况 - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, - transitionId, priority)); } -void Ability::PostChangeSlice(const uint16_t targetSliceId, const uint16_t transitionId, const uint16_t priority) +void Ability::PostChangeSlice(const uint16_t targetSliceId, TransitionType type, const uint16_t priority) { - if (curSlice_.slice != nullptr && transitionId > TRANSITION_INVALID && transitionId < TRANSITION_MAX) { - sliceTransition_.SaveCurrentSnapshot(curSlice_.slice->GetSliceContainer()); + bool useTransition = sliceTransition_.SetTransitionType(type); + bool isCurSnapshotEnabled = sliceTransition_.IsCurrentSnapshotEnabled(); + + if (!useTransition) { + StopSlice(); + } else if (isCurSnapshotEnabled) { + if (!sliceTransition_.SaveCurrentSnapshot(curSlice_.slice->GetSliceContainer())) { + useTransition = false; + } + StopSlice(); } // slice页面跳转,先onstop,再onstart.在一个线程同步执行绘制,不会出现闪屏现象 - StopSlice(); #ifdef JS_ENABLE ElementName *elementName = OHOS::AbilityMsClient::GetInstance().GetTopAbility(); if (strcmp(elementName->bundleName, "com.huawei.launcher") != 0) { @@ -122,10 +122,32 @@ void Ability::PostChangeSlice(const uint16_t targetSliceId, const uint16_t trans } #endif StartSlice(targetSliceId, priority); - if (transitionId > TRANSITION_INVALID && transitionId < TRANSITION_MAX) { - sliceTransition_.Transition(curSlice_.slice, TransitionManager::GetTransition(transitionId)); + + if (useTransition) { + if (isCurSnapshotEnabled) { + sliceTransition_.Transition(nullptr, curSlice_.slice->GetSliceContainer()); + } else { + sliceTransition_.Transition(prevSlice_.slice->GetSliceContainer(), curSlice_.slice->GetSliceContainer()); + } + } else { + osal_atomic_dec(&transitionCount_); } +} +void Ability::OnTransitionEnd() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::OnTransitionEnd"); + if (!sliceTransition_.IsCurrentSnapshotEnabled()) { + if (prevSlice_.slice != nullptr) { + prevSlice_.slice->OnStop(); + if (prevSlice_.slice != nullptr) { + prevSlice_.sliceId = gSliceInvalid; + delete prevSlice_.slice; + prevSlice_.slice = nullptr; + } + } + } + osal_atomic_dec(&transitionCount_); } void Ability::ResumeSlice(const uint16_t priority) @@ -142,10 +164,16 @@ void Ability::ResumeSlice(const uint16_t priority) void Ability::StopSlice() { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::StopSlice"); if (curSlice_.slice != nullptr) { curSlice_.slice->OnStop(); - ReleaseCurSlice(); + if (curSlice_.slice != nullptr) { + curSlice_.sliceId = gSliceInvalid; + delete curSlice_.slice; + curSlice_.slice = nullptr; + } + + curSlicePriority_ = gSliceDefaultPriority; } } - } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp index ee2c3482c..2cecbeb0b 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/SliceTransition.cpp @@ -10,56 +10,40 @@ #include "draw/clip_img.h" #include "components/root_view.h" #include "SliceTransition.h" +#include "TransitionManager.h" +#include "NativeAbility.h" namespace OHOS { static UILiteSurfaceView* g_surface = nullptr; void TransitionAnimatorCallback::Callback(UIView* view) { - elapseTime_ = HALTick::GetInstance().GetElapseTime(startTime_); - if (elapseTime_ > info_.duration) { - elapseTime_ = info_.duration; - } - if (transition_->needWaitFirstVideoFrame_) { - if ((g_surface == nullptr) || ((g_surface != nullptr) && g_surface->IsFirstFrameCame())) { - transition_->StopAnimator(); + TransitionCallback* callback = sliceTransition_->transitionCallback_; + if (!isStarted_) { + if (callback->enableCurrentSnapshot_ && callback->enableTargetSnapshot_) { + callback->OnTransitionStart(sliceTransition_->currentSnapshot_, sliceTransition_->targetSnapshot_); + } else if (callback->enableCurrentSnapshot_ && !callback->enableTargetSnapshot_) { + callback->OnTransitionStart(sliceTransition_->currentSnapshot_, sliceTransition_->targetView_); + } else if (!callback->enableCurrentSnapshot_ && callback->enableTargetSnapshot_) { + callback->OnTransitionStart(sliceTransition_->currentView_, sliceTransition_->targetSnapshot_); + } else { + callback->OnTransitionStart(sliceTransition_->currentView_, sliceTransition_->targetView_); } - } else { - info_.transitionCallback->TransitionAlg(info_.current, info_.target, elapseTime_, info_.duration); + startTime_ = HALTick::GetInstance().GetTime(); + isStarted_ = true; } -} -void TransitionAnimatorCallback::OnStop(UIView& view) -{ - transition_->TransitionEnd(); -} - -bool TransitionAnimatorCallback::SetAnimationInfo(TransitionInfo info) -{ - if (info.current == nullptr || info.target == nullptr) { - return false; + uint32_t elapseTime = HALTick::GetInstance().GetElapseTime(startTime_); + if (elapseTime > callback->duration_) { + sliceTransition_->StopAnimator(); + return; } - - info_ = info; - startTime_ = HALTick::GetInstance().GetTime(); - return true; + callback->TransitionAlg(elapseTime); } -SliceTransition::SliceTransition() +void TransitionAnimatorCallback::OnStop(UIView& view) { - animatorCallback_ = new TransitionAnimatorCallback(this); - if (animatorCallback_ == nullptr) { - return; - } - animator_ = new Animator(animatorCallback_, nullptr, 0, false); - if (animator_ == nullptr) { - delete animatorCallback_; - animatorCallback_ = nullptr; - return; - } - - currentSnapshot_.SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - targetSnapshot_.SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - initialized_ = true; + isStarted_ = false; + sliceTransition_->transitionCallback_->OnTransitionEnd(); } SliceTransition::~SliceTransition() @@ -73,18 +57,46 @@ SliceTransition::~SliceTransition() delete animatorCallback_; animatorCallback_ = nullptr; } - clearImgs(); + ClearTransitionResource(); } -void SliceTransition::clearImgs() +void SliceTransition::ClearTransitionResource() { - if (currentSnapshot_.GetImageInfo() != nullptr && currentSnapshot_.GetImageInfo()->data != nullptr) { - ImageCacheFree(*const_cast(currentSnapshot_.GetImageInfo())); + if (currentSnapshot_->GetImageInfo() != nullptr && currentSnapshot_->GetImageInfo()->data != nullptr) { + ImageCacheFree(*const_cast(currentSnapshot_->GetImageInfo())); + } + + if (targetSnapshot_->GetImageInfo() != nullptr && targetSnapshot_->GetImageInfo()->data != nullptr) { + ImageCacheFree(*const_cast(targetSnapshot_->GetImageInfo())); } + if (currentSnapshot_ != nullptr) { + delete currentSnapshot_; + currentSnapshot_ = nullptr; + } + if (targetSnapshot_ != nullptr) { + delete targetSnapshot_; + targetSnapshot_ = nullptr; + } + currentView_ = nullptr; + targetView_ = nullptr; + transitionCallback_ = nullptr; +} - if (targetSnapshot_.GetImageInfo() != nullptr && targetSnapshot_.GetImageInfo()->data != nullptr) { - ImageCacheFree(*const_cast(targetSnapshot_.GetImageInfo())); +bool SliceTransition::SetTransitionType(TransitionType type) +{ + transitionCallback_ = TransitionManager::GetInstance().GetTransition(type); + if (transitionCallback_ == nullptr) { + return false; } + return true; +} + +bool SliceTransition::IsCurrentSnapshotEnabled() +{ + if (transitionCallback_ == nullptr) { + return false; + } + return transitionCallback_->enableCurrentSnapshot_; } ImageInfo SliceTransition::RectifySnapshot(ImageInfo& srcInfo) @@ -92,7 +104,7 @@ ImageInfo SliceTransition::RectifySnapshot(ImageInfo& srcInfo) if (Screen::GetInstance().GetScreenShape() == CIRCLE) { int16_t radius = Screen::GetInstance().GetWidth() / 2; // 2: half of width/height ImageInfo dstInfo = {{0}}; - dstInfo = ClipImg::ClipImgByCircle(srcInfo, nullptr, { radius, radius }, radius, ARGB8888); + dstInfo = ClipImg::ClipImgByCircle(srcInfo, { radius, radius }, radius, ARGB8888, true); if (dstInfo.data == nullptr) { return srcInfo; } else { @@ -104,32 +116,19 @@ ImageInfo SliceTransition::RectifySnapshot(ImageInfo& srcInfo) } } -bool SliceTransition::IsVideoContained(UIView* view) -{ - while (view != nullptr) { - UIView* tempView = view; - view = view->GetNextSibling(); - if (tempView->GetViewType() == UI_LITE_SURFACE_VIEW) { - g_surface = dynamic_cast(tempView); - return true; - } - if (tempView->IsViewGroup()) { - if (IsVideoContained(static_cast(tempView)->GetChildrenHead())) { - return true; - } - } - } - return false; -} - bool SliceTransition::SaveCurrentSnapshot(UIView* view) { - if (!initialized_ || view == nullptr) { + if (view == nullptr) { + return false; + } + currentSnapshot_ = new UIImageView(); + if (currentSnapshot_ == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "currentSnapshot new failed"); return false; } ImageInfo info = {{0}}; - if (RootView::GetInstance()->isSystemViewEmpty() && !IsVideoContained(view)) { + if (RootView::GetInstance()->isSystemViewEmpty() && !view->IsVideoContained()) { if (!Screen::GetInstance().GetCurrentScreenBitmap(info)) { return false; } @@ -139,79 +138,83 @@ bool SliceTransition::SaveCurrentSnapshot(UIView* view) } } ImageInfo rectifiedInfo = RectifySnapshot(info); - currentSnapshot_.SetSrc(&rectifiedInfo); + currentSnapshot_->SetSrc(&rectifiedInfo); return true; } -bool SliceTransition::GetTargetSnapshot(UIView* view) +bool SliceTransition::SaveTargetSnapshot(UIView* view) { ImageInfo info = {{0}}; if (!view->GetBitmap(info)) { return false; } ImageInfo rectifiedInfo = RectifySnapshot(info); - targetSnapshot_.SetSrc(&rectifiedInfo); + targetSnapshot_ = new UIImageView(); + if (targetSnapshot_ == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "targetSnapshot new failed"); + return false; + } + targetSnapshot_->SetSrc(&rectifiedInfo); return true; } -void SliceTransition::Transition(Slice* targetSlice, TransitionCallback* transition, uint32_t duration) +void SliceTransition::Transition(UIView* current, UIView* target) { - if (targetSlice == nullptr || targetSlice->GetSliceContainer() == nullptr || transition == nullptr || !initialized_ || - (currentSnapshot_.GetImageInfo() != nullptr && currentSnapshot_.GetImageInfo()->data == nullptr)) { - clearImgs(); + if (animatorCallback_ == nullptr) { + animatorCallback_ = new TransitionAnimatorCallback(this); + } + + if (animator_ == nullptr) { + animator_ = new Animator(animatorCallback_, nullptr, 0, true); + } + + if ((target == nullptr || transitionCallback_ == nullptr) || + (!transitionCallback_->enableCurrentSnapshot_ && (current == nullptr))) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "SliceTransition::Transition curV:%d tarV:%d", + current != nullptr, target != nullptr); + NativeAbility::GetInstance().OnTransitionEnd(); + ClearTransitionResource(); return; } + currentView_ = current; + targetView_ = target; - targetContainer_ = targetSlice->GetSliceContainer(); - if (IsVideoContained(targetContainer_)) { - needWaitFirstVideoFrame_ = true; - } else { - if (!GetTargetSnapshot(targetContainer_)) { - clearImgs(); + if (transitionCallback_->enableTargetSnapshot_) { + if (!SaveTargetSnapshot(target)) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "SliceTransition target snap failed"); + NativeAbility::GetInstance().OnTransitionEnd(); + ClearTransitionResource(); return; } } + animator_->Start(); - TransitionStart(transition, duration); + if (transitionCallback_->enableCurrentSnapshot_) { + currentSnapshot_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), + Screen::GetInstance().GetHeight()); + RootView::GetInstance()->Add(currentSnapshot_); + } + + if (transitionCallback_->enableTargetSnapshot_) { + targetView_->SetVisible(false); + targetSnapshot_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), + Screen::GetInstance().GetHeight()); + RootView::GetInstance()->Add(targetSnapshot_); + } } void SliceTransition::StopAnimator() { animator_->Stop(); -} - -void SliceTransition::TransitionStart(TransitionCallback* transition, uint32_t duration) -{ - TransitionInfo info; - info.current = ¤tSnapshot_; - info.target = &targetSnapshot_; - info.duration = (duration != 0) ? duration : 800; // 800: default duration - info.transitionCallback = transition; - if (animatorCallback_->SetAnimationInfo(info)) { - animator_->SetTime(info.duration); - animator_->Start(); - isAnimatorRunning_ = true; - } else { - clearImgs(); - return; + NativeAbility::GetInstance().OnTransitionEnd(); + if (transitionCallback_->enableCurrentSnapshot_) { + RootView::GetInstance()->Remove(currentSnapshot_); } - targetContainer_->SetVisible(false); - RootView::GetInstance()->Add(¤tSnapshot_); - if (!needWaitFirstVideoFrame_) { - RootView::GetInstance()->Add(&targetSnapshot_); - } -} -void SliceTransition::TransitionEnd(void) -{ - clearImgs(); - isAnimatorRunning_ = false; - RootView::GetInstance()->Remove(¤tSnapshot_); - if (!needWaitFirstVideoFrame_) { - RootView::GetInstance()->Remove(&targetSnapshot_); - } - needWaitFirstVideoFrame_ = false; - g_surface = nullptr; - targetContainer_->SetVisible(true); + if (transitionCallback_->enableTargetSnapshot_) { + RootView::GetInstance()->Remove(targetSnapshot_); + targetView_->SetVisible(true); + } + ClearTransitionResource(); } } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/TransitionManager.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/TransitionManager.cpp index 739013498..06a30ed19 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/src/TransitionManager.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/TransitionManager.cpp @@ -7,25 +7,43 @@ #include "TransitionManager.h" #include "ZoomTransition.h" +#include "gfx_utils/vector.h" namespace OHOS { -struct TransitionMapper { - uint16_t id; - TransitionCallback* obj; -}; - -static const TransitionMapper TRANSITION_MAPPER[] = { - {TRANSITION_ZOOM, new ZoomTransition()}, -}; +TransitionManager::~TransitionManager() +{ + for(uint16_t i =0; i < transitions_.Size(); i++) { + if (transitions_[i].transition != nullptr) { + delete transitions_[i].transition; + transitions_[i].transition = nullptr; + } + } +} -TransitionCallback* TransitionManager::GetTransition(uint16_t id) +TransitionCallback* TransitionManager::GetTransition(TransitionType type) { - uint16_t size = sizeof(TRANSITION_MAPPER) / sizeof(TRANSITION_MAPPER[0]); - for (int index = 0; index < size; index++) { - if ((TRANSITION_MAPPER[index].id == id)) { - return TRANSITION_MAPPER[index].obj; + for(uint16_t i =0; i < transitions_.Size(); i++) { + if (transitions_[i].type == type) { + return transitions_[i].transition; } } return nullptr; } + +void TransitionManager::RegisterTransition(TransitionType type, TransitionCallback* transition) +{ + if (transition == nullptr) { + GRAPHIC_LOGE("transition can't be nullptr"); + return; + } + for(uint16_t i =0; i < transitions_.Size(); i++) { + if (transitions_[i].type == type) { + GRAPHIC_LOGE("RegisterTransition failed because type %d already registered", type); + return; + } + } + GRAPHIC_LOGI("register transition %d", type); + TransitionMap map = {type, transition}; + transitions_.PushBack(map); +} } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.cpp new file mode 100644 index 000000000..86c7b646d --- /dev/null +++ b/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. + * Description: ZoomTransition + * Author: + * Create: 2024-04 + */ + +#include "HexagonsTransition.h" +#include "animator/easing_equation.h" +#include "components/root_view.h" +#include "TransitionManager.h" + +namespace OHOS { +REGIST_TRANSITION(TransitionType::TRANSITION_HEXAGONS, HexagonsTransition, 800, false, true); +static constexpr int16_t RANGE = 1000; +static const float HEXAGONS_SCALE_INIT = 1.0f; +static const float HEXAGONS_SCALE_END = 2.5f; +static const float HEXAGONS_OPA_START = 255; +static const float HEXAGONS_OPA_END = 0; + +void HexagonsTransition::OnTransitionStart(UIView* current, UIImageView* target) +{ + current_ = dynamic_cast(current); + if (current_ == nullptr) { + return; + } + target_ = target; + int8_t index = current_->GetFocusedImgIndex(); + if (index <= 0) { + focusIndex_ = 0; + } else { + focusIndex_ = static_cast(index); + } + focusView_ = dynamic_cast(current_->GetViewByIndex(focusIndex_)); + if (focusView_ == nullptr) { + return; + } + current_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + Vector2 delta = Vector2(current_->GetWidth() / 2, current_->GetHeight() / 2) - + current_->GetCurrentPosition(focusIndex_); + scaleStart_ = current_->GetGlobalScale(); + opaStart_ = current->GetOpaScale(); + uint32_t offsetTime = static_cast((scaleStart_ - HEXAGONS_SCALE_INIT) / + (HEXAGONS_SCALE_END - HEXAGONS_SCALE_INIT) * duration_ * 0.5f); // 0.5 half of duration + durationBackup_ = duration_; + duration_ = duration_ - offsetTime; + xDistance_ = delta.x_; + yDistance_ = delta.y_; + prevX_ = 0; + prevY_ = 0; + + // put target image view in the background + RootView::GetInstance()->Remove(target); + RootView::GetInstance()->Insert(nullptr, target); +} + +void HexagonsTransition::TransitionAlg(uint32_t time) +{ + if ((current_ == nullptr) || (target_== nullptr) || (focusView_ == nullptr)) { + return; + } + float timeRatio = time * 1.0f / duration_; + if (FloatLessEqual(timeRatio, 0.5f)) { // 0.5f, half of transition + float hexagonsRatio = 2 * timeRatio; + int16_t curX = static_cast(hexagonsRatio * xDistance_); + int16_t curY = static_cast(hexagonsRatio * yDistance_); + current_->ScrollBy(curX - prevX_, curY - prevY_); + prevX_ = curX; + prevY_ = curY; + + float curScale = hexagonsRatio * (HEXAGONS_SCALE_END - scaleStart_) + scaleStart_; + uint8_t opa = hexagonsRatio * (HEXAGONS_OPA_END - opaStart_) + opaStart_; + focusView_->SetOpaScale(opa); + current_->Scale(curScale, focusIndex_); + Rect rect = focusView_->GetRect(); + target_->SetPosition(rect.GetX(), rect.GetY()); + targetMiddleScale_ = Vector2(rect.GetWidth() * 1.0f / target_->GetWidth(), + rect.GetHeight() * 1.0f / target_->GetHeight()); + target_->Scale(targetMiddleScale_, Vector2(0.0f, 0.0f)); + } else if (FloatLessEqual(timeRatio, 1.0f)) { + current_->SetVisible(false); + Vector2 targetScale = {2 * (timeRatio - 0.5f) * (1.0f - targetMiddleScale_.x_) + targetMiddleScale_.x_, + 2 * (timeRatio - 0.5f) * (1.0f - targetMiddleScale_.y_) + targetMiddleScale_.y_}; + target_->SetPosition(0, 0); + target_->Scale(targetScale, Vector2(target_->GetWidth() / 2.0f, target_->GetHeight() / 2.0f)); + } +} + +void HexagonsTransition::OnTransitionEnd() +{ + duration_ = durationBackup_; +} + +} // namespace OHOS diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.h b/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.h new file mode 100644 index 000000000..a7315dbfc --- /dev/null +++ b/code/sdk/application/wearable/nativeabilityfwk/src/transition/HexagonsTransition.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. + * Description: ZoomTransition + * Author: + * Create: 2024-04 + */ + +#ifndef HEXAGONS_TRASITION_H +#define HEXAGONS_TRASITION_H +#include "TransitionCallback.h" +#include "components/ui_custom_hexagons_list.h" + +namespace OHOS { +class HexagonsTransition : public TransitionCallback { +public: + HexagonsTransition(uint32_t time, bool enableCurrentSnapshot, bool enableTargetSnapshot) : + TransitionCallback(time, enableCurrentSnapshot, enableTargetSnapshot) {} + ~HexagonsTransition() override {} + void OnTransitionStart(UIView* current, UIImageView* target) override; + void TransitionAlg(uint32_t time) override; + void OnTransitionEnd() override; +private: + uint32_t durationBackup_ = 0; + UICustomHexagonsList* current_ = nullptr; + UIImageView* target_ = nullptr; + UIImageView* focusView_ = nullptr; + Vector2 targetMiddleScale_ = {0, 0}; + uint8_t focusIndex_ = 0; + float scaleStart_ = 1.0f; + uint8_t opaStart_ = 255; + int16_t xDistance_ = 0; + int16_t yDistance_ = 0; + int16_t prevX_ = 0; + int16_t prevY_ = 0; +}; +} // namespace OHOS +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.cpp index 993c0b2eb..a6531459f 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.cpp @@ -5,15 +5,28 @@ * Create: 2023-11 */ -#include "animator/easing_equation.h" #include "ZoomTransition.h" +#include "animator/easing_equation.h" +#include "TransitionManager.h" namespace OHOS { static constexpr int16_t RANGE = 1000; -void ZoomTransition::TransitionAlg(UIImageView* current, UIImageView* target, uint32_t time, uint32_t duration) +REGIST_TRANSITION(TransitionType::TRANSITION_ZOOM, ZoomTransition, 800, true, true); + +void ZoomTransition::OnTransitionStart(UIImageView* current, UIImageView* target) +{ + current_ = current; + target_ = target; +} + +void ZoomTransition::TransitionAlg(uint32_t time) { + if ((current_ == nullptr) || (target_ == nullptr)) { + return; + } + float scale; - uint32_t half = duration / 2; // 2: half of duration + uint32_t half = duration_ / 2; // 2: half of duration if (time < half) { scale = 1 - EasingEquation::QuadEaseOut(0, RANGE, time, half) / static_cast(RANGE); } else { @@ -21,19 +34,19 @@ void ZoomTransition::TransitionAlg(UIImageView* current, UIImageView* target, ui } uint8_t opa = scale * OPA_OPAQUE; if (time < half) { - int16_t centerX = current->GetX() + current->GetWidth() / 2; // 2: half of width - int16_t centerY = current->GetY() + current->GetHeight() / 2; // 2: half of height - current->SetVisible(true); - target->SetVisible(false); - current->Scale(Vector2{scale, scale}, Vector2{centerX, centerY}); - current->SetOpaScale(opa); + int16_t centerX = current_->GetX() + current_->GetWidth() / 2; // 2: half of width + int16_t centerY = current_->GetY() + current_->GetHeight() / 2; // 2: half of height + current_->SetVisible(true); + target_->SetVisible(false); + current_->Scale(Vector2{scale, scale}, Vector2{centerX, centerY}); + current_->SetOpaScale(opa); } else { - int16_t centerX = target->GetX() + target->GetWidth() / 2; // 2: half of width - int16_t centerY = target->GetY() + target->GetHeight() / 2; // 2: half of height - target->SetVisible(true); - current->SetVisible(false); - target->Scale(Vector2{scale, scale}, Vector2{centerX, centerY}); - target->SetOpaScale(opa); + int16_t centerX = target_->GetX() + target_->GetWidth() / 2; // 2: half of width + int16_t centerY = target_->GetY() + target_->GetHeight() / 2; // 2: half of height + target_->SetVisible(true); + current_->SetVisible(false); + target_->Scale(Vector2{scale, scale}, Vector2{centerX, centerY}); + target_->SetOpaScale(opa); } } } // namespace OHOS diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.h b/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.h index a5e3fbb20..419f2c086 100644 --- a/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.h +++ b/code/sdk/application/wearable/nativeabilityfwk/src/transition/ZoomTransition.h @@ -12,9 +12,14 @@ namespace OHOS { class ZoomTransition : public TransitionCallback { public: - ZoomTransition(void) {} - virtual ~ZoomTransition() override {} - void TransitionAlg(UIImageView* current, UIImageView* target, uint32_t time, uint32_t duration) override; + ZoomTransition(uint32_t time, bool enableCurrentSnapshot, bool enableTargetSnapshot) : + TransitionCallback(time, enableCurrentSnapshot, enableTargetSnapshot) {} + ~ZoomTransition() override {} + void OnTransitionStart(UIImageView* current, UIImageView* target) override; + void TransitionAlg(uint32_t time) override; +private: + UIImageView* current_ = nullptr; + UIImageView* target_ = nullptr; }; } // namespace OHOS #endif // ZOOM_TRANSITION_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/CMakeLists.txt b/code/sdk/application/wearable/nativeapp/CMakeLists.txt index eab02415b..35ef952d3 100644 --- a/code/sdk/application/wearable/nativeapp/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeapp/CMakeLists.txt @@ -29,6 +29,10 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/include ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/include ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_desktop/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_dial/include ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/include ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/include ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/include @@ -81,6 +85,8 @@ set(PRIVATE_HEADER ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits/ ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/utils/include + ${ROOT_DIR}/open_source/openharmony/utils/native/lite/include + ${ROOT_DIR}/open_source/openharmony/utils/native/lite/kv_store/innerkits ) set(SOURCES @@ -88,6 +94,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainPresenter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainViewSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainPresenterSample.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ModelListenerSample.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PresenterTask.cpp @@ -202,6 +209,24 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingItemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_desktop/src/SetDesktopModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_desktop/src/SetDesktopPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_desktop/src/SetDesktopView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardItem.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardNoCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_card/src/SetCardDeleteView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/src/AddCardAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/src/AddCardItem.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/src/AddCardModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/src/AddCardPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/add_card/src/AddCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_dial/src/SetDialModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_dial/src/SetDialPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/set_dial/src/SetDialView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/src/KeyInputListener.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassControlView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassCalibrationView.cpp @@ -240,6 +265,9 @@ set(SOURCES ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/cube_rotate_view.cpp ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/ui_test_cube_rotate.cpp ${UI_SAMPLE_ROOT}/components/ui_test_video_play/ui_test_video_play.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_coverflow/ui_test_coverflow.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dial/DialRotateImgView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/dial/DialOptionImgView.cpp @@ -307,6 +335,7 @@ set(COMPONENT_CCFLAGS -nostdlib -Wno-c++11-narrowing -Wno-error=unused-function + -Wno-missing-field-initializers ) set(WHOLE_LINK diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h index 63c3c0b99..1c77878c0 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h @@ -48,6 +48,10 @@ typedef enum : uint16_t { #ifdef SUPPORT_ALIPAY_SEC VIEW_MAIN_ALIPAY, #endif + VIEW_SET_DESKTOP, + VIEW_SET_CARD, + VIEW_ADD_CARD, + VIEW_SET_DIAL, VIEW_MAX_INTER_APP, // 在此之前添加native应用ID. VIEW_EXTERN_APP = 0xFFFE, // 三方应用 VIEW_INVALIDE_APP = 0xFFFF, diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h index 6494d506b..cadd1ee31 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h @@ -43,6 +43,10 @@ public: void InitRebootSlice(void); void InitUISampleSlice(void); void InitMainAlipaySlice(void); + void InitSetDesktopSlice(void); + void InitSetCardSlice(void); + void InitAddCardSlice(void); + void InitSetDialSlice(void); private: void InitAllNativeSlices(void); diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h index feadb4e73..7f1935264 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h @@ -13,6 +13,21 @@ #include "graphic_config.h" namespace OHOS { + static const int CARD_SETTING_COUNT_MAX = 5; + typedef enum { + WATCH_FACE = 0, /* 主表盘枚举值不能修改 */ + HEART_RATE, + COMPASS, + ACTIVITY, + MUSIC_PLAYER, + MAX_CARD, + } CardId; + + typedef enum { + DIAL_CLOCK = 0, + DIAL_MAX, + } DialId; + #ifndef UNUSED #define UNUSED(x) ((void)(x)) #endif @@ -38,6 +53,7 @@ namespace OHOS { #define APP_RES_PATH "/user/res" #define APP_MUSIC_PATH "/user/music" #define APP_VIDEO_PATH "/user/video" + #define APP_DIAL_PATH "/user/dial" static constexpr const char *CARD_CONFIG_PATH = "/user/cardconfig.bin"; @@ -139,6 +155,10 @@ namespace OHOS { static constexpr const char *PNG_SHUTDOWN_BUTTON_IMAGE = APP_RES_PATH"/SHUTDOWN_BUTTON.bin"; static constexpr const char *PNG_SETTTING_REBOOT_IMAGE = APP_RES_PATH"/SETTTING_REBOOT.bin"; static constexpr const char *PNG_SETTTING_SHUTDOWN_IMAGE = APP_RES_PATH"/SETTTING_SHUTDOWN.bin"; + static constexpr const char *PNG_SETTTING_DESKTOP_IMAGE = APP_RES_PATH"/SETTTING_DESKTOP.bin"; + static constexpr const char *PNG_SET_DESKTOP_LIST_IMAGE = APP_RES_PATH"/SET_DESKTOP_LIST.bin"; + static constexpr const char *PNG_SET_DESKTOP_HEXAGONS_IMAGE = APP_RES_PATH"/SET_DESKTOP_HEXAGONS.bin"; + static constexpr const char *PNG_SET_DESKTOP_BG_IMAGE = APP_RES_PATH"/SET_DESKTOP_BG.bin"; static constexpr const char *PNG_CONNECT_PHONE_IMAGE = APP_RES_PATH"/CONNECT_PHONE.bin"; static constexpr const char *PNG_BLUETOOTH_STITLE = APP_RES_PATH"/BLUETOOTH_TITLE.bin"; @@ -328,6 +348,15 @@ namespace OHOS { static constexpr const char *PNG_WALK_STEPS_IMAGE = APP_RES_PATH"/STEPS_IMAGE.bin"; static constexpr const char *PNG_APPLIST_UI_SAMPLE_IMAGE = APP_RES_PATH"/APPLIST_UI_SAMPLE.bin"; // Applist图标 + + static constexpr const char *PNG_SET_CARD_ADD = APP_RES_PATH"/CARD_ADD.bin"; + static constexpr const char *PNG_SET_CARD_DEL = APP_RES_PATH"/CARD_DEL.bin"; + static constexpr const char *PNG_SET_CARD_HEART = APP_RES_PATH"/CARD_HEART.bin"; + static constexpr const char *PNG_SET_CARD_COMPASS = APP_RES_PATH"/CARD_COMPASS.bin"; + static constexpr const char *PNG_SET_CARD_ACTIVITY = APP_RES_PATH"/CARD_ACTIVITY.bin"; + static constexpr const char *PNG_SET_CARD_PLAYER = APP_RES_PATH"/CARD_PLAYER.bin"; + + static constexpr const char *PNG_SET_DIAL_CLOCK = APP_RES_PATH"/DIAL_CLOCK.bin"; } #endif // UI_CONFIG_H diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainPresenter.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainPresenter.h index 7e25bbdbe..6aa7d468f 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainPresenter.h @@ -23,7 +23,7 @@ class MainView; class MainPresenter : public Presenter { public: MainPresenter(); - virtual ~MainPresenter(); + ~MainPresenter() override; void OnStart() override; void OnPause() override; diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainView.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainView.h index 6a13caea8..818dd6822 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainView.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/slices/main/MainView.h @@ -42,7 +42,7 @@ class MainPresenter; class MainView : public View { public: MainView(); - virtual ~MainView(); + ~MainView() override; void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index 3637aee87..a1e55d1bf 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -66,16 +66,25 @@ #include "AlipayMainView.h" #include "AlipayPresenter.h" #endif +#include "SetDesktopView.h" +#include "SetDesktopPresenter.h" +#include "SetCardView.h" +#include "SetCardPresenter.h" +#include "AddCardView.h" +#include "AddCardPresenter.h" +#include "SetDialView.h" +#include "SetDialPresenter.h" +#ifdef JS_ENABLE +#include "product_adapter.h" +#endif namespace OHOS { -struct AppViewMapper -{ +struct AppViewMapper { AppViewId id; void (NativeLauncher::*func)(void); }; -struct ViewIdToString -{ +struct ViewIdToString { AppViewId id; char idForUikit[256]; }; @@ -89,8 +98,8 @@ static const AppViewMapper SLICE_MAPPER[] = { {VIEW_ALARM_POP_UP, &NativeLauncher::InitAlarmPopUpSlice}, {VIEW_BLOODOXY_SAMPLE, &NativeLauncher::InitMainBloodOxyView}, {VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice}, - {VIEW_CALLER_SAMPLE,&NativeLauncher::InitMainCallerLogView}, - {VIEW_MAEKPHONE_SAMPLE,&NativeLauncher::InitMainMakePhoneView}, + {VIEW_CALLER_SAMPLE, &NativeLauncher::InitMainCallerLogView}, + {VIEW_MAEKPHONE_SAMPLE, &NativeLauncher::InitMainMakePhoneView}, {VIEW_BLUETOOTH_EARPHONE, &NativeLauncher::InitBluetoothSlice}, {VIEW_COMPASS, &NativeLauncher::InitCompassSlice}, {VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice}, @@ -102,6 +111,10 @@ static const AppViewMapper SLICE_MAPPER[] = { #ifdef SUPPORT_ALIPAY_SEC {VIEW_MAIN_ALIPAY, &NativeLauncher::InitMainAlipaySlice}, #endif + {VIEW_SET_DESKTOP, &NativeLauncher::InitSetDesktopSlice}, + {VIEW_SET_CARD, &NativeLauncher::InitSetCardSlice}, + {VIEW_ADD_CARD, &NativeLauncher::InitAddCardSlice}, + {VIEW_SET_DIAL, &NativeLauncher::InitSetDialSlice}, }; static const ViewIdToString VIEW_MAPPER[] = { @@ -126,6 +139,10 @@ static const ViewIdToString VIEW_MAPPER[] = { #ifdef SUPPORT_ALIPAY_SEC {VIEW_MAIN_ALIPAY, "mianAlipayView"}, #endif + {VIEW_SET_DESKTOP, "SetDesktop"}, + {VIEW_SET_CARD, "SetCard"}, + {VIEW_ADD_CARD, "AddCard"}, + {VIEW_SET_DIAL, "SetDial"}, }; NativeLauncher::NativeLauncher() {} @@ -137,8 +154,13 @@ NativeLauncher &NativeLauncher::GetInstance(void) return instance; } -void NativeLauncher::InitNativeLauncher() { - GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); +void NativeLauncher::InitNativeLauncher() +{ +#ifdef JS_ENABLE + ACELite::ProductAdapter::SetScreenSize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); +#endif + GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, + OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); // 初始化所有预加载slice InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 @@ -146,7 +168,7 @@ void NativeLauncher::InitNativeLauncher() { CallerLogModel::GetInstance()->InitPhoneService(); PlayersModel::GetInstance()->AudioInit(); ActivityModel::GetInstance()->Init(); - ScreenModels::GetInstance()->InitCardConfig(); + ScreenModels::GetInstance()->InitKvStorage(); VocassistModel::GetInstance()->Init(); HeartModel::GetInstance()->Init(); BluetoothModel::GetInstance()->Init(); @@ -375,4 +397,49 @@ void NativeLauncher::InitUISampleSlice(void) } NativeAbility::GetInstance().AddSliceProxy(VIEW_UISAMPLE, uisampleView); } + +void NativeLauncher::InitSetDesktopSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSetDesktopSlice"); + SliceProxy *setDesktopView = new AbilitySliceProxy; + if (setDesktopView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "setDesktopView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SET_DESKTOP, setDesktopView); +} + +void NativeLauncher::InitSetCardSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSetCardSlice"); + SliceProxy *setCardView = new AbilitySliceProxy; + if (setCardView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "setCardView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SET_CARD, setCardView); +} + +void NativeLauncher::InitAddCardSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitAddCardSlice"); + SliceProxy *addCardView = new AbilitySliceProxy; + if (addCardView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "addCardView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_ADD_CARD, addCardView); +} + +void NativeLauncher::InitSetDialSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSetDialSlice"); + SliceProxy *setDialView = new AbilitySliceProxy; + if (setDialView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "setCardView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SET_DIAL, setDialView); +} + } diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp index f180f6eed..4f492bb85 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp @@ -19,9 +19,9 @@ #include "wearable_log.h" namespace OHOS { -MainView::MainView(){} +MainView::MainView() {} -MainView::~MainView(){} +MainView::~MainView() {} void MainView::OnStart() { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityModel.h b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityModel.h index 7bf138e32..7c694f9f8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityModel.h @@ -10,8 +10,8 @@ #define NUM_7 7 -#include -#include "stdio.h" +#include +#include #include "ohos_types.h" #include "RtcService.h" #include "samgr_lite.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityPresenter.h index a65060de4..1842d3ba7 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityPresenter.h @@ -9,7 +9,7 @@ #define ACTIVITY_PRESENTER_H #include -#include +#include #include "BaseView.h" #include "Presenter.h" #include "MainActivityView.h" @@ -27,7 +27,7 @@ public: void OnResume() override; void OnStop() override; static ActivityPresenter *GetInstance(); - virtual bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnDrag(UIView& view, const DragEvent& event) override; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityWeekView.h b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityWeekView.h index 5ecbb1b5f..5377a9012 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityWeekView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/include/ActivityWeekView.h @@ -26,7 +26,7 @@ namespace OHOS { class ActivityWeekView : public UICardPage { public: ActivityWeekView(); - virtual ~ActivityWeekView(); + ~ActivityWeekView() override; static ActivityWeekView *GetInstance(void); int GetDigits(int stepValue); void InitSteps(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp index fa6e6ed00..61cc52b76 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityModel.cpp @@ -21,8 +21,6 @@ #include "ActivityWeekView.h" #include "graphic_service.h" -using namespace std; - #ifdef __cplusplus extern "C" { #endif @@ -32,22 +30,22 @@ using namespace OHOS; static void Notify(void *args, const Topic topic, Request* request); Subscriber subscirber = { - .identity = NULL, - .args = NULL, + .identity = nullptr, + .args = nullptr, .Notify = Notify, }; void StepSubscribeTopic(Topic topic) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StepSubscribeTopic, topic=%u", topic); - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StepSubscribeTopic, GetFeatureApi failed"); return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StepSubscribeTopic, QueryInterface failed"); return; } @@ -58,14 +56,14 @@ void StepSubscribeTopic(Topic topic) void StepUnsubscribeTopic(Topic topic) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StepUnsubscribeTopic, topic=%u", topic); - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StepUnsubscribeTopic, GetFeatureApi failed"); return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StepUnsubscribeTopic, QueryInterface failed"); return; } @@ -77,31 +75,32 @@ static void RefreshStepControls(const uint32_t &value, const uint16 &msgId) { MainClockView *mainClockView = OHOS::MainClockView::GetInstance(); if (mainClockView != nullptr) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainClockView::RefreshStep, mainClockView, value)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&MainClockView::RefreshStep, mainClockView, value)); } IndoorWalkPresenter *indoorWalkPresenter = OHOS::IndoorWalkPresenter::GetInstance(); if (indoorWalkPresenter != nullptr) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&IndoorWalkPresenter::ModifiesSteps, - indoorWalkPresenter, value)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&IndoorWalkPresenter::ModifiesSteps, indoorWalkPresenter, value)); } ActivityWeekView *activityWeekView = OHOS::ActivityWeekView::GetInstance(); if (activityWeekView == nullptr) { return; } - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&ActivityWeekView::RefreshSteps, - activityWeekView, value)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&ActivityWeekView::RefreshSteps, activityWeekView, value)); if (msgId == TOPIC_EVENT_STEPDATA_UPDATE) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&ActivityWeekView::RefreshTodayView, - activityWeekView, value)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&ActivityWeekView::RefreshTodayView, activityWeekView, value)); } else if (msgId == TOPIC_EVENT_NEXTDAY_UPDATE) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&ActivityWeekView::InitAvgStep, - activityWeekView)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&ActivityWeekView::InitAvgStep, activityWeekView)); if (OHOS::ActivityModel::GetInstance()->GetWeekToday() == MONDAY_STEP_COUNTER) { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&ActivityWeekView::InitWeekView, - activityWeekView)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&ActivityWeekView::InitWeekView, activityWeekView)); } } } @@ -110,12 +109,12 @@ static void Notify(void *args, const Topic topic, Request* request) { UNUSED(args); UNUSED(topic); - if (request == NULL) { + if (request == nullptr) { return; } if (request->msgId == TOPIC_EVENT_STEPDATA_UPDATE) { - if (request->data == NULL) { + if (request->data == nullptr) { return; } // 计步数据累加 @@ -123,8 +122,8 @@ static void Notify(void *args, const Topic topic, Request* request) counter += *(uint32_t *)request->data; OHOS::ActivityModel::GetInstance()->ReviseStepCounter(counter); - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&ActivityModel::SetStepData, - ActivityModel::GetInstance(), counter)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&ActivityModel::SetStepData, ActivityModel::GetInstance(), counter)); RefreshStepControls(counter, TOPIC_EVENT_STEPDATA_UPDATE); } @@ -146,7 +145,7 @@ static constexpr const char *STEP_DATA_PATH = "/user/data/step_"; static constexpr uint32_t SECONDS_ONEDAY = 86400; static constexpr uint16_t ONT_MIN_STEP_CONTER = 120; -osTimerId_t g_saveEveryMinHandle = NULL; +osTimerId_t g_saveEveryMinHandle = nullptr; void SaveEveryMinCallback(int data); ActivityModel::ActivityModel() @@ -159,13 +158,13 @@ ActivityModel::~ActivityModel() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ActivityModel::~ActivityModel"); StepUnsubscribeTopic(TOPIC_EVENT_STEPDATA_UPDATE); StepUnsubscribeTopic(TOPIC_EVENT_NEXTDAY_UPDATE); - if (g_saveEveryMinHandle != NULL) { + if (g_saveEveryMinHandle != nullptr) { osStatus_t ret = osTimerDelete(g_saveEveryMinHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "~ActivityModel osTimerDelete failed, ret = %lx!!", ret); return; } - g_saveEveryMinHandle = NULL; + g_saveEveryMinHandle = nullptr; } } @@ -209,8 +208,7 @@ static void SaveEveryMinCallbackProc(int data) uint32 savedValue = ActivityModel::GetInstance()->GetLastSavedValue(); if (savedValue != g_stepData1.weekSteps[today]) { struct tm curTime; - time_t second; - second = time(NULL); + time_t second = time(nullptr); (void)gmtime_r((const time_t *)&second, &curTime); ActivityModel::GetInstance()->SaveStepToFile(&curTime); } @@ -225,11 +223,11 @@ void ActivityModel::SetStepData(uint32_t &value) { g_stepData1.weekSteps[weekToday] = value; // 第一次上报数据后打开定时器 - if (g_saveEveryMinHandle != NULL) { + if (g_saveEveryMinHandle != nullptr) { return; } - g_saveEveryMinHandle = osTimerNew((osTimerFunc_t)SaveEveryMinCallback, osTimerPeriodic, NULL, NULL); - if (g_saveEveryMinHandle == NULL) { + g_saveEveryMinHandle = osTimerNew((osTimerFunc_t)SaveEveryMinCallback, osTimerPeriodic, nullptr, nullptr); + if (g_saveEveryMinHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ActivityModel::SetStepData osTimerNew failed!!"); return; } @@ -237,13 +235,13 @@ void ActivityModel::SetStepData(uint32_t &value) osStatus_t retTimer = osTimerStart(g_saveEveryMinHandle, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ActivityModel::SetStepData osTimerStart failed, ret = %lx!!", retTimer); - if (g_saveEveryMinHandle != NULL) { + if (g_saveEveryMinHandle != nullptr) { retTimer = osTimerDelete(g_saveEveryMinHandle); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ActivityModel::SetStepData osTimerDelete ret = %lx!!", retTimer); return; } - g_saveEveryMinHandle = NULL; + g_saveEveryMinHandle = nullptr; } return; } @@ -272,8 +270,7 @@ uint32_t ActivityModel::ZeroHourStepHandle(void) { g_stepData1.weekSteps[weekToday] = stepCounter; struct tm historyTime; - time_t second; - second = time(NULL) - SECONDS_ONEDAY; + time_t second = time(nullptr) - SECONDS_ONEDAY; (void)gmtime_r((const time_t *)&second, &historyTime); SaveStepToFile(&historyTime); stepCounter = 0; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityWeekView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityWeekView.cpp index 3eb986e41..3e880d409 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityWeekView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/activity/src/ActivityWeekView.cpp @@ -69,7 +69,7 @@ ActivityWeekView::ActivityWeekView() ActivityWeekView::~ActivityWeekView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ActivityWeekView::~ActivityWeekView"); - if (viewiInitStatus == true) { + if (viewiInitStatus) { RemoveAll(); for (int i = 0; i < DAYS; i++) { delete view[i]; @@ -110,27 +110,27 @@ ActivityWeekView *ActivityWeekView::GetInstance(void) UIView *ActivityWeekView::CreateUIView(int16_t x, int16_t y) { - UIView *view = new UIView(); - if (view == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ActivityWeekView::InitView view is nullptr"); + UIView *uiView = new UIView(); + if (uiView == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ActivityWeekView::InitView uiView is nullptr"); return nullptr; } - view->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x00, 165, 230).full); - view->SetStyle(STYLE_BACKGROUND_OPA, 127); // 127 : background opacity - view->SetStyle(STYLE_BORDER_COLOR, Color::Gray().full); - view->SetStyle(STYLE_BORDER_OPA, 127); // 127 : border opacity - view->SetStyle(STYLE_BORDER_WIDTH, 0); // 0 : border width - view->SetStyle(STYLE_PADDING_LEFT, 0); - view->SetStyle(STYLE_PADDING_RIGHT, 0); - view->SetStyle(STYLE_PADDING_TOP, 0); - view->SetStyle(STYLE_PADDING_BOTTOM, 0); - view->SetStyle(STYLE_MARGIN_LEFT, 0); - view->SetStyle(STYLE_MARGIN_RIGHT, 0); - view->SetStyle(STYLE_MARGIN_TOP, 0); - view->SetStyle(STYLE_MARGIN_BOTTOM, 0); - view->SetPosition(x, y); - view->SetStyle(STYLE_BORDER_RADIUS, UIVIEW_WIDTH / 2 + 10); // 2 : half width 10 : offset - return view; + uiView->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x00, 165, 230).full); + uiView->SetStyle(STYLE_BACKGROUND_OPA, 127); // 127 : background opacity + uiView->SetStyle(STYLE_BORDER_COLOR, Color::Gray().full); + uiView->SetStyle(STYLE_BORDER_OPA, 127); // 127 : border opacity + uiView->SetStyle(STYLE_BORDER_WIDTH, 0); // 0 : border width + uiView->SetStyle(STYLE_PADDING_LEFT, 0); + uiView->SetStyle(STYLE_PADDING_RIGHT, 0); + uiView->SetStyle(STYLE_PADDING_TOP, 0); + uiView->SetStyle(STYLE_PADDING_BOTTOM, 0); + uiView->SetStyle(STYLE_MARGIN_LEFT, 0); + uiView->SetStyle(STYLE_MARGIN_RIGHT, 0); + uiView->SetStyle(STYLE_MARGIN_TOP, 0); + uiView->SetStyle(STYLE_MARGIN_BOTTOM, 0); + uiView->SetPosition(x, y); + uiView->SetStyle(STYLE_BORDER_RADIUS, UIVIEW_WIDTH / 2 + 10); // 2 : half width 10 : offset + return uiView; } void ActivityWeekView::InitSteps() diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardAdapter.h new file mode 100644 index 000000000..8f18d42be --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardAdapter.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardAdapter.h + * Author: + * Create: 2021-09-18 + */ + +#ifndef ADD_CARD_ADAPTER_H +#define ADD_CARD_ADAPTER_H + +#include +#include +#include "components/ui_list.h" +#include "components/ui_label.h" +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/abstract_adapter.h" +#include "UiConfig.h" +#include "wearable_log.h" +#include "AddCardItem.h" + +namespace OHOS { +class AddCardAdapter : public AbstractAdapter { +public: + explicit AddCardAdapter(); + ~AddCardAdapter() override; + + uint16 GetCount(void) override; + + UIView *GetView(UIView *inView, int16 index) override; + + void AddListItem(const AddCardInfo &item); + + void SetItemClickListener(UIView::OnClickListener *itemClickListener) + { + itemClickListener_ = itemClickListener; + } + + void ClearItem(void); + +private: + std::list listData_; + UIView::OnClickListener *itemClickListener_; +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardItem.h b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardItem.h new file mode 100644 index 000000000..5325f4e22 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardItem.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardItem.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef ADD_CARD_ITEM_H +#define ADD_CARD_ITEM_H + +#include +#include +#include "components/ui_view.h" +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/ui_label_button.h" +#include "UiConfig.h" + +namespace OHOS { +typedef struct { + CardId id; + bool addFlag; + const char *cardImg; +} AddCardInfo; + +class AddCardItem : public UIViewGroup { +public: + AddCardItem(); + ~AddCardItem() override; + void SetItemInfo(const AddCardInfo &cardInfo); + void SetOnClickListener(OnClickListener *onClickListener); + void UpdateItemInfo(bool addFlag); +private: + void SetUpChild(); + UIImageView cardImg_; + UILabelButton cardLabel_; + AddCardInfo cardInfo_; +}; + +} + +#endif // ADD_CARD_ITEM_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardModel.h b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardModel.h new file mode 100644 index 000000000..9bdf0e41d --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardModel.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardModel.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef ADD_CARD_MODEL_H +#define ADD_CARD_MODEL_H + +#include +#include +#include "AppViewIDs.h" +#include "UiConfig.h" +#include "AddCardPresenter.h" +#include "MainModel.h" + +namespace OHOS { + class AddCardModel { + public: + static AddCardModel &GetInstance(void); + void SetSelectedCardIndex(uint8_t cardIndex); + uint8_t GetSelectedCardIndex(void) const; + void AddCardSetting(void); + private: + AddCardModel(); + AddCardModel(const AddCardModel &); + AddCardModel &operator=(const AddCardModel &); + virtual ~AddCardModel(); + uint8_t selectedCardIndex{0}; + }; +} + +#endif // ADD_CARD_MODEL_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardPresenter.h new file mode 100644 index 000000000..ffaebdf7c --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardPresenter.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardPresenter.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef ADD_CARD_PRESENTER_H +#define ADD_CARD_PRESENTER_H + +#include "Presenter.h" +#include "components/ui_list.h" +#include "components/ui_view.h" +#include "KeyInputListener.h" +#include "ModelListenerSample.h" + +#define TOAST_KEEP_TIME 1000 + +namespace OHOS { +static const char *ADD_CARD_ADD = "addcardadd"; + +class AddCardView; +class AddCardModel; +class AddCardPresenter : public Presenter, public ModelListenerSample, + public UIView::OnClickListener, public UIView::OnDragListener, + public ListScrollListener { +public: + AddCardPresenter(); + ~AddCardPresenter() override; + + void OnStart() override; + void OnResume() override; + void OnStop() override; + void OnTickEvent() override; + void Notify() override {} + bool OnClick(UIView &view, const ClickEvent &event) override; + void OnScrollStart(int16_t index, UIView *view) override; + void OnScrollEnd(int16_t index, UIView *view) override; + void OnItemSelected(int16_t index, UIView* view) override; + bool OnDrag(UIView& view, const DragEvent& event) override; +private: + void ResetTickTimer(void); + AddCardModel *model{nullptr}; + uint64_t startTime{0}; + bool cardCountEvent{false}; +}; +} + +#endif // ADD_CARD_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardView.h b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardView.h new file mode 100644 index 000000000..6f7e9c34f --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/include/AddCardView.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardView.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef ADD_CARD_VIEW_H +#define ADD_CARD_VIEW_H + +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +#include "window/window.h" +#include "BaseView.h" +#include "ChangeSliceListener.h" +#include "UiConfig.h" +#include "AddCardAdapter.h" +#include "AddCardModel.h" + +namespace OHOS { +class AddCardPresenter; + +class AddCardView : public View { +public: + AddCardView(); + ~AddCardView() override; + + static AddCardView *GetInstance() + { + static AddCardView instance; + return &instance; + } + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + void RefreshCardList(void); + void ExceedsCardCountEvent(bool isVisible); +private: + void SetUpListInfo(void); + void SetUpListView(void); + void SetUpToast(void); + UIList contentList_; + UILabel toastLabel_; + AddCardAdapter *addCardAdapter_{nullptr}; +}; +} +#endif // ADD_CARD_VIEW_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardAdapter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardAdapter.cpp new file mode 100644 index 000000000..d92f38ddb --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardAdapter.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardAdapter.cpp + * Author: + * Create: 2021-09-18 + */ + +#include "AddCardAdapter.h" + +namespace OHOS { +AddCardAdapter::AddCardAdapter() {} + +AddCardAdapter::~AddCardAdapter() +{ + listData_.clear(); +} + +uint16 AddCardAdapter::GetCount(void) +{ + return listData_.size(); +} + +void AddCardAdapter::ClearItem(void) +{ + listData_.clear(); +} + +UIView *AddCardAdapter::GetView(UIView *inView, int16 index) +{ + if (index >= (int16)listData_.size() || index < 0) { + return nullptr; + } + + std::list::iterator it = listData_.begin(); + for (int i = 0; i < index; i++) { + it++; + } + + AddCardItem *item = nullptr; + if (inView == nullptr) { + item = new AddCardItem(); + if (item == nullptr) { + return nullptr; + } + } else { + item = static_cast(inView); + } + + item->SetItemInfo(*it); + item->SetViewIndex(index); + item->SetOnClickListener(itemClickListener_); + return item; +} + +void AddCardAdapter::AddListItem(const AddCardInfo &item) +{ + listData_.push_back(item); +} +} // namespace OHOS diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardItem.cpp b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardItem.cpp new file mode 100644 index 000000000..67e287ec8 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardItem.cpp @@ -0,0 +1,58 @@ +#include "AddCardItem.h" +#include "AddCardPresenter.h" +#include "wearable_log.h" + +namespace OHOS { + AddCardItem::AddCardItem() + { + SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + SetUpChild(); + Add(&cardImg_); + Add(&cardLabel_); + } + + AddCardItem::~AddCardItem() + { + Remove(&cardImg_); + Remove(&cardLabel_); + } + + void AddCardItem::SetUpChild() + { + cardImg_.SetPosition(87, 60); + cardImg_.Resize(280, 280); + cardImg_.SetResizeMode(UIImageView::FILL); + cardImg_.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + + cardLabel_.SetPosition(175, 360); + cardLabel_.Resize(100, 50); + cardLabel_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + } + + void AddCardItem::SetItemInfo(const AddCardInfo &cardInfo) + { + cardInfo_ = cardInfo; + cardImg_.SetSrc(cardInfo.cardImg); + if (cardInfo.addFlag) { + cardLabel_.SetText("已添加"); + } else { + cardLabel_.SetText("添加"); + } + } + + void AddCardItem::UpdateItemInfo(bool addFlag) + { + if (addFlag) { + cardLabel_.SetText("已添加"); + cardInfo_.addFlag = addFlag; + Invalidate(); + } + } + + void AddCardItem::SetOnClickListener(OnClickListener *onClickListener) + { + cardLabel_.SetOnClickListener(onClickListener); + } + +}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardModel.cpp new file mode 100644 index 000000000..fa052decb --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardModel.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardModel.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "AddCardModel.h" +#include "kv_store.h" +#include "securec.h" + +namespace OHOS { + AddCardModel::AddCardModel() {} + + AddCardModel::~AddCardModel() {} + + AddCardModel &AddCardModel::GetInstance() + { + static AddCardModel instance; + return instance; + } + + void AddCardModel::SetSelectedCardIndex(uint8_t cardIndex) + { + selectedCardIndex = cardIndex; + } + + uint8_t AddCardModel::GetSelectedCardIndex(void) const + { + return selectedCardIndex; + } + + void AddCardModel::AddCardSetting(void) + { + MainModel::GetInstance().AddCardSetting(selectedCardIndex); + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp new file mode 100644 index 000000000..158157961 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardPresenter.cpp @@ -0,0 +1,102 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardPresenter.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "AddCardView.h" +#include "AddCardModel.h" +#include "AddCardPresenter.h" + +namespace OHOS { + AddCardPresenter::AddCardPresenter() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::AddCardPresenter"); + model = &AddCardModel::GetInstance(); + } + + AddCardPresenter::~AddCardPresenter() { + } + + void AddCardPresenter::OnStart() + { + Presenter::OnStart(); + } + + void AddCardPresenter::OnResume(void) + { + } + + void AddCardPresenter::OnStop(void) + { + } + + bool AddCardPresenter::OnDrag(UIView& view, const DragEvent& event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnDrag"); + UNUSED(view); + if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && + (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnDrag ChangeSlice"); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + } + return false; + } + + bool AddCardPresenter::OnClick(UIView &view, const ClickEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnClick"); + if (MainModel::GetInstance().GetCardSettingCount() >= CARD_SETTING_COUNT_MAX) { + cardCountEvent = true; + view_->ExceedsCardCountEvent(true); + ResetTickTimer(); + } else { + model->AddCardSetting(); + view_->RefreshCardList(); + } + return true; + } + + void AddCardPresenter::OnScrollStart(int16_t index, UIView *view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnScrollStart index = %d", index); + return; + } + + void AddCardPresenter::OnScrollEnd(int16_t index, UIView *view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnScrollEnd index = %d", index); + if (view == nullptr) { + return; + } + model->SetSelectedCardIndex(index); + } + + void AddCardPresenter::OnItemSelected(int16_t index, UIView* view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardPresenter::OnItemSelected index = %d", index); + if (view == nullptr) { + return; + } + } + + void AddCardPresenter::OnTickEvent() + { + if (cardCountEvent) { + uint64_t current_time = osKernelGetTick2ms(); + if (current_time - startTime > TOAST_KEEP_TIME) { + view_->ExceedsCardCountEvent(false); + cardCountEvent = false; + } + } + return; + } + + void AddCardPresenter::ResetTickTimer(void) + { + startTime = osKernelGetTick2ms(); + return; + } + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardView.cpp new file mode 100644 index 000000000..6e87bde5e --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/add_card/src/AddCardView.cpp @@ -0,0 +1,135 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: AddCardView.cpp + * Author: + * Create: 2021-11-23 + */ + +#include +#include "AddCardView.h" +#include "AddCardPresenter.h" + +namespace OHOS { +AddCardView::AddCardView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::AddCardView"); +} + +AddCardView::~AddCardView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::~AddCardView"); + if (addCardAdapter_ != nullptr) { + delete addCardAdapter_; + addCardAdapter_ = nullptr; + } +} + +void AddCardView::OnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::OnStart"); + View::OnStart(); + SetContainerView(new UIViewGroup()); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + addCardAdapter_ = new AddCardAdapter(); + addCardAdapter_->SetItemClickListener(presenter_); + SetUpListInfo(); + SetUpListView(); + SetUpToast(); +} + +void AddCardView::OnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::OnSetUpView"); + View::OnSetUpView(); +} + +void AddCardView::OnTearDownView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::OnTearDownView"); + View::OnTearDownView(); +} + +void AddCardView::OnStop() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddCardView::OnStop"); + View::OnStop(); + if (container_ != nullptr) { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } +} + +void AddCardView::SetUpListInfo(void) +{ + MainModel::GetInstance().InitCardSettings(); + uint8_t cardCount = MainModel::GetInstance().GetCardSettingCount(); + CardId *cardSettings = MainModel::GetInstance().GetCardSettings(); + addCardAdapter_->ClearItem(); + for (uint8_t i = WATCH_FACE + 1; i < MAX_CARD; i++) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "All:cardId = %d", i); + const CardInfo *info = MainModel::GetInstance().GetCardInfo((CardId)i); + if (info != nullptr) { + AddCardInfo addInfo; + addInfo.id = info->id; + addInfo.cardImg = info->cardImg; + addInfo.addFlag = false; + for (uint8_t j = 0; j < cardCount; j++) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Settings:cardId = %d", cardSettings[j]); + if (cardSettings[j] == i) { + addInfo.addFlag = true; + break; + } + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetUpListInfo::%d %s %d", + addInfo.id, addInfo.cardImg, addInfo.addFlag); + addCardAdapter_->AddListItem(addInfo); + } + } +} + +void AddCardView::SetUpListView(void) +{ + contentList_.SetPosition(0, 0); + contentList_.Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + contentList_.SetScrollBlankSize(VERTICAL_RESOLUTION / 2); + contentList_.SetSelectPosition(VERTICAL_RESOLUTION / 2); + contentList_.SetDraggable(true); + contentList_.SetThrowDrag(true); + contentList_.EnableAutoAlign(true); + contentList_.SetScrollStateListener(presenter_); + contentList_.SetOnDragListener(presenter_); + contentList_.SetMaxScrollDistance(1000); + contentList_.SetAdapter(addCardAdapter_); + contentList_.SetVisible(true); + container_->Add(&contentList_); +} + +void AddCardView::SetUpToast(void) +{ + toastLabel_.SetPosition(77, 220); + toastLabel_.Resize(454, 60); + toastLabel_.SetViewId("toast"); + toastLabel_.SetText("卡片数量已经到达上限"); + toastLabel_.SetStyle(STYLE_BACKGROUND_COLOR, Color::Gray().full); + toastLabel_.SetStyle(STYLE_BACKGROUND_OPA, 255); + toastLabel_.SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + toastLabel_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + toastLabel_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + toastLabel_.SetVisible(false); + container_->Add(&toastLabel_); +} + +void AddCardView::RefreshCardList(void) +{ + SetUpListInfo(); + contentList_.RefreshList(); +} + +void AddCardView::ExceedsCardCountEvent(bool isVisible) +{ + toastLabel_.SetVisible(isVisible); + toastLabel_.Invalidate(); +} + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPopUpPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPopUpPresenter.h index b842fb41b..27e6bc761 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPopUpPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPopUpPresenter.h @@ -54,7 +54,7 @@ class AlarmPopUpPresenter : public Presenter, public UIView::OnC public UIView::OnDragListener, public ModelListenerSample { public: AlarmPopUpPresenter(); - virtual ~AlarmPopUpPresenter(); + ~AlarmPopUpPresenter() override; void OnStart() override; void OnPause() override; void OnResume() override; @@ -63,7 +63,7 @@ public: bool OnClick(UIView &view, const ClickEvent &event) override; bool OnDrag(UIView& view, const DragEvent& event) override; bool OnDragEnd(UIView& view, const DragEvent& event) override; - virtual void Notify() override; + void Notify() override; void CancelAlarmRing(void); void DelayAlarmRing(void); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPresenter.h index 0c92d5ed1..51730af0b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmPresenter.h @@ -92,9 +92,10 @@ typedef enum { CHANGE_INTERFACE_MAXCLOCK, } InterfacesId; -class AlarmStatusBtnChangeListener : public OHOS::UICheckBox::OnChangeListener { +class AlarmStatusBtnChangeListener : public OHOS::UICheckBox::OnChangeListener +{ public: - AlarmStatusBtnChangeListener(UIView *uiView) + explicit AlarmStatusBtnChangeListener(UIView *uiView) { std::string alarmStatusId = uiView->GetViewId(); std::string alarmCmpId; @@ -117,7 +118,7 @@ class AlarmPresenter : public Presenter, public UIView::OnClickLi public UITimePicker::SelectedListener, public UIView::OnDragListener { public: AlarmPresenter(); - virtual ~AlarmPresenter(); + ~AlarmPresenter() override; void OnStart() override; void OnPause() override; void OnResume() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmSetWeekView.h b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmSetWeekView.h index abf2f3745..1e79d4f63 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmSetWeekView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/AlarmSetWeekView.h @@ -34,7 +34,6 @@ private: UIScrollView *group{nullptr}; UILabelButton *weekImage{nullptr}; UILabel *labelRespeat{nullptr}; - UILabelButton *labelButton{nullptr}; UILabelButton *buttonWeek[7]{nullptr}; // 星期一共有7天,因此设置了七个星期的按钮 void CreateWeekButton1(void); void CreateWeekButton2(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/MainAlarmView.h b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/MainAlarmView.h index 0c6731563..9140a477e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/MainAlarmView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/include/MainAlarmView.h @@ -39,7 +39,7 @@ class AlarmPresenter; class MainAlarmView : public View { public: MainAlarmView(); - virtual ~MainAlarmView(); + ~MainAlarmView() override; static MainAlarmView *GetInstance(void); void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp index 3981bf1fb..1941e6096 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmClockModel.cpp @@ -90,8 +90,8 @@ int32_t AlarmClockModel::SaveGlobalAlarmToFile(void) int32_t AlarmClockModel::GetAlarmGlobalData(uint8 id, AlarmClockInfo *info) { int32_t ret; - if (info == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetAlarmGlobalData info NULL!!"); + if (info == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetAlarmGlobalData info nullptr!!"); return -1; } if (g_alarmClockData[id].alarmClockId != id) { @@ -120,11 +120,11 @@ void AlarmClockModel::PushAlarmClockData(AlarmClockQueueMsg alarmClockMsg) int32_t AlarmClockModel::FetchedAlarmClockData(AlarmClockQueueMsg *alarmClockMsg) { - if (alarmClockMsg == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FetchedAlarmClockData alarmClockMsg NULL!!"); + if (alarmClockMsg == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FetchedAlarmClockData alarmClockMsg nullptr!!"); return -1; } - if (listAlarmClock.IsEmpty() == true) { + if (listAlarmClock.IsEmpty()) { return -1; } else { MUTEX_Lock(g_alarmClockDataMutex); @@ -299,17 +299,17 @@ bool AlarmClockModel::GetClockListenerTime(uint32_t &alarmGetTime) return true; } -bool AlarmClockModel::GetListenClockId(uint8_t *alarmId) +bool AlarmClockModel::GetListenClockId(uint8_t *alarm) { - if (alarmId == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::GetClockStatus alarmId == nullptr error!"); + if (alarm == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::GetClockStatus alarm == nullptr error!"); } if (currentAlarm[clockListener] == nullptr) { return false; } else if (currentAlarm[clockListener]->alarmType == TYPE_INVALID_ALARM_CLOCK) { return false; } - *alarmId = currentAlarm[clockListener]->alarmClockId; + *alarm = currentAlarm[clockListener]->alarmClockId; return true; } @@ -434,9 +434,9 @@ bool AlarmClockModel::ButtonStatusRing(int16_t num, bool alarmStatus) return false; } uint8 tempAlarmEnable = currentAlarm[num]->alarmClockEnable; - if (alarmStatus == true) { + if (alarmStatus) { currentAlarm[num]->alarmClockEnable = 1; - } else if (alarmStatus == false) { + } else if (!alarmStatus) { currentAlarm[num]->alarmClockEnable = 0; } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::ButtonStatusRing alarm[%d] status is %u", num, @@ -449,7 +449,7 @@ bool AlarmClockModel::ButtonStatusRing(int16_t num, bool alarmStatus) return true; } -void AlarmClockModel::SetDelayAlarm(uint8_t alarmId) +void AlarmClockModel::SetDelayAlarm(uint8_t alarm) { AlarmClockQueueMsg *clockQueueMsg = new AlarmClockQueueMsg(); if (clockQueueMsg == nullptr) { @@ -460,12 +460,12 @@ void AlarmClockModel::SetDelayAlarm(uint8_t alarmId) clockQueueMsg->eventType = EVENT_ALARM_RING_DELAY; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::ButtonStatusRing clockQueueMsg->eventType is %u", clockQueueMsg->eventType); - (clockQueueMsg->data).value = alarmId; + (clockQueueMsg->data).value = alarm; AlmmgrAlarmClockEventProcess(clockQueueMsg); return; } -void AlarmClockModel::SetCancelAlarm(uint8_t alarmId) +void AlarmClockModel::SetCancelAlarm(uint8_t alarm) { AlarmClockQueueMsg *clockQueueMsg = new AlarmClockQueueMsg(); if (clockQueueMsg == nullptr) { @@ -475,7 +475,7 @@ void AlarmClockModel::SetCancelAlarm(uint8_t alarmId) clockQueueMsg->eventType = EVENT_ALARM_RING_CANCEL; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::ButtonStatusRing clockQueueMsg->eventType is %u", clockQueueMsg->eventType); - (clockQueueMsg->data).value = alarmId; + (clockQueueMsg->data).value = alarm; AlmmgrAlarmClockEventProcess(clockQueueMsg); return; } @@ -620,8 +620,6 @@ void AlarmClockModel::GetPopTimeData(int16 *hour, int16 *min) void AlarmClockModel::AlarmGetClockNum() { struct tm curTime; - int32 hour, min; - if (AlarmGetCurrentTimeInfo(&curTime) != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmTimerCallback AlarmGetCurrentTimeInfo failed!!"); return; @@ -634,8 +632,8 @@ void AlarmClockModel::AlarmGetClockNum() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::AlarmGetClockNum get num(%d)fail!", num); return; } - hour = currentAlarm[num]->alarmTime >> TWO_BYTES_BITS; - min = ((currentAlarm[num]->alarmTime & AND_FOR_LOW_TWO_BYTES) + (currentAlarm[num]->delayNum * DELAY_TEM_MIN)); + int32_t hour = currentAlarm[num]->alarmTime >> TWO_BYTES_BITS; + int32_t min = ((currentAlarm[num]->alarmTime & AND_FOR_LOW_TWO_BYTES) + (currentAlarm[num]->delayNum * DELAY_TEM_MIN)); hour = (hour + min / ONE_HOUR_MIN) % TWENTY_FOUR_HOUR; min = min % ONE_HOUR_MIN; if (curTime.tm_hour == hour && curTime.tm_min == min) { @@ -650,15 +648,14 @@ void AlarmClockModel::AlarmGetClockNum() } } -void AlarmClockModel::GetAlarmCallId(uint8_t *alarmId) +void AlarmClockModel::GetAlarmCallId(uint8_t *alarm) { - if (alarmId == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::alarmId is nullptr!"); + if (alarm == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::alarm is nullptr!"); return; } struct tm curTime; - int32 hour, min; if (AlarmGetCurrentTimeInfo(&curTime) != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmTimerCallback AlarmGetCurrentTimeInfo failed!!"); return; @@ -670,14 +667,14 @@ void AlarmClockModel::GetAlarmCallId(uint8_t *alarmId) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::AlarmGetClockNum get num fail!"); return; } - hour = currentAlarm[num]->alarmTime >> TWO_BYTES_BITS; - min = ((currentAlarm[num]->alarmTime & AND_FOR_LOW_TWO_BYTES) + (currentAlarm[num]->delayNum * DELAY_TEM_MIN)); + int32_t hour = currentAlarm[num]->alarmTime >> TWO_BYTES_BITS; + int32_t min = ((currentAlarm[num]->alarmTime & AND_FOR_LOW_TWO_BYTES) + (currentAlarm[num]->delayNum * DELAY_TEM_MIN)); hour = (hour + min / ONE_HOUR_MIN) % TWENTY_FOUR_HOUR; min = min % ONE_HOUR_MIN; if (curTime.tm_hour == hour && curTime.tm_min == min) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::AlarmGetClockNum %d:%d!", currentAlarm[num]->alarmTime >> TWO_BYTES_BITS, currentAlarm[num]->alarmTime & AND_FOR_LOW_TWO_BYTES); - *alarmId = currentAlarm[num]->alarmClockId; + *alarm = currentAlarm[num]->alarmClockId; return; } } @@ -685,7 +682,7 @@ void AlarmClockModel::GetAlarmCallId(uint8_t *alarmId) void AlarmClockModel::PopInterCancelMusic() { - SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, NULL, 0); + SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, nullptr, 0); GraphicService::GetInstance()->PostGraphicEvent( std::bind(&AlarmClockModel::AlarmPlayerStop, AlarmClockModel::GetInstance())); } @@ -762,7 +759,6 @@ int AlarmClockModel::AlarmPlayerInit(void) std::string strSongName = sliceId; std::string pureName = strSongName.substr(0, strSongName.rfind(".")); // 播放音乐的路径需要引用.号 - const char *songName = pureName.c_str(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayerInit, url:%s ", sliceId); std::string strSrcMusic(APP_MUSIC_PATH); std::string tempStr("/"); @@ -837,14 +833,14 @@ uint16_t AlarmClockModel::JudgePreSlice(void) void AlarmClockModel::DeactAudioInter(void) { bool alarmStatus; - uint8_t alarmId = 0; - alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarmId); - if (alarmStatus == false) { + uint8_t alarm = 0; + alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarm); + if (!alarmStatus) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpPresenter::CancelAlarmRing get alarm Id false!"); return; } AlarmClockModel::GetInstance()->ResetRingClockStatus(); - AlarmClockModel::GetInstance()->SetDelayAlarm(alarmId); + AlarmClockModel::GetInstance()->SetDelayAlarm(alarm); PopInterCancelMusic(); } @@ -870,7 +866,7 @@ void AlarmClockModel::AlarmNextDayNotify() { for (uint8_t num = 0; num < CLOCK_MAX; num++) { if (currentAlarm[num] == nullptr || currentAlarm[num]->alarmType == TYPE_INVALID_ALARM_CLOCK) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::currentAlarm[%u] is NULL"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::currentAlarm[%u] is nullptr"); return; } currentAlarm[num]->delayNum = 0; @@ -883,23 +879,23 @@ void AlarmClockModel::AlarmClockNotify() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::AlarmClockNotify"); - if (PlayersModel::GetInstance()->GetAudioInitStatus() == false) { + if (!PlayersModel::GetInstance()->GetAudioInitStatus()) { PlayersModel::GetInstance()->AudioInit(); } int32_t timeout = -1; SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); AlarmGetClockNum(); - NativeAbility::GetInstance().ChangeSlice(VIEW_ALARM_POP_UP, TRANSITION_INVALID, PRIORITY_TWO); + NativeAbility::GetInstance().ChangeSlice(VIEW_ALARM_POP_UP, TransitionType::TRANSITION_INVALID, PRIORITY_TWO); return; } void AlarmClockModel::PhoneCallAlarm() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::PhoneCallAlarm"); - uint8_t alarmId = 0; + uint8_t alarm = 0; OHOS::AlarmClockModel::GetInstance()->AlarmGetClockNum(); - OHOS::AlarmClockModel::GetInstance()->GetAlarmCallId(&alarmId); - OHOS::AlarmClockModel::GetInstance()->SetDelayAlarm(alarmId); + OHOS::AlarmClockModel::GetInstance()->GetAlarmCallId(&alarm); + OHOS::AlarmClockModel::GetInstance()->SetDelayAlarm(alarm); } uint32 AlarmClockModel::GetAlarmData() @@ -948,7 +944,7 @@ static void Stop(void) bool alarmStatus; AlarmClockModel::GetInstance()->PopInterCancelMusic(); alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarmId); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPlayerListener::CancelAlarmRing get alarm Id false!"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmCloseRingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmCloseRingView.cpp index ccf0f649d..a2ef8afca 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmCloseRingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmCloseRingView.cpp @@ -17,7 +17,7 @@ namespace OHOS { #define CLOSE "关闭" -osTimerId_t g_stopAlarmCloseHandle = NULL; +osTimerId_t g_stopAlarmCloseHandle = nullptr; static AlarmCloseRingView *g_pAlarmCloseRingView = nullptr; constexpr int16_t MAX_SET_ZERO_LEN = 0; constexpr int16_t MAX_SET_SRC_LEN = 90; @@ -99,13 +99,13 @@ UIViewGroup *AlarmCloseRingView::InitCloseRingView(void) void AlarmCloseRingView::CancelCloseHandle(void) { - if (g_stopAlarmCloseHandle != NULL) { + if (g_stopAlarmCloseHandle != nullptr) { osStatus_t ret = osTimerDelete(g_stopAlarmCloseHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CloseTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_stopAlarmCloseHandle = NULL; + g_stopAlarmCloseHandle = nullptr; } } @@ -134,8 +134,8 @@ void CloseTimerCallback(int data) void AlarmCloseRingView::AlarmCloseShowTimer(void) { - g_stopAlarmCloseHandle = osTimerNew((osTimerFunc_t)CloseTimerCallback, osTimerPeriodic, NULL, NULL); - if (g_stopAlarmCloseHandle == NULL) { + g_stopAlarmCloseHandle = osTimerNew((osTimerFunc_t)CloseTimerCallback, osTimerPeriodic, nullptr, nullptr); + if (g_stopAlarmCloseHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmCloseShowTimer osTimerNew failed!!"); return; } @@ -143,13 +143,13 @@ void AlarmCloseRingView::AlarmCloseShowTimer(void) osStatus_t retTimer = osTimerStart(g_stopAlarmCloseHandle, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmCloseShowTimer osTimerStart failed, ret = %lx!!", retTimer); - if (g_stopAlarmCloseHandle != NULL) { + if (g_stopAlarmCloseHandle != nullptr) { retTimer = osTimerDelete(g_stopAlarmCloseHandle); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmCloseShowTimer osTimerDelete failed, ret = %lx!!", retTimer); return; } - g_stopAlarmCloseHandle = NULL; + g_stopAlarmCloseHandle = nullptr; } return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmConfigView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmConfigView.cpp index b5d4e8f99..171caef71 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmConfigView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmConfigView.cpp @@ -112,13 +112,13 @@ AlarmConfigView *AlarmConfigView::GetInstance(void) UILabel *AlarmConfigView::CreateConfigLabel(const char *buttonText, int16_t labelFont, int16_t x, int16_t y, int16_t width) { if (buttonText == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView:: buttonText NULL!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView:: buttonText nullptr!"); return nullptr; } UILabel *label = nullptr; label = new UILabel(); if (label == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView:: CreateConfigLabel return NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView:: CreateConfigLabel return nullptr"); return nullptr; } label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelFont); @@ -175,7 +175,7 @@ void AlarmConfigView::CreateConfigButton(void) configScroll->Add(editLabel); UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance(); if (clickListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView::OnStart clickListener NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmConfigView::OnStart clickListener nullptr"); return; } labelTime = new UIDigitalClock(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmMaxClock.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmMaxClock.cpp index 85028b183..823ff674f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmMaxClock.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmMaxClock.cpp @@ -16,7 +16,7 @@ namespace OHOS { #define MAX_INETERFACES "当前闹钟个数已达上限" #define INTERFACE_ID "maxclock" -osTimerId_t g_stopAlarmMaxHandle = NULL; +osTimerId_t g_stopAlarmMaxHandle = nullptr; static AlarmMaxClock *g_AlarmMaxClock = nullptr; static constexpr uint64_t MS_THREE_SECONDS = 3000; void ScanTimerCallback(int data); @@ -59,7 +59,7 @@ AlarmMaxClock *AlarmMaxClock::GetInstance(void) return g_AlarmMaxClock; } -UIScrollView * AlarmMaxClock::InitAlarmMax(void) +UIScrollView *AlarmMaxClock::InitAlarmMax(void) { container = new UIScrollView(); if (container == nullptr) { @@ -83,7 +83,7 @@ UIScrollView * AlarmMaxClock::InitAlarmMax(void) container->SetDraggable(true); UIView::OnDragListener *maxClockDragListener = (UIView::OnDragListener *)OHOS::AlarmPresenter::GetInstance(); if (maxClockDragListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock:: maxClockDragListener is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock:: maxClockDragListener is nullptr"); return container; } container->SetOnDragListener(maxClockDragListener); @@ -94,13 +94,13 @@ UIScrollView * AlarmMaxClock::InitAlarmMax(void) void CancelScanHandle(void) { - if (g_stopAlarmMaxHandle != NULL) { + if (g_stopAlarmMaxHandle != nullptr) { osStatus_t ret = osTimerDelete(g_stopAlarmMaxHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_stopAlarmMaxHandle = NULL; + g_stopAlarmMaxHandle = nullptr; } } @@ -124,8 +124,8 @@ void ScanTimerCallback(int data) void AlarmMaxClock::AlarmMaxDelayExit(void) { - g_stopAlarmMaxHandle = osTimerNew((osTimerFunc_t)ScanTimerCallback, osTimerPeriodic, NULL, NULL); - if (g_stopAlarmMaxHandle == NULL) { + g_stopAlarmMaxHandle = osTimerNew((osTimerFunc_t)ScanTimerCallback, osTimerPeriodic, nullptr, nullptr); + if (g_stopAlarmMaxHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmMaxDelayExit osTimerNew failed!!"); return; } @@ -133,13 +133,13 @@ void AlarmMaxClock::AlarmMaxDelayExit(void) osStatus_t retTimer = osTimerStart(g_stopAlarmMaxHandle, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmMaxDelayExit osTimerStart failed, ret = %lx!!", retTimer); - if (g_stopAlarmMaxHandle != NULL) { + if (g_stopAlarmMaxHandle != nullptr) { retTimer = osTimerDelete(g_stopAlarmMaxHandle); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmMaxDelayExit osTimerDelete failed, ret = %lx!!", retTimer); return; } - g_stopAlarmMaxHandle = NULL; + g_stopAlarmMaxHandle = nullptr; } return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp index dda985dd1..93a205b55 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp @@ -104,7 +104,7 @@ void AlarmNewTimeView::CreateLabelTime(void) UITimePicker::SelectedListener *selectedListener = (UITimePicker::SelectedListener *)OHOS::AlarmPresenter::GetInstance(); if (selectedListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateLabelTime:: selectedListener is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateLabelTime:: selectedListener is nullptr"); return; } picker->EnableSecond(false); @@ -167,13 +167,13 @@ void AlarmNewTimeView::RefreshNewTime(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmNewTimeView::RefreshStep"); struct tm local_time; - time_t seconds = time(NULL); - - if (localtime_r(&seconds, &local_time) == NULL) { + time_t seconds = time(nullptr); + if (localtime_r(&seconds, &local_time) == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmClockModel::AlarmGetClockNum get localtime error!"); return; } - std::ostringstream ostrHour, ostMin; + std::ostringstream ostrHour; + std::ostringstream ostMin; ostrHour << local_time.tm_hour; ostMin << local_time.tm_min; std::string weekStr = ostrHour.str() + ":" + ostMin.str(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpPresenter.cpp index 04327b6f4..6b1f76ba1 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpPresenter.cpp @@ -56,7 +56,7 @@ void AlarmPopUpPresenter::CancelAlarmRing() bool alarmStatus; AlarmClockModel::GetInstance()->PopInterCancelMusic(); alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarmId); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpPresenter::CancelAlarmRing get alarm Id false!"); return; } @@ -70,7 +70,7 @@ void AlarmPopUpPresenter::DelayAlarmRing() bool alarmStatus; AlarmClockModel::GetInstance()->PopInterCancelMusic(); alarmStatus = AlarmClockModel::GetInstance()->GetListenClockId(&alarmId); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpPresenter::DelayAlarmRing get alarm Id false!"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpView.cpp index 396017984..da6b88b8d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPopUpView.cpp @@ -78,8 +78,7 @@ void AlarmPopUpView::AlarmCreateLabel(void) return; } struct tm local_time; - time_t seconds = time(NULL); - int16 thisHour, thisMin; + time_t seconds = time(nullptr); labelPopup->SetPosition(LABEL_X, LABEL_Y, LABEL_WIDTH, LABEL_HEIGHT); labelPopup->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT); @@ -94,10 +93,13 @@ void AlarmPopUpView::AlarmCreateLabel(void) dClock->SetPosition(CLOCK_X, CLOCK_Y); dClock->Resize(DIGITAL_CLOCK_WIDTH, DIGITAL_CLOCK_HEIGHT); dClock->SetFont(DEFAULT_VECTOR_FONT_FILENAME, CLOCK_FONT); - if (localtime_r(&seconds, &local_time) == NULL) { + if (localtime_r(&seconds, &local_time) == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPopUpView::AlarmCreateLabel get localtime error!"); return; } + + int16_t thisHour; + int16_t thisMin; AlarmClockModel::GetInstance()->GetPopTimeData(&thisHour, &thisMin); dClock->SetDisplayMode(UIDigitalClock::DISPLAY_24_HOUR_NO_SECONDS); dClock->SetTime24Hour(thisHour, thisMin, 0); @@ -243,4 +245,4 @@ void AlarmPopUpView::ChangeView(int16_t hideView, int16_t showView) } } - }// namespace OHOS +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp index 976a2695b..193680182 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp @@ -109,7 +109,7 @@ void AlarmPresenter::ClickSetTime(uint16_t num) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter VIEW_ALARM_SET_TIME"); UNUSED(num); uint32_t clockTime; - if ((AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickSetTime error"); return; } @@ -130,7 +130,7 @@ void AlarmPresenter::ClickSetWeek(uint16_t num) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter VIEW_ALARM_SET_WEEK"); UNUSED(num); uint8_t clockWeek; - if ((AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickSetWeek error"); return; } @@ -184,7 +184,7 @@ void AlarmPresenter::ClickJudgeTrue(uint16_t num) MainAlarmView::GetInstance()->RefreshAlarm(); clockQty--; for (uint16_t alarmNum = 0; alarmNum < clockQty; alarmNum++) { - if ((AlarmClockModel::GetInstance()->GetClockTime(alarmNum, &clockTime)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockTime(alarmNum, &clockTime))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickJudgeTrue error"); return; } @@ -201,7 +201,7 @@ void AlarmPresenter::ClickAlarmTimeOk(uint16_t num) AlarmClockModel::GetInstance()->SetAlarmTime(timeHour, timeMin, alarmListener); uint32_t clockTime = ((timeHour << 16) | timeMin); // 闹钟时间小时的存储位需要右移16位 uint8_t clockWeek; - if ((AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickAlarmTimeOk error"); return; } @@ -232,11 +232,11 @@ void AlarmPresenter::ClickAlarmClock(uint16_t num) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter alarmListener = %u", alarmListener); uint32_t clockTime; uint8_t clockWeek; - if ((AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickAlarmClock error"); return; } - if ((AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockWeek(alarmListener, &clockWeek))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickAlarmClock error"); return; } @@ -263,7 +263,7 @@ void AlarmPresenter::ClickAlarmWeekOk(uint16_t num) if (setListener == SET_TIME_LISTENER) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ClickAlarmWeekOk set time!"); - if ((AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickAlarmWeekOk error"); return; } @@ -285,7 +285,7 @@ void AlarmPresenter::ClickAlarmWeekOk(uint16_t num) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "******************ClickAlarmWeekOk alarmListener = %d***************", alarmListener); AlarmClockModel::GetInstance()->SetSerialAdd(); AlarmClockModel::GetInstance()->SetAlarmInfo(timeHour, timeMin, clockWeek, alarmListener, setListener); - if ((AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime)) == false) { + if (!(AlarmClockModel::GetInstance()->GetClockTime(alarmListener, &clockTime))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter ClickAlarmWeekOk error"); return; } @@ -433,7 +433,7 @@ bool AlarmPresenter::OnClick(UIView &view, const ClickEvent &event) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmPresenter::OnClick "); bool jug = ClickFuncId(view.GetViewId()); - if (jug == false) { + if (!jug) { ClickFuncView(view); } return true; @@ -441,7 +441,7 @@ bool AlarmPresenter::OnClick(UIView &view, const ClickEvent &event) bool AlarmStatusBtnChangeListener::OnChange(UICheckBox::UICheckBoxState state) { - if (MainAlarmView::GetInstance()->GetRefreshStatus() == true) { + if (MainAlarmView::GetInstance()->GetRefreshStatus()) { return true; } switch (state) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmRingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmRingView.cpp index 1c063fbc8..726a58797 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmRingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmRingView.cpp @@ -17,7 +17,7 @@ namespace OHOS { #define RING_AGAIN "响铃将在十分钟后再次响起" -osTimerId_t g_stopAlarmRingHandle = NULL; +osTimerId_t g_stopAlarmRingHandle = nullptr; static AlarmRingView *g_pAlarmRingView = nullptr; constexpr int16_t SET_ZERO = 0; constexpr int16_t SET_SRC = 150; @@ -97,13 +97,13 @@ UIViewGroup *AlarmRingView::InitRingView(void) void AlarmRingView::CancelTimerHandle(void) { - if (g_stopAlarmRingHandle != NULL) { + if (g_stopAlarmRingHandle != nullptr) { osStatus_t ret = osTimerDelete(g_stopAlarmRingHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_stopAlarmRingHandle = NULL; + g_stopAlarmRingHandle = nullptr; } } @@ -123,8 +123,8 @@ void RingTimerCallbacks(int data) void AlarmRingView::AlarmRingDelayShowtimer(void) { - g_stopAlarmRingHandle = osTimerNew((osTimerFunc_t)RingTimerCallbacks, osTimerPeriodic, NULL, NULL); - if (g_stopAlarmRingHandle == NULL) { + g_stopAlarmRingHandle = osTimerNew((osTimerFunc_t)RingTimerCallbacks, osTimerPeriodic, nullptr, nullptr); + if (g_stopAlarmRingHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmRingDelayShowtimer osTimerNew failed!!"); return; } @@ -132,13 +132,13 @@ void AlarmRingView::AlarmRingDelayShowtimer(void) osStatus_t retTimer = osTimerStart(g_stopAlarmRingHandle, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmRingDelayShowtimer osTimerStart failed, ret = %lx!!", retTimer); - if (g_stopAlarmRingHandle != NULL) { + if (g_stopAlarmRingHandle != nullptr) { retTimer = osTimerDelete(g_stopAlarmRingHandle); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmMaxClock::AlarmRingDelayShowtimer osTimerDelete failed, ret = %lx!!", retTimer); return; } - g_stopAlarmRingHandle = NULL; + g_stopAlarmRingHandle = nullptr; } return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp index b462b75c9..6d04e328f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp @@ -132,7 +132,7 @@ UIScrollView *AlarmSetTimeView::InitSetTimeView(void) UITimePicker::SelectedListener *selectedListener = (UITimePicker::SelectedListener *)OHOS::AlarmPresenter::GetInstance(); if (selectedListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView:: selectedListener is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView:: selectedListener is nullptr"); return nullptr; } picker->EnableSecond(false); @@ -152,7 +152,7 @@ UIScrollView *AlarmSetTimeView::InitSetTimeView(void) group->SetDraggable(true); UIView::OnDragListener *setTimeDragListener = (UIView::OnDragListener *)OHOS::AlarmPresenter::GetInstance(); if (setTimeDragListener == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView:: setTimeDragListener is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView:: setTimeDragListener is nullptr"); return group; } group->SetOnDragListener(setTimeDragListener); @@ -172,7 +172,7 @@ void AlarmSetTimeView::RefreshSetTime(uint32_t time) } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView::RefreshStep 35353535!"); picker->SetSelected(pickerTime.c_str()); - if (picker->SetSelected(pickerTime.c_str()) == false) { + if (!picker->SetSelected(pickerTime.c_str())) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView::RefreshStep Timepicker error!"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp index df9e819d2..397430b78 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp @@ -77,8 +77,6 @@ AlarmSetWeekView::~AlarmSetWeekView() group->RemoveAll(); delete labelRespeat; labelRespeat = nullptr; - delete labelButton; - labelButton = nullptr; delete weekImage; weekImage = nullptr; for (int16_t alarmNum = 0; alarmNum < 7; alarmNum++) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp index 45532fe06..f6da8212c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp @@ -164,7 +164,6 @@ void MainAlarmView::NewClockCtl(int16_t alarmNum) statusButton[0]->SetPosition(STATUS_BUTTON_X, alarmPositionY, STATUS_BUTTON_W, STATUS_BUTTON_H); } else { statusButton[alarmNum]->SetPosition(STATUS_BUTTON_X, statusButton[0]->GetY() + (alarmInterval * alarmNum), STATUS_BUTTON_W, STATUS_BUTTON_H); - } statusButton[alarmNum]->SetStyle(STYLE_BACKGROUND_OPA, alarmNum); UICheckBox::OnChangeListener *statusListener{nullptr}; @@ -301,17 +300,17 @@ void MainAlarmView::RefreshAlarm(void) int16_t i; for (i = 0; i < CLOCK_MAX_NUM; i++) { alarmStatus = AlarmClockModel::GetInstance()->GetClockTime(i, &alarmTime); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: GetClockTime fail! i = %d", i); break; } alarmStatus = AlarmClockModel::GetInstance()->GetClockWeek(i, &alarmWeek); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: GetClockWeek fail! i = %d", i); break; } alarmStatus = AlarmClockModel::GetInstance()->GetClockStatus(i, &alarmEnable); - if (alarmStatus == false) { + if (!alarmStatus) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: GetClockStatus fail! i = %d", i); break; } @@ -509,7 +508,7 @@ bool MainAlarmView::ClickFunc(int16_t interface) for (int i = 0; i < funcSize; i++) { if (interface == ViewMapper[i].viewId) { bool jug = (this->*(ViewMapper[i].func))(interface); - if (jug == false) { + if (!jug) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: ChangeInterFace[%d] false", interface); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/include/AlarmClockManage.h b/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/include/AlarmClockManage.h index c2336587f..869857e5e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/include/AlarmClockManage.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/include/AlarmClockManage.h @@ -7,10 +7,10 @@ #ifndef ALARM_CLOCK_MANAGE_H #define ALARM_CLOCK_MANAGE_H -#include -#include -#include -#include +#include +#include +#include +#include #include "ohos_types.h" #include "AlarmClockTimerConfig.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/src/AlarmClockManage.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/src/AlarmClockManage.cpp index 8c99e8e7e..5ce9f8636 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/src/AlarmClockManage.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarmclockmanage/src/AlarmClockManage.cpp @@ -6,11 +6,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include "wearable_log.h" @@ -137,8 +137,8 @@ static int32 CreateListAlarmTodaySmart(void) if (g_alarmClockManagement.smartAlarmCnt > 0) { /* 该闹钟今天是否使能判断 */ - if (IsAlarmClockValidToday(&g_alarmClockManagement.smartAlarmInfo) == true && - g_alarmClockManagement.smartAlarmInfo.alarmClockEnable == true) { + if (IsAlarmClockValidToday(&g_alarmClockManagement.smartAlarmInfo) && + g_alarmClockManagement.smartAlarmInfo.alarmClockEnable) { (void)memset_s(&info, size, 0, size); info.alarmType = g_alarmClockManagement.smartAlarmInfo.alarmType; @@ -168,8 +168,8 @@ static int32 CreateListAlarmTodayEvent(void) for (i = 0; i < EVENT_ALARM_CLOCK_MAX; i++) { /* 该闹钟今天是否使能判断 */ - if (IsAlarmClockValidToday(&g_alarmClockManagement.eventAlarmInfo[i]) == true && - g_alarmClockManagement.eventAlarmInfo[i].alarmClockEnable == true) { + if (IsAlarmClockValidToday(&g_alarmClockManagement.eventAlarmInfo[i]) && + g_alarmClockManagement.eventAlarmInfo[i].alarmClockEnable) { (void)memset_s(&info, size, 0, size); info.alarmType = g_alarmClockManagement.eventAlarmInfo[i].alarmType; @@ -221,8 +221,8 @@ static int32 AlarmInfoCheck(const AlarmClockInfo *alarmInfo) uint16 hour; uint16 min; - if (alarmInfo == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmInfoCheck alarmInfo NULL!!"); + if (alarmInfo == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmInfoCheck alarmInfo nullptr!!"); return STATUS_POINTER_NULL; } @@ -256,7 +256,7 @@ static int32 AddAndUpdataListAlarmToday(const AlarmClockInfo *alarmInfo) return ret; } /* 将指定闹钟信息加入当天闹钟列表 */ - if (IsAlarmClockValidToday(alarmInfo) == false || alarmInfo->alarmClockEnable == false) { + if (!IsAlarmClockValidToday(alarmInfo) || (!alarmInfo->alarmClockEnable)) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AddAndUpdataListAlarmToday alarmInfo invalid today!!"); return STATUS_OK; } @@ -293,7 +293,7 @@ static int32 UpdataListAlarmToday(const AlarmClockInfo *alarmInfo) /* 将指定ID的闹钟信息刷新 */ for (node = g_alarmTodayList.begin(); node != g_alarmTodayList.end(); node++) { if (node->alarmClockId == alarmInfo->alarmClockId) { - if (IsAlarmClockValidToday(alarmInfo) == true && alarmInfo->alarmClockEnable == true) { + if (IsAlarmClockValidToday(alarmInfo) && alarmInfo->alarmClockEnable) { node->alarmTime = alarmInfo->alarmTime + alarmInfo->delayNum * MINS_EVERY_DELAY; node->alarmTime = (((node->alarmTime >> TWO_BYTES_BITS) + (node->alarmTime & AND_FOR_LOW_TWO_BYTES) / MINUTES_PER_HOUR) << TWO_BYTES_BITS) + @@ -367,10 +367,10 @@ static void EventAlarmRingProcess(void) static int32 SetFirstAlarmToday(FirstAlarmTodaySetType type) { - int32 ret; struct tm curTime; FirstAlarmTodaySetType tempType = type; - std::list< AlarmClockInfoToday>::iterator node, tempNode; + std::list< AlarmClockInfoToday>::iterator node; + std::list< AlarmClockInfoToday>::iterator tempNode; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetFirstAlarmToday !!"); if (AlarmGetCurrentTimeInfo(&curTime) != 0) { @@ -498,7 +498,7 @@ void AlmmgrInitManagement(void) void AlmmgrAlarmClockEventProcess(const AlarmClockQueueMsg *alarmClockMsg) { - if (alarmClockMsg == NULL) { + if (alarmClockMsg == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrAlarmClockEventProcess alarmClockMsg is invalid!!"); return; } @@ -683,8 +683,8 @@ int32 AlmmgrGetManagement(AlarmClockManagement *management) int32 ret; uint32 size = sizeof(AlarmClockManagement); - if (management == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrGetManagement management NULL!!"); + if (management == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrGetManagement management nullptr!!"); return STATUS_POINTER_NULL; } @@ -715,8 +715,8 @@ int32 GetEventAlarmInfo(uint8 id, AlarmClockInfo *info) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo id invalid!!"); return STATUS_ALARM_ID_INVALID; } - if (info == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo info NULL!!"); + if (info == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo info nullptr!!"); return STATUS_POINTER_NULL; } @@ -733,8 +733,8 @@ int32 GetSmartAlarmInfo(AlarmClockInfo *info) int32 ret; uint32 size = sizeof(AlarmClockInfo); - if (info == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSmartAlarmInfo info NULL!!"); + if (info == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSmartAlarmInfo info nullptr!!"); return STATUS_POINTER_NULL; } @@ -785,12 +785,12 @@ int32 SetDatetime(int32 argc, char *argv[]) struct tm setTime; struct timeval timeVal; struct timezone timeZone; - char *endPtr = NULL; + char *endPtr = nullptr; int32 trans[DATETIME_PARA_NUM]; /* 0, 5, 8, 11, 14, 17 are offset of year, month, day, hour, minute, second */ uint32 offset[DATETIME_PARA_NUM] = {0, 5, 8, 11, 14, 17}; - if (argc != 1 || argv[0] == NULL) { + if (argc != 1 || argv[0] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "set_datetime para invalid!!"); goto help; } @@ -850,7 +850,7 @@ int32 DispDatetime(void) struct tm curTime; time_t second; - second = time(NULL); + second = time(nullptr); (void)gmtime_r((const time_t *)&second, &curTime); ret = strftime(buff, sizeof(buff), "%A %c", &curTime); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 2e557750c..56ba901ed 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -4,9 +4,9 @@ * Create: 2021-09-22 */ -#include +#include #include -#include +#include #include "wearable_log.h" #include "securec.h" #include "broadcast_service.h" @@ -24,21 +24,21 @@ extern "C" { static AlarmCtrl g_alarmCtrA; static AlarmCtrl g_alarmCtrB; -static osTimerId_t g_AlarmHandle = NULL; +static osTimerId_t g_AlarmHandle = nullptr; void AlarmTimerEventPublish(uint16 topic, AlarmClockEventData data) { int32 ret; uint32 size = sizeof(AlarmClockEventData); - Request *request = NULL; - BroadcastApi *broadcastApi = NULL; - IUnknown *api = NULL; + Request *request = nullptr; + BroadcastApi *broadcastApi = nullptr; + IUnknown *api = nullptr; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmTimerEventPublish topic=%u!!", topic); /* alloc request */ request = SAMGR_AllocRequestMsg(0, PLATFORM_CORE, BROADCAST_SVR_ID, size); - if (request == NULL) { + if (request == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SAMGR_AllocRequestMsg failed"); return; } @@ -53,13 +53,13 @@ void AlarmTimerEventPublish(uint16 topic, AlarmClockEventData data) /* public request */ api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetFeatureApi failed"); SAMGR_FreeRequestMsg(request); return; } ret = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (ret != 0 || broadcastApi == NULL) { + if (ret != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "QueryInterface failed"); SAMGR_FreeRequestMsg(request); return; @@ -97,7 +97,7 @@ void AlarmScan(void *arg) } if (g_alarmCtrA.state == ALARM_STATUS_RUNNING) { - if ((g_alarmCtrA.callback != NULL) && + if ((g_alarmCtrA.callback != nullptr) && (g_alarmCtrA.info.hour == curTime.tm_hour) && (g_alarmCtrA.info.minute == curTime.tm_min)) { g_alarmCtrA.callback(); @@ -106,7 +106,7 @@ void AlarmScan(void *arg) } if (g_alarmCtrB.state == ALARM_STATUS_RUNNING) { - if ((g_alarmCtrB.callback != NULL) && + if ((g_alarmCtrB.callback != nullptr) && (g_alarmCtrB.info.week == curTime.tm_wday) && (g_alarmCtrB.info.hour == curTime.tm_hour) && (g_alarmCtrB.info.minute == curTime.tm_min)) { @@ -118,7 +118,7 @@ void AlarmScan(void *arg) static int32_t AlarmCreate(AlarmCtrl *alarmCtrl, AlarmCallBack callback) { - if (alarmCtrl == NULL) { + if (alarmCtrl == nullptr) { return ERRCODE_FAIL; } if (alarmCtrl->state == ALARM_STATUS_UNUSED) { @@ -135,8 +135,8 @@ int32_t AlarmTimerInit(void) g_alarmCtrA.state = ALARM_STATUS_UNUSED; g_alarmCtrB.state = ALARM_STATUS_UNUSED; - g_AlarmHandle = osTimerNew(AlarmScan, osTimerPeriodic, NULL, NULL); - if (g_AlarmHandle == NULL) { + g_AlarmHandle = osTimerNew(AlarmScan, osTimerPeriodic, nullptr, nullptr); + if (g_AlarmHandle == nullptr) { return ERRCODE_FAIL; } timerStatus = osTimerStart(g_AlarmHandle, ALARM_INTERVAL_MS); @@ -185,10 +185,10 @@ int32_t SetZeroAlarm(void) int32_t AlarmGetCurrentTimeInfo(struct tm *timeInfo) { - if (timeInfo == NULL) { + if (timeInfo == nullptr) { return ERRCODE_FAIL; } - time_t sec = time(NULL); + time_t sec = time(nullptr); localtime_r(&sec, timeInfo); return ERRCODE_SUCC; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBarCode.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBarCode.h index 67cacbbec..12426d62e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBarCode.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBarCode.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayBarCode : public UIViewGroup { public: - AlipayBarCode(AlipayPresenter *presenter); - virtual ~AlipayBarCode(); + explicit AlipayBarCode(AlipayPresenter *presenter); + ~AlipayBarCode() override; static AlipayBarCode *GetInstance(); bool InitView(); void AlipayRefreshBarcode(const char *refreshStr); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBind.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBind.h index 9adcaeecc..bfe2153e8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBind.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBind.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayBind : public UIViewGroup { public: - AlipayBind(AlipayPresenter *presenter); - virtual ~AlipayBind(); + explicit AlipayBind(AlipayPresenter *presenter); + ~AlipayBind() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindAni.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindAni.h index 959709d4a..ea2cc5820 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindAni.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindAni.h @@ -19,8 +19,8 @@ namespace OHOS { class AlipayBindAni : public UIViewGroup { public: - AlipayBindAni(AlipayPresenter *presenter); - virtual ~AlipayBindAni(); + explicit AlipayBindAni(AlipayPresenter *presenter); + ~AlipayBindAni() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindRes.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindRes.h index 9d4585959..5b7f9a6a0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindRes.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayBindRes.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayBindRes : public UIViewGroup { public: - AlipayBindRes(AlipayPresenter *presenter); - virtual ~AlipayBindRes(); + explicit AlipayBindRes(AlipayPresenter *presenter); + ~AlipayBindRes() override; bool InitView(); void AlipayRefreshBindRes(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayExitBind.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayExitBind.h index 48233ff7f..4b9321a60 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayExitBind.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayExitBind.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayExitBind : public UIViewGroup { public: - AlipayExitBind(AlipayPresenter *presenter); - virtual ~AlipayExitBind(); + explicit AlipayExitBind(AlipayPresenter *presenter); + ~AlipayExitBind() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayHelp.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayHelp.h index a1802fdfe..350da2143 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayHelp.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayHelp.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayHelp : public UIViewGroup { public: - AlipayHelp(AlipayPresenter *presenter); - virtual ~AlipayHelp(); + explicit AlipayHelp(AlipayPresenter *presenter); + ~AlipayHelp() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListAdapter.h index 8a6235055..c28ddc4be 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListAdapter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListAdapter.h @@ -23,7 +23,7 @@ namespace OHOS { class AlipayListAdapter : public AbstractAdapter { public: explicit AlipayListAdapter(); - virtual ~AlipayListAdapter(); + ~AlipayListAdapter() override; /* * * @brief Sets the UIView adapter data, which is a AlipayListItem linked list. @@ -41,11 +41,11 @@ public: * @since 1.0 * @version 1.0 */ - virtual uint16_t GetCount(void) override; + uint16_t GetCount(void) override; - virtual UIView *GetView(UIView *inView, int16_t index) override; + UIView *GetView(UIView *inView, int16_t index) override; - virtual void AddListItem(const AlipayListItem &item); + void AddListItem(const AlipayListItem &item); void SetItemClickListener(UIView::OnClickListener *itemclicklistener) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListItemView.h index 8e6675245..74262222f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListItemView.h @@ -20,13 +20,11 @@ namespace OHOS { class AlipayListItemView : public UIViewGroup { public: explicit AlipayListItemView(); - virtual ~AlipayListItemView(); - virtual void SetItemInfo(const AlipayListItem &itemInfo); - virtual void SetUpChild(); + ~AlipayListItemView() override; + void SetItemInfo(const AlipayListItem &itemInfo); + void SetUpChild(); private: - AlipayListItemView(const AlipayListItemView &); - UIImageView sIcon; UILabel sLabel; UIImageView sNextImage; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h index 91d856c74..ef9dd02bf 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h @@ -26,8 +26,8 @@ namespace OHOS { class AlipayListAdapter; class AlipayList : public UIViewGroup { public: - AlipayList(AlipayPresenter *presenter); - virtual ~AlipayList(); + explicit AlipayList(AlipayPresenter *presenter); + ~AlipayList() override; bool InitListView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayMainView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayMainView.h index 6d68a39c9..f88514a8c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayMainView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayMainView.h @@ -41,7 +41,7 @@ class AlipayMainView; class AlipayMainView : public View { public: AlipayMainView(); - virtual ~AlipayMainView(); + ~AlipayMainView() override; static AlipayMainView *GetInstance(void); void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h index a0cf81329..4f0d4bb69 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h @@ -89,9 +89,9 @@ public: uint32_t AlipayGetTransCodeLen(void); char* AlipayGetCardTitle(void); private: - osTimerId_t bindTimerId = NULL; - osTimerId_t switchTimerId = NULL; - osTimerId_t transTimerId = NULL; + osTimerId_t bindTimerId = nullptr; + osTimerId_t switchTimerId = nullptr; + osTimerId_t transTimerId = nullptr; int16 alipayInterLis; const alipay_svr_api_t *alipayApi; bool bindFlag_; @@ -99,8 +99,8 @@ private: uint32_t refreshFlag_ = 0; uint32_t cardNum_ = 0; uint32_t cardSum_ = 0; - mc_alipay_trans_card_info_t *cardInfo_ = NULL; - uint8_t* transCode_ = NULL; + mc_alipay_trans_card_info_t *cardInfo_ = nullptr; + uint8_t* transCode_ = nullptr; uint32_t transCodeLen_; char cardTitle_[ALIPAY_TRANS_CARD_MEMBER_LEN]; }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPayCode.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPayCode.h index 55b2ffbe6..6ef24cb3a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPayCode.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPayCode.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayPayCode : public UIViewGroup { public: - AlipayPayCode(AlipayPresenter *presenter); - virtual ~AlipayPayCode(); + explicit AlipayPayCode(AlipayPresenter *presenter); + ~AlipayPayCode() override; static AlipayPayCode *GetInstance(); bool InitView(); void AlipayRefreshQrcode(const char *refreshStr); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPresenter.h index 7037034fc..7a4fc62da 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayPresenter.h @@ -105,7 +105,7 @@ class AlipayPresenter : public Presenter, public UIView::OnDragListener { public: AlipayPresenter(); - virtual ~AlipayPresenter(); + ~AlipayPresenter() override; void OnStart() override; void OnPause() override; void OnResume() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayRefreshBindCode.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayRefreshBindCode.h index 800000b65..fe03e3035 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayRefreshBindCode.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayRefreshBindCode.h @@ -18,7 +18,7 @@ namespace OHOS { class AlipayRefreshBind : public UIViewGroup { public: AlipayRefreshBind(); - virtual ~AlipayRefreshBind(); + ~AlipayRefreshBind() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipaySetting.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipaySetting.h index 3f652125c..deb5a2da5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipaySetting.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipaySetting.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipaySetting : public UIViewGroup { public: - AlipaySetting(AlipayPresenter *presenter); - virtual ~AlipaySetting(); + explicit AlipaySetting(AlipayPresenter *presenter); + ~AlipaySetting() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayGetTransList.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayGetTransList.h index 6a7c2359d..a5c671432 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayGetTransList.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayGetTransList.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayGetTransList : public UIViewGroup { public: - AlipayGetTransList(AlipayPresenter *presenter); - virtual ~AlipayGetTransList(); + explicit AlipayGetTransList(AlipayPresenter *presenter); + ~AlipayGetTransList() override; bool InitGetView(uint32_t index); private: AlipayPresenter *presenter_; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransAni.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransAni.h index 14f2a367a..fc577b8b8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransAni.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransAni.h @@ -19,8 +19,8 @@ namespace OHOS { class AlipayTransAni : public UIViewGroup { public: - AlipayTransAni(AlipayPresenter *presenter); - virtual ~AlipayTransAni(); + explicit AlipayTransAni(AlipayPresenter *presenter); + ~AlipayTransAni() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransCode.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransCode.h index 884ef277b..d4ba75077 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransCode.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransCode.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayTransCode : public UIViewGroup { public: - AlipayTransCode(AlipayPresenter *presenter); - virtual ~AlipayTransCode(); + explicit AlipayTransCode(AlipayPresenter *presenter); + ~AlipayTransCode() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransEnable.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransEnable.h index 432a9c993..e2af18b71 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransEnable.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransEnable.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayTransEnable : public UIViewGroup { public: - AlipayTransEnable(AlipayPresenter *presenter); - virtual ~AlipayTransEnable(); + explicit AlipayTransEnable(AlipayPresenter *presenter); + ~AlipayTransEnable() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListAdapter.h index 0b24a7eda..233193063 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListAdapter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListAdapter.h @@ -23,7 +23,7 @@ namespace OHOS { class AlipayTransListAdapter : public AbstractAdapter { public: explicit AlipayTransListAdapter(); - virtual ~AlipayTransListAdapter(); + ~AlipayTransListAdapter() override; /* * * @brief Sets the UIView adapter data, which is a AlipayTransListItem linked list. @@ -41,11 +41,11 @@ public: * @since 1.0 * @version 1.0 */ - virtual uint16_t GetCount(void) override; + uint16_t GetCount(void) override; - virtual UIView *GetView(UIView *inView, int16_t index) override; + UIView *GetView(UIView *inView, int16_t index) override; - virtual void AddListItem(const AlipayTransListItem &item); + void AddListItem(const AlipayTransListItem &item); void SetItemClickListener(UIView::OnClickListener *itemclicklistener) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListItemView.h index 1967fa9f8..6a12a6a42 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListItemView.h @@ -20,14 +20,12 @@ namespace OHOS { class AlipayTransListItemView : public UIViewGroup { public: explicit AlipayTransListItemView(); - virtual ~AlipayTransListItemView(); - virtual void SetItemInfo(const AlipayTransListItem &itemInfo); - virtual void SetUpChild(); + ~AlipayTransListItemView() override; + void SetItemInfo(const AlipayTransListItem &itemInfo); + void SetUpChild(); uint8_t GetAlipayTransListIndex(); private: - AlipayTransListItemView(const AlipayTransListItemView &); - UILabel sLabel; UIImageView sNextImage; AlipayTransListItem sItemInfo; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h index b38739a42..23cb4fe94 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h @@ -31,8 +31,8 @@ static const uint8_t ALIPAY_TRANS_LIST_ITEM_LEN = 20; class AlipayTransListAdapter; class AlipayTransList : public UIViewGroup { public: - AlipayTransList(AlipayPresenter *presenter); - virtual ~AlipayTransList(); + explicit AlipayTransList(AlipayPresenter *presenter); + ~AlipayTransList() override; bool InitListView(); void AlipayTransListUpdate(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransRes.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransRes.h index e42fd3a79..57a93a147 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransRes.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransRes.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayTransRes : public UIViewGroup { public: - AlipayTransRes(AlipayPresenter *presenter); - virtual ~AlipayTransRes(); + explicit AlipayTransRes(AlipayPresenter *presenter); + ~AlipayTransRes() override; bool InitResView(uint32_t index); void AlipayTransRefreshRes(void); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransTips.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransTips.h index f6ef45fdf..0254ab881 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransTips.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransTips.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayTransTips : public UIViewGroup { public: - AlipayTransTips(AlipayPresenter *presenter); - virtual ~AlipayTransTips(); + explicit AlipayTransTips(AlipayPresenter *presenter); + ~AlipayTransTips() override; bool InitTipsView(uint32_t index); void AlipayTransRefreshTips(void); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbind.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbind.h index 434f151ac..183b8066e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbind.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbind.h @@ -16,8 +16,8 @@ namespace OHOS { class AlipayUnbind : public UIViewGroup { public: - AlipayUnbind(AlipayPresenter *presenter); - virtual ~AlipayUnbind(); + explicit AlipayUnbind(AlipayPresenter *presenter); + ~AlipayUnbind() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbindFinish.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbindFinish.h index 8ac78d6d8..9221d783f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbindFinish.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayUnbindFinish.h @@ -17,8 +17,8 @@ namespace OHOS { class AlipayUnbindFinish : public UIViewGroup { public: - AlipayUnbindFinish(AlipayPresenter *presenter); - virtual ~AlipayUnbindFinish(); + explicit AlipayUnbindFinish(AlipayPresenter *presenter); + ~AlipayUnbindFinish() override; bool InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBarCode.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBarCode.cpp index c5740edde..5e8723d58 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBarCode.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBarCode.cpp @@ -231,21 +231,21 @@ bool AlipayBarCode::InitView() SetStyle(STYLE_BACKGROUND_COLOR, 0xff1677ff); SetStyle(STYLE_BACKGROUND_OPA, 0xff); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBarCode::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBarCode::InitView AlipayInitButton() false"); return false; } - if (AlipayInitBarcode() == false) { + if (!AlipayInitBarcode()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBarCode::InitView AlipayInitQrcode() false"); return false; } - if (AlipayInitImage() == false) { + if (!AlipayInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBarCode::InitView AlipayInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBind.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBind.cpp index 6b1e55848..780949585 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBind.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBind.cpp @@ -101,12 +101,12 @@ bool AlipayBind::InitView() SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBind::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImage() == false) { + if (!AlipayInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBind::InitView AlipayInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindAni.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindAni.cpp index c3f7390e2..4574cb9f5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindAni.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindAni.cpp @@ -116,11 +116,11 @@ bool AlipayBindAni::InitView() SetTouchable(true); SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBindAni::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImageAni() == false) { + if (!AlipayInitImageAni()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBindAni::InitView AlipayInitImageAni() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindRes.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindRes.cpp index 9a6bd4c0c..0a331982b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindRes.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayBindRes.cpp @@ -118,11 +118,11 @@ bool AlipayBindRes::InitView() SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); const char *resStr = EXIT_LABEL_TEXT_SEC; - if (AlipayInitLabel(resStr) == false) { + if (!AlipayInitLabel(resStr)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBindRes::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImage(PNG_ALIPAY_BIND_SUCCESS) == false) { + if (!AlipayInitImage(PNG_ALIPAY_BIND_SUCCESS)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayBindRes::InitView AlipayInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayExitBind.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayExitBind.cpp index 08944b8d7..edf88e323 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayExitBind.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayExitBind.cpp @@ -131,14 +131,14 @@ bool AlipayExitBind::InitSimilarButton(int16 num, int16 alipayX, int16 alipayY, bool AlipayExitBind::AlipayInitButton() { - if (InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, EXIT_BUTTON_TEXT_FIRST, - ALIPAY_INTER_EXIT) == false) { + if (!InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, EXIT_BUTTON_TEXT_FIRST, + ALIPAY_INTER_EXIT)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayExitBind::AlipayInitButton new alipayButton[ALIPAY_SET_ZERO] fail"); return false; } - if (InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, EXIT_BUTTON_TEXT_SECOND, - ALIPAY_BIND_CONTINUE) == false) { + if (!InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, EXIT_BUTTON_TEXT_SECOND, + ALIPAY_BIND_CONTINUE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayExitBind::AlipayInitButton new alipayButton[ALIPAY_SET_ONE] fail"); return false; @@ -154,11 +154,11 @@ bool AlipayExitBind::InitView() SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayExitBind::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayExitBind::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayHelp.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayHelp.cpp index 9f29dedf8..a772a5c10 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayHelp.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayHelp.cpp @@ -101,12 +101,12 @@ bool AlipayHelp::InitView() SetStyle(STYLE_BACKGROUND_COLOR, 0xff1677ff); SetStyle(STYLE_BACKGROUND_OPA, 0xff); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayHelp::InitView AlipayInitImage() false"); return false; } - if (AlipayInitImage() == false) { + if (!AlipayInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayHelp::InitView AlipayInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayList/AlipayListView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayList/AlipayListView.cpp index 3c44c3a59..e96e47030 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayList/AlipayListView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayList/AlipayListView.cpp @@ -86,7 +86,7 @@ bool AlipayList::InitListView() SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); SetStyle(STYLE_BACKGROUND_OPA, UN_OPACITY); - if (AlipayInitList() == false) { + if (!AlipayInitList()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayList::InitView AlipayInitList() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayMainView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayMainView.cpp index 10bad7db9..888dff2ae 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayMainView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayMainView.cpp @@ -78,8 +78,11 @@ void AlipayMainView::OnStart() group = container[startView]; alipayWhichInter = startView; - RootView::GetInstance()->Add(container[startView]); - + if (group == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::OnSetUpView group null error!"); + return; + } + container_ = group; return; } @@ -87,15 +90,6 @@ void AlipayMainView::OnSetUpView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayMainView::OnSetUpView"); View::OnSetUpView(); - - if (group == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::OnSetUpView group null error!"); - return; - } - - RootView::GetInstance()->Add(group); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RootView::GetInstance()->Add"); - // show timerView Draw(); } @@ -112,12 +106,6 @@ void AlipayMainView::OnStop() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayMainView::OnStop"); View::OnStop(); - if (container_ != nullptr) { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - group->RemoveAll(); RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); return; @@ -278,7 +266,7 @@ bool AlipayMainView::ChangePayView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangePayView alipayPayCode null error!"); return false; } - if (alipayPayCode->InitView() == false) { + if (!alipayPayCode->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangePayView InitView null error!"); return false; } @@ -305,7 +293,7 @@ bool AlipayMainView::ChangeSettingView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeSettingView alipayPayCode null error!"); return false; } - if (alipaySetting->InitView() == false) { + if (!alipaySetting->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeSettingView InitView null error!"); return false; } @@ -328,7 +316,7 @@ bool AlipayMainView::ChangeHelpView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeHelpView alipayHelp null error!"); return false; } - if (alipayHelp->InitView() == false) { + if (!alipayHelp->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeHelpView InitView null error!"); return false; } @@ -351,7 +339,7 @@ bool AlipayMainView::ChangeBindAniView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindAniView alipayBindAni null error!"); return false; } - if (alipayBindAni->InitView() == false) { + if (!alipayBindAni->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindAniView InitView null error!"); return false; } @@ -374,7 +362,7 @@ bool AlipayMainView::ChangeBindExitView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindExitView alipayExitBind null error!"); return false; } - if (alipayExitBind->InitView() == false) { + if (!alipayExitBind->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindExitView InitView null error!"); return false; } @@ -397,7 +385,7 @@ bool AlipayMainView::ChangeBindResView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindResView alipayBindRes null error!"); return false; } - if (alipayBindRes->InitView() == false) { + if (!alipayBindRes->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindResView InitView null error!"); return false; } @@ -427,7 +415,7 @@ bool AlipayMainView::ChangeUnbindView(int16 thisView) "AlipayMainView::ChangeUnbindView alipayExitBindSetting null error!"); return false; } - if (alipayExitBindSetting->InitView() == false) { + if (!alipayExitBindSetting->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeUnbindView InitView null error!"); return false; } @@ -452,7 +440,7 @@ bool AlipayMainView::ChangeUnbindFinishView(int16 thisView) "AlipayMainView::ChangeUnbindFinishView alipayUnbindFinish null error!"); return false; } - if (alipayUnbindFinish->InitView() == false) { + if (!alipayUnbindFinish->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeUnbindFinishView InitView null error!"); return false; } @@ -476,7 +464,7 @@ bool AlipayMainView::ChangeBindView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindView alipayBind null error!"); return false; } - if (alipayBind->InitView() == false) { + if (!alipayBind->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBindView InitView null error!"); return false; } @@ -499,7 +487,7 @@ bool AlipayMainView::ChangeTransView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransView alipayTransCode null error!"); return false; } - if (alipayTransCode->InitView() == false) { + if (!alipayTransCode->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransView InitView null error!"); return false; } @@ -522,7 +510,7 @@ bool AlipayMainView::ChangeTransListView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransListView alipayTransList null error!"); return false; } - if (alipayTransList->InitListView() == false) { + if (!alipayTransList->InitListView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransListView InitView null error!"); return false; } @@ -546,7 +534,7 @@ bool AlipayMainView::ChangeTransEnableView(int16 thisView) "AlipayMainView::ChangeTransEnableView alipayTransEnable null error!"); return false; } - if (alipayTransEnable->InitView() == false) { + if (!alipayTransEnable->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransEnableView InitView null error!"); return false; } @@ -569,7 +557,7 @@ bool AlipayMainView::ChangeTransTipsView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransTipsView alipayTransTips null error!"); return false; } - if (alipayTransTips->InitTipsView(presenter_->AlipayGetSwitchIndex()) == false) { + if (!alipayTransTips->InitTipsView(presenter_->AlipayGetSwitchIndex())) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransTipsView InitView null error!"); return false; } @@ -592,7 +580,7 @@ bool AlipayMainView::ChangeTransResView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransResView alipayTransRes null error!"); return false; } - if (alipayTransRes->InitResView(presenter_->AlipayGetSwitchIndex()) == false) { + if (!alipayTransRes->InitResView(presenter_->AlipayGetSwitchIndex())) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransResView InitView null error!"); return false; } @@ -616,7 +604,7 @@ bool AlipayMainView::ChangeGetTransListView(int16 thisView) "AlipayMainView::ChangeGetTransListView alipayGetTransList null error!"); return false; } - if (alipayGetTransList->InitGetView(presenter_->AlipayGetSwitchIndex()) == false) { + if (!alipayGetTransList->InitGetView(presenter_->AlipayGetSwitchIndex())) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeGetTransListView InitView null error!"); return false; } @@ -639,7 +627,7 @@ bool AlipayMainView::ChangeTransAniView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransProcessView alipayTransAni null error!"); return false; } - if (alipayTransAni->InitView() == false) { + if (!alipayTransAni->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeTransProcessView InitView null error!"); return false; } @@ -663,7 +651,7 @@ bool AlipayMainView::ChangeBarCodeView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBarView alipayPayCode null error!"); return false; } - if (alipayBarCode->InitView() == false) { + if (!alipayBarCode->InitView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeBarView InitView null error!"); return false; } @@ -690,7 +678,7 @@ bool AlipayMainView::ChangeListView(int16 thisView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeListView alipayList null error!"); return false; } - if (alipayList->InitListView() == false) { + if (!alipayList->InitListView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeListView InitView null error!"); return false; } @@ -737,7 +725,7 @@ bool AlipayMainView::ClickFunc(int16 interface) for (int i = 0; i < funcSize; i++) { if (interface == ViewMapper[i].viewId) { bool jug = (this->*(ViewMapper[i].func))(interface); - if (jug == false) { + if (!jug) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: ChangeInterFace[%d] false", interface); return false; } @@ -753,6 +741,7 @@ static const int16 DestroyMapper[] = { ALIPAY_GET_TRANS_LIST_VIEW, ALIPAY_TRANS_VIEW, ALIPAY_TRANS_LIST_VIEW, + ALIPAY_SETTING_VIEW, }; void AlipayMainView::DestroyTempView(int16 hideView) @@ -780,6 +769,9 @@ void AlipayMainView::DestroyTempView(int16 hideView) } else if (hideView == ALIPAY_TRANS_LIST_VIEW) { delete alipayTransList; alipayTransList = nullptr; + } else if (hideView == ALIPAY_SETTING_VIEW) { + delete alipaySetting; + alipaySetting = nullptr; } } @@ -797,7 +789,7 @@ void AlipayMainView::ChangeView(int16 hideView, int16 showView) return; } interListen = hideView; - if (ClickFunc(showView) == false) { + if (!ClickFunc(showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayMainView::ChangeView ClickFunc error"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayModel.cpp index 4c468ea13..353c788d4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayModel.cpp @@ -81,9 +81,9 @@ void AlipayBindTimerCallBack(void *argument) bool AlipayModel::AlipayStartBind(void) { - if (bindTimerId == NULL) { - bindTimerId = osTimerNew(AlipayBindTimerCallBack, osTimerPeriodic, (void *)0, NULL); - if (bindTimerId == NULL) { + if (bindTimerId == nullptr) { + bindTimerId = osTimerNew(AlipayBindTimerCallBack, osTimerPeriodic, (void *)0, nullptr); + if (bindTimerId == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayStartBind Create timer fail."); return false; } @@ -110,10 +110,10 @@ void AlipaySwitchTimerCallBackProc(void *argument) } int16 alipayLis = AlipayModel::GetInstance()->GetAlipayInterLis(); int16 bindState = AlipayModel::GetInstance()->AlipayGetBindFlag(); - if (alipayLis == ALIPAY_BIND_RES_VIEW && bindState == true) { + if (alipayLis == ALIPAY_BIND_RES_VIEW && bindState) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ALIPAY_BIND_RES_VIEW bindState true in."); AlipayMainView::GetInstance()->ChangeView(ALIPAY_BIND_RES_VIEW, ALIPAY_LIST_VIEW); - } else if (alipayLis == ALIPAY_BIND_RES_VIEW && bindState == false) { + } else if (alipayLis == ALIPAY_BIND_RES_VIEW && (!bindState)) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ALIPAY_BIND_RES_VIEW bindState false in."); AlipayMainView::GetInstance()->ChangeView(ALIPAY_BIND_RES_VIEW, ALIPAY_BIND_VIEW); } else if (alipayLis == ALIPAY_PAY_VIEW) { @@ -145,9 +145,9 @@ void AlipaySwitchTimerCallBack(void *argument) bool AlipayModel::AlipayStartSwitchTimer(uint16_t time) { - if (switchTimerId == NULL) { - switchTimerId = osTimerNew(AlipaySwitchTimerCallBack, osTimerOnce, (void *)0, NULL); - if (switchTimerId == NULL) { + if (switchTimerId == nullptr) { + switchTimerId = osTimerNew(AlipaySwitchTimerCallBack, osTimerOnce, (void *)0, nullptr); + if (switchTimerId == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayStartSwitchTimer Create timer fail."); return false; } @@ -166,7 +166,7 @@ bool AlipayModel::AlipayStartSwitchTimer(uint16_t time) void AlipayModel::AlipayStopSwitchTimer() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayStopSwitchTimer stop timer."); - if (switchTimerId != NULL) { + if (switchTimerId != nullptr) { osTimerStop(switchTimerId); } return; @@ -227,7 +227,7 @@ void AlipayModel::AlipayUnbind(void) void AlipayModel::AlipayStopBindTimer(void) { - if (bindTimerId == NULL) { + if (bindTimerId == nullptr) { return; } int32_t ret = osTimerStop(bindTimerId); @@ -272,10 +272,10 @@ int32_t AlipayModel::AlipayGetLocalTranslist() int32_t AlipayModel::AlipayGetOnlineTranslist() { cardInfo_ = AlipayTransGetCardList(); - mc_alipay_trans_card_info_t *onLineList = NULL; + mc_alipay_trans_card_info_t *onLineList = nullptr; onLineList = (mc_alipay_trans_card_info_t *)malloc(sizeof(mc_alipay_trans_card_info_t) * ALIPAY_TRANS_CARD_MAX_LENGTH); - if (onLineList == NULL) { + if (onLineList == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayGetOnlineTranslist alloc fail."); return -1; } @@ -294,7 +294,7 @@ int32_t AlipayModel::AlipayGetOnlineTranslist() cardSum_ = onLineNum; } free(onLineList); - onLineList = NULL; + onLineList = nullptr; return ret; } @@ -310,7 +310,7 @@ int32_t AlipayModel::AlipayCheckTransCard(uint32_t index) mc_alipay_tans_card_status_t cardStatus = { 0 }; int32_t ret = alipayApi->check_trans_cartstatus(&cardInfo_[index], &cardStatus); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayCheckTransCard in:%u.", ret); - if (cardStatus.card_exits == true && cardStatus.remain_use_count >= ALIPAY_TRANS_CARD_MIN_VALID_NUM) { + if (cardStatus.card_exits && cardStatus.remain_use_count >= ALIPAY_TRANS_CARD_MIN_VALID_NUM) { return 0; } return -1; @@ -361,9 +361,9 @@ void AlipayTransGetListsTimerCallBack(void *argument) bool AlipayModel::AlipayTransStartGetListsTimer(void) { - if (transTimerId == NULL) { - transTimerId = osTimerNew(AlipayTransGetListsTimerCallBack, osTimerPeriodic, (void *)0, NULL); - if (transTimerId == NULL) { + if (transTimerId == nullptr) { + transTimerId = osTimerNew(AlipayTransGetListsTimerCallBack, osTimerPeriodic, (void *)0, nullptr); + if (transTimerId == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayTransStartGetLists Create timer fail."); return false; } @@ -378,7 +378,7 @@ bool AlipayModel::AlipayTransStartGetListsTimer(void) } void AlipayModel::AlipayTransStopGetListsTimer(void) { - if (transTimerId == NULL) { + if (transTimerId == nullptr) { return; } int32_t ret = osTimerStop(transTimerId); @@ -481,7 +481,7 @@ int32_t AlipayModel::AlipayTransGetCardNum(void) bool AlipayModel::AlipayInitModel(void) { transCode_ = (uint8_t *)malloc(ALIPAY_TRANS_CODE_MAX_LEN); - if (transCode_ == NULL) { + if (transCode_ == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayInitModel transCode_ alloc failure."); return false; } @@ -498,9 +498,9 @@ bool AlipayModel::AlipayInitModel(void) void AlipayModel::AlipayDeinitModel(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayModel::AlipayDeinitModel in."); - if (transCode_ != NULL) { + if (transCode_ != nullptr) { free(transCode_); - transCode_ = NULL; + transCode_ = nullptr; } svr_alipay_deinit_trans_context(); return; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPayCode.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPayCode.cpp index ad73a51d7..79e738f0f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPayCode.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPayCode.cpp @@ -206,20 +206,20 @@ bool AlipayPayCode::InitView() SetStyle(STYLE_BACKGROUND_COLOR, 0xff1677ff); SetStyle(STYLE_BACKGROUND_OPA, 0xff); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPayCode::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImage() == false) { + if (!AlipayInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPayCode::InitView AlipayInitImage() false"); return false; } - if (AlipayInitQrcode() == false) { + if (!AlipayInitQrcode()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPayCode::InitView AlipayInitQrcode() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPayCode::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPresenter.cpp index d260f9d49..ef16fe90f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayPresenter.cpp @@ -50,7 +50,7 @@ void AlipayPresenter::OnStart() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayPresenter OnStart"); Presenter::OnStart(); alipayMode_->AlipayExitLpm(); - if (alipayMode_->AlipayInitModel() == false) { + if (!alipayMode_->AlipayInitModel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayPresenter::OnStart AlipayInitModel fail."); NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); return; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipaySetting.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipaySetting.cpp index 4b2527bc8..c889eff58 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipaySetting.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipaySetting.cpp @@ -154,11 +154,11 @@ bool AlipaySetting::InitView() SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipaySetting::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipaySetting::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp index 5776b782c..0bdadd009 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayGetTransList.cpp @@ -129,14 +129,14 @@ bool AlipayGetTransList::InitSimilarButton(int16 num, int16 alipayX, int16 alipa bool AlipayGetTransList::AlipayInitButton(uint32_t index) { - if (InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, - g_AlipayTransGetListMapper[index].label_left, g_AlipayTransGetListMapper[index].button_left) == false) { + if (!InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, + g_AlipayTransGetListMapper[index].label_left, g_AlipayTransGetListMapper[index].button_left)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayGetTransList::AlipayInitButton new alipayButton[ALIPAY_SET_ZERO] fail"); return false; } - if (InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, - g_AlipayTransGetListMapper[index].label_right, g_AlipayTransGetListMapper[index].button_right) == false) { + if (!InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, + g_AlipayTransGetListMapper[index].label_right, g_AlipayTransGetListMapper[index].button_right)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayGetTransList::AlipayInitButton new alipayButton[ALIPAY_SET_ONE] fail"); return false; @@ -153,11 +153,11 @@ bool AlipayGetTransList::InitGetView(uint32_t index) SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel(index) == false) { + if (!AlipayInitLabel(index)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayGetTransList::InitView AlipayInitLabel false"); return false; } - if (AlipayInitButton(index) == false) { + if (!AlipayInitButton(index)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayGetTransList::InitView AlipayInitButton false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp index cb34a5936..37adb66e5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransAni.cpp @@ -122,11 +122,11 @@ bool AlipayTransAni::InitView() SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransAni::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImageAni() == false) { + if (!AlipayInitImageAni()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransAni::InitView AlipayInitImageAni() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp index 784472dc8..2f0459546 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransCode.cpp @@ -121,16 +121,16 @@ bool AlipayTransCode::InitView() SetStyle(STYLE_BACKGROUND_COLOR, 0xff1677ff); SetStyle(STYLE_BACKGROUND_OPA, 0xff); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransCode::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitQrcode() == false) { + if (!AlipayInitQrcode()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransCode::InitView AlipayInitQrcode() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransCode::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp index 967d6168e..8b42995ba 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransEnable.cpp @@ -111,12 +111,12 @@ bool AlipayTransEnable::InitView() SetStyle(STYLE_BACKGROUND_COLOR, 0xff1677ff); SetStyle(STYLE_BACKGROUND_OPA, 0xff); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransEnable::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitQrcode() == false) { + if (!AlipayInitQrcode()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransEnable::InitView AlipayInitQrcode() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp index bab33701c..b77752179 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp @@ -126,12 +126,12 @@ bool AlipayTransList::InitListView() SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); SetStyle(STYLE_BACKGROUND_OPA, UN_OPACITY); - if (AlipayInitList() == false) { + if (!AlipayInitList()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransList::InitView AlipayInitList() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransList::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp index e0fed12da..c7b5558b2 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransRes.cpp @@ -178,16 +178,16 @@ bool AlipayTransRes::InitResView(uint32_t index) SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel(g_AlipayTransResMapper[index].str) == false) { + if (!AlipayInitLabel(g_AlipayTransResMapper[index].str)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransRes::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImage(PNG_ALIPAY_BIND_FAILURE) == false) { + if (!AlipayInitImage(PNG_ALIPAY_BIND_FAILURE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransRes::InitView AlipayInitImage() false"); return false; } - if (AlipayInitButton(index) == false) { + if (!AlipayInitButton(index)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransRes::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp index 2f92fed70..11706660a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp @@ -154,16 +154,16 @@ bool AlipayTransTips::InitTipsView(uint32_t index) SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel(g_AlipayTransTipsMapper[index].str) == false) { + if (!AlipayInitLabel(g_AlipayTransTipsMapper[index].str)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransTips::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitImage(PNG_ALIPAY_BIND_FAILURE) == false) { + if (!AlipayInitImage(PNG_ALIPAY_BIND_FAILURE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransTips::InitView AlipayInitImage() false"); return false; } - if (AlipayInitButton(index) == false) { + if (!AlipayInitButton(index)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayTransTips::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbind.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbind.cpp index 5c6d18580..2c081cae3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbind.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbind.cpp @@ -130,13 +130,13 @@ bool AlipayUnbind::InitSimilarButton(int16 num, int16 alipayX, int16 alipayY, co bool AlipayUnbind::AlipayInitButton() { - if (InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, UNBIND_BUTTON_TEXT_FIRST, - ALIPAY_SETTING_UNBIND) == false) { + if (!InitSimilarButton(ALIPAY_SET_ZERO, EXIT_BUTTON_EXIT_X, EXIT_BUTTON_EXIT_Y, UNBIND_BUTTON_TEXT_FIRST, + ALIPAY_SETTING_UNBIND)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbind::AlipayInitButton new alipayButton[ALIPAY_SET_ZERO] fail"); return false; } - if (InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, UNBIND_BUTTON_TEXT_SECOND, - ALIPAY_SETTING_CANCEL) == false) { + if (!InitSimilarButton(ALIPAY_SET_ONE, EXIT_BUTTON_BIND_X, EXIT_BUTTON_BIND_Y, UNBIND_BUTTON_TEXT_SECOND, + ALIPAY_SETTING_CANCEL)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbind::AlipayInitButton new alipayButton[ALIPAY_SET_ONE] fail"); return false; } @@ -152,11 +152,11 @@ bool AlipayUnbind::InitView() SetOnDragListener(presenter_); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbind::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbind::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbindFinish.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbindFinish.cpp index b7f49404b..817d90bf3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbindFinish.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/src/AlipayUnbindFinish.cpp @@ -126,11 +126,11 @@ bool AlipayUnbindFinish::InitView() SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - if (AlipayInitLabel() == false) { + if (!AlipayInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbindFinish::InitView AlipayInitLabel() false"); return false; } - if (AlipayInitButton() == false) { + if (!AlipayInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlipayUnbindFinish::InitView AlipayInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/AppItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/AppItemView.h index ffb9c803a..31eae8f9b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/AppItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/AppItemView.h @@ -18,7 +18,7 @@ namespace OHOS { class AppItemView : public UIViewGroup { public: explicit AppItemView(); - virtual ~AppItemView(); + ~AppItemView() override; void SetItemInfo(const AppItem &itemInfo); AppViewId GetViewId(); const char *GetAppUid(); @@ -33,6 +33,20 @@ private: UILabel label_; AppItem itemInfo_ = { VIEW_INVALID, nullptr, nullptr, nullptr, nullptr }; }; + +class HexagonsItemView : public UIImageView { +public: + explicit HexagonsItemView(); + ~HexagonsItemView(); + void SetItemInfo(const AppItem &itemInfo); + AppViewId GetViewId(); + const char *GetAppUid(); +private: + HexagonsItemView(const HexagonsItemView &); + HexagonsItemView &operator = (const HexagonsItemView &); + AppItem itemInfo_ = { VIEW_INVALID, nullptr, nullptr, nullptr, nullptr }; +}; + } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistAdapter.h index c4dc50bf0..5302fbc5e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistAdapter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistAdapter.h @@ -24,7 +24,7 @@ namespace OHOS { class ApplistAdapter : public AbstractAdapter { public: explicit ApplistAdapter(); - virtual ~ApplistAdapter(); + ~ApplistAdapter() override; /* * * @brief Obtains the data size of the UILabel adapter. @@ -33,11 +33,11 @@ public: * @since 1.0 * @version 1.0 */ - virtual uint16 GetCount(void) override; + uint16 GetCount(void) override; - virtual UIView *GetView(UIView *inView, int16 index) override; + UIView *GetView(UIView *inView, int16 index) override; - virtual void AddListItem(const AppItem &item); + void AddListItem(const AppItem &item); void SetItemClickListener(UIView::OnClickListener *itemClickListener) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h index 57db8ce4e..135071023 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h @@ -28,7 +28,7 @@ class ApplistModel { public: static ApplistModel &GetInstance(void); - void initApplist(); + void Init(); const AppItem *GetApplistItems() const; uint8 GetAppListNum() const; void ResolvingJSAppItems(void); @@ -38,7 +38,7 @@ public: int GetHeadItemY(void); void ApplistUpdate(void); void SetPresenter(ApplistPresenter *p); - + bool GetIsUseListStyle(void); private: ApplistModel(); ApplistModel(const ApplistModel &); @@ -53,6 +53,7 @@ private: uint16_t startIndex = 0; int headItemY = 0; + bool initFlag{false}; }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistPresenter.h index fd604015b..bcb6ec7fa 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistPresenter.h @@ -17,28 +17,34 @@ #include "KeyInputListener.h" namespace OHOS { - class ApplistPresenter : public Presenter, public UIView::OnClickListener { + class ApplistPresenter : public Presenter, public UIView::OnClickListener, + public ListScrollListener, public UIView::OnRotateListener { public: ApplistPresenter(); - virtual ~ApplistPresenter(); + ~ApplistPresenter() override; - virtual void OnStart() override; - virtual void OnResume() override; - virtual void OnPause() override; - virtual void OnStop() override; + void OnStart() override; + void OnResume() override; + void OnPause() override; + void OnStop() override; + bool OnRotate(UIView& view, const RotateEvent& event) override; bool OnClick(UIView &view, const ClickEvent &event) override; + void OnItemSelected(int16 index, UIView *view) override; void SetStartIndex(uint16_t index); uint16_t GetStartIndex(void); void SetHeadItemY(int y); int GetHeadItemY(void); uint8_t GetListItemNum(void); ApplistView* GetAppListView(); + bool GetIsUseListStyle(void); private: + AppItemView *itemViewSele{nullptr}; + AppItemView *preItemViewSele{nullptr}; ApplistModel *model{nullptr}; KeyInputListener *keyActListenr{nullptr}; }; } -#endif // APPLIST_PRESENTER_H \ No newline at end of file +#endif // APPLIST_PRESENTER_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h index 88be5fe1d..a1c5e91cc 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h @@ -14,6 +14,7 @@ #include "components/ui_scroll_view.h" #include "components/ui_label.h" #include "components/ui_list.h" +#include "components/ui_custom_hexagons_list.h" #include "window/window.h" #include "ohos_types.h" #include "BaseView.h" @@ -29,8 +30,8 @@ public: { continueDrag = false; } - virtual ~AppListOnDragListener() {} - virtual bool OnDragStart(UIView& view, const DragEvent& event) + ~AppListOnDragListener() override {} + bool OnDragStart(UIView& view, const DragEvent& event) override { UNUSED(view); UNUSED(event); @@ -39,7 +40,7 @@ public: return false; } - virtual bool OnDrag(UIView& view, const DragEvent& event) + bool OnDrag(UIView& view, const DragEvent& event) override { UNUSED(view); if (!continueDrag) { @@ -49,13 +50,13 @@ public: if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Applist Ondrag!!"); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_ZOOM); } return false; } - virtual bool OnDragEnd(UIView& view, const DragEvent& event) + bool OnDragEnd(UIView& view, const DragEvent& event) override { UNUSED(view); UNUSED(event); @@ -66,27 +67,37 @@ private: }; class ApplistPresenter; -class ApplistView : public View, public ListScrollListener { +class ApplistView : public View { public: ApplistView(); - virtual ~ApplistView(); + ~ApplistView(); - virtual void OnStart() override; - virtual void OnSetUpView() override; - virtual void OnTearDownView() override; - virtual void OnStop() override; + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; void AddAppItemToList(const AppItem &item); void ClearAppItemToList(); - void OnItemSelected(int16 index, UIView *view) override; - UIList* GetAppUIList(void); - + void RefreshAppList(void); private: + void HexagonsStyleOnStart(); + void ListStyleOnStart(); + void HexagonsStyleOnSetUpView(); + void ListStyleOnSetUpView(); + void HexagonsStyleOnStop(); + void ListStyleOnStop(); + + /* for list style */ ApplistAdapter *listAdapter_{nullptr}; UIList *contentList_{nullptr}; UIView::OnDragListener *dragListener{nullptr}; - AppItemView *itemViewSele{nullptr}; - AppItemView *preItemViewSele{nullptr}; + + /* for hexagons style */ + UICustomHexagonsList* hexagonsList_{nullptr}; + std::list listHexagonsView_; + uint16_t imgSize_ = 0; + uint16_t imgDistance_ = 0; }; } #endif // APPLIST_VIEW_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/AppItemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/AppItemView.cpp index 87ed2e4f5..cd35ebb0f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/AppItemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/AppItemView.cpp @@ -82,4 +82,25 @@ namespace OHOS { icon_.ResetTransParameter(); } + HexagonsItemView::HexagonsItemView() + { + } + + HexagonsItemView::~HexagonsItemView() + { + } + void HexagonsItemView::SetItemInfo(const AppItem &itemInfo) + { + itemInfo_ = itemInfo; + } + + AppViewId HexagonsItemView::GetViewId() + { + return itemInfo_.id; + } + + const char *HexagonsItemView::GetAppUid() + { + return itemInfo_.uid; + } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp index d08582292..c7fd860ca 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp @@ -5,7 +5,7 @@ * Create: 2021-09-18 */ -#include "stdint.h" +#include #include "mem_util.h" #include "bundle_info_utils.h" #include "securec.h" @@ -16,6 +16,7 @@ #include "UiConfig.h" #include "ApplistModel.h" #include "ApplistPresenter.h" +#include "SetDesktopModel.h" namespace OHOS { const AppItem g_nativeAppList[] = { @@ -50,18 +51,20 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistModel::~ApplistModel()"); } - void ApplistModel::initApplist() + + void ApplistModel::Init() { - ResolvingJSAppItems(); + if (!initFlag) { + ResolvingJSAppItems(); + initFlag = true; + } } void ApplistModel::ResolvingJSAppItems(void) { - uint8 i, ret, nativeAppNum; - int32 len = 0; #ifdef JS_ENABLE if (bundleInfos != nullptr) { - for (i = 0; i < bundleLen; i++) { + for (uint8_t i = 0; i < bundleLen; i++) { ClearBundleInfo(bundleInfos + i); } @@ -74,18 +77,19 @@ namespace OHOS { bundleLen = 0; appLen = 0; - nativeAppNum = sizeof(g_nativeAppList) / sizeof(AppItem); + uint8_t nativeAppNum = sizeof(g_nativeAppList) / sizeof(AppItem); if (nativeAppNum >= APP_MAX_NUM) { nativeAppNum = APP_MAX_NUM; } - ret = memcpy_s(applist, sizeof(AppItem) * APP_MAX_NUM, g_nativeAppList, sizeof(AppItem) * nativeAppNum); + uint8_t ret = memcpy_s(applist, sizeof(AppItem) * APP_MAX_NUM, g_nativeAppList, sizeof(AppItem) * nativeAppNum); if (ret != EOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%s] ret = %d, nativeAppNum = %d", __FUNCTION__, ret, nativeAppNum); nativeAppNum = 0; } appLen = nativeAppNum; #ifdef JS_ENABLE + int32_t len = 0; ret = BundleMsClient::GetInstance().GetBundleInfos(0, &bundleInfos, &len); if ((ret == 0) && (len > 0) && (bundleInfos != nullptr)) { bundleLen = len; @@ -107,6 +111,8 @@ namespace OHOS { appLen++; bundleInfos[len].abilityInfo = nullptr; } + } else { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "ResolvingJSAppItems GetBundleInfos ret = %d \r", ret); } #endif } @@ -142,14 +148,14 @@ namespace OHOS { void ApplistModel::ApplistUpdate(void) { + ResolvingJSAppItems(); if (presenter != nullptr) { - ResolvingJSAppItems(); presenter->GetAppListView()->ClearAppItemToList(); const AppItem *itemInfo = GetApplistItems(); for (uint8 i = 0; i < GetAppListNum(); i++) { presenter->GetAppListView()->AddAppItemToList(itemInfo[i]); } - presenter->GetAppListView()->GetAppUIList()->RefreshList(); + presenter->GetAppListView()->RefreshAppList(); } } @@ -157,4 +163,9 @@ namespace OHOS { { presenter = p; } + + bool ApplistModel::GetIsUseListStyle(void) + { + return (SetDesktopModel::GetInstance().GetDesktopStyle() == APPLIST_STYLE); + } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistPresenter.cpp index 66763132c..cf68b21b4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistPresenter.cpp @@ -7,18 +7,21 @@ #include "ApplistPresenter.h" #include "ability_manager.h" - #include "securec.h" +#include "components/ui_hexagons_list.h" +#include "TransitionType.h" namespace OHOS { ApplistPresenter::ApplistPresenter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::ApplistPresenter()"); model = &ApplistModel::GetInstance(); + model->Init(); model->SetPresenter(this); } - ApplistPresenter::~ApplistPresenter() { + ApplistPresenter::~ApplistPresenter() + { if (keyActListenr != nullptr) { delete keyActListenr; keyActListenr = nullptr; @@ -30,8 +33,6 @@ namespace OHOS { { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnStart()"); Presenter::OnStart(); - model->initApplist(); - if (keyActListenr == nullptr) { keyActListenr = new KeyInputListener(); if (keyActListenr != nullptr) { @@ -53,6 +54,7 @@ namespace OHOS { for (uint8 i = 0; i < model->GetAppListNum(); i++) { view_->AddAppItemToList(itemInfo[i]); } + view_->RefreshAppList(); } void ApplistPresenter::OnPause() @@ -63,28 +65,69 @@ namespace OHOS { void ApplistPresenter::OnStop(void) { Presenter::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); } - bool ApplistPresenter::OnClick(UIView &view, const ClickEvent &event) + bool ApplistPresenter::OnRotate(UIView& view, const RotateEvent& event) { - UNUSED(event); - AppItemView *itemView = static_cast(&view); + UICustomHexagonsList* hexagonsView = dynamic_cast(&view); + if (hexagonsView == nullptr) { + return false; + } + int8_t index = hexagonsView->GetFocusedImgIndex(); + uint8_t focusIndex_ = 0; + if (index >= 0) { + focusIndex_ = static_cast(index); + } + HexagonsItemView *itemView = dynamic_cast(hexagonsView->GetViewByIndex(focusIndex_)); AppViewId viewId = itemView->GetViewId(); + if (FloatMore(hexagonsView->GetGlobalScale(), 2.0f)) { // 2.0 threshold for beginning transition + hexagonsView->StopRotateAnimator(); + NativeAbility::GetInstance().ChangeSlice(viewId, TransitionType::TRANSITION_HEXAGONS); + hexagonsView->ClearFocus(); + } + return true; + } + bool ApplistPresenter::OnClick(UIView &view, const ClickEvent &event) + { + UNUSED(event); + AppViewId viewId = VIEW_INVALID; + char *uid = nullptr; + TransitionType type = TransitionType::TRANSITION_INVALID; + if (GetIsUseListStyle()) { + AppItemView *itemView = dynamic_cast(&view); + if (itemView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "itemView is nullptr", viewId); + return false; + } + viewId = itemView->GetViewId(); + uid = (char *)itemView->GetAppUid(); + } else { + HexagonsItemView *itemView = dynamic_cast(&view); + UIHexagonsList* hexagonsView = dynamic_cast(itemView->GetParent()); + if (hexagonsView == nullptr || itemView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hexagonsView or itemView is nullptr"); + return false; + } + viewId = itemView->GetViewId(); + uid = (char *)itemView->GetAppUid(); + hexagonsView->SetDraggable(false); + hexagonsView->Scale(1.0f, itemView->GetViewIndex()); // switch focus to click view + type = TransitionType::TRANSITION_HEXAGONS; + } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick viewid = %d", viewId); if (viewId < VIEW_MAX_INTER_APP) { - NativeAbility::GetInstance().ChangeSlice(viewId); + NativeAbility::GetInstance().ChangeSlice(viewId, type); return true; } else if (viewId == VIEW_EXTERN_APP) { #ifdef JS_ENABLE - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick bundleName = %s", itemView->GetAppUid()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick bundleName = %s", uid); Want *want = new Want(); memset_s(want, sizeof(Want), 0, sizeof(Want)); ElementName startElement = {}; startElement.abilityName = (char *)"default"; - startElement.bundleName = (char *)itemView->GetAppUid(); + startElement.bundleName = uid; startElement.deviceId = nullptr; SetWantElement(want, startElement); @@ -95,7 +138,19 @@ namespace OHOS { } return false; } + void ApplistPresenter::OnItemSelected(int16 index, UIView *view) + { + UNUSED(index); + if (view != nullptr) { + itemViewSele = static_cast(view); + itemViewSele->SelectedChange(); + if (preItemViewSele != nullptr && preItemViewSele != itemViewSele) { + preItemViewSele->Reset(); + } + preItemViewSele = itemViewSele; + } + } void ApplistPresenter::SetStartIndex(uint16_t index) { model->SetStartIndex(index); @@ -123,9 +178,14 @@ namespace OHOS { return model->GetAppListNum(); } + bool ApplistPresenter::GetIsUseListStyle(void) + { + return model->GetIsUseListStyle(); + } + ApplistView* ApplistPresenter::GetAppListView() { return view_; } -} \ No newline at end of file +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistView.cpp index c0f0cf68b..0f3d9bbf3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistView.cpp @@ -22,19 +22,62 @@ ApplistView::ApplistView() ApplistView::~ApplistView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::~ApplistView "); - delete listAdapter_; - listAdapter_ = nullptr; - delete contentList_; - contentList_ = nullptr; - delete dragListener; - dragListener = nullptr; + if (listAdapter_ != nullptr) { + delete listAdapter_; + listAdapter_ = nullptr; + } + if (contentList_ != nullptr) { + delete contentList_; + contentList_ = nullptr; + } + if (dragListener != nullptr) { + delete dragListener; + dragListener = nullptr; + } + if (hexagonsList_ != nullptr) { + delete hexagonsList_; + hexagonsList_ = nullptr; + } } void ApplistView::OnStart() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::OnStart "); View::OnStart(); + if (presenter_->GetIsUseListStyle()) { + ListStyleOnStart(); + } else { + HexagonsStyleOnStart(); + } +} +void ApplistView::HexagonsStyleOnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::HexagonsStyleOnStart "); + if (hexagonsList_ == nullptr) { + hexagonsList_ = new UICustomHexagonsList(); + } + hexagonsList_->SetPosition(0, 0, + Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); // 2, two + imgDistance_ = hexagonsList_->GetWidth() * 0.25991; // 0.25991, empirical coefficient + imgSize_ = hexagonsList_->GetWidth() * 0.23348; // 0.23348, empirical coefficient + hexagonsList_->SetImageDistance(imgDistance_); + hexagonsList_->SetImageSizeInCenter(imgSize_); + int16_t blankSize = hexagonsList_->GetRelativeRect().GetWidth() > hexagonsList_->GetRelativeRect().GetHeight() ? + hexagonsList_->GetRelativeRect().GetWidth() / 2 : hexagonsList_->GetRelativeRect().GetHeight() / 2; // 2, half + hexagonsList_->SetScrollBlankSize(blankSize); + hexagonsList_->SetReboundSize(blankSize); + hexagonsList_->SetThrowDrag(true); + hexagonsList_->SetOnRotateListener(presenter_); + hexagonsList_->RequestFocus(); + SetContainerView(hexagonsList_); +} + +void ApplistView::ListStyleOnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnStart"); + SetContainerView(new UIViewGroup()); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); listAdapter_ = new ApplistAdapter(); if (listAdapter_ == nullptr) { return; @@ -52,10 +95,10 @@ void ApplistView::OnStart() contentList_->SetDraggable(true); contentList_->SetThrowDrag(true); contentList_->EnableAutoAlign(true); - contentList_->SetScrollStateListener(this); + contentList_->SetScrollStateListener(presenter_); contentList_->SetMaxScrollDistance(MAX_SCROLL_DIS); contentList_->SetYScrollBarVisible(true); - SetContainerView(contentList_); + container_->Add(contentList_); dragListener = new AppListOnDragListener(); if (dragListener == nullptr) { @@ -68,6 +111,21 @@ void ApplistView::OnSetUpView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::OnSetUpView"); View::OnSetUpView(); + if (presenter_->GetIsUseListStyle()) { + ListStyleOnSetUpView(); + } else { + HexagonsStyleOnSetUpView(); + } +} + +void ApplistView::HexagonsStyleOnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::HexagonsStyleOnSetUpView "); +} + +void ApplistView::ListStyleOnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnSetUpView"); if (contentList_ == nullptr || listAdapter_ == nullptr) { return; @@ -88,7 +146,6 @@ void ApplistView::OnSetUpView() contentList_->SetStartIndex(startIndex); contentList_->SetAdapter(listAdapter_); contentList_->ScrollBy(headY); - Draw(); return; } @@ -102,48 +159,81 @@ void ApplistView::OnTearDownView() void ApplistView::OnStop() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::OnStop"); - int16_t listHeadY = contentList_->GetChildrenHead()->GetY(); - int16_t listHeadIndex = contentList_->GetChildrenHead()->GetViewIndex(); - - presenter_->SetHeadItemY(listHeadY); - presenter_->SetStartIndex(listHeadIndex); - + if (presenter_->GetIsUseListStyle()) { + ListStyleOnStop(); + } else { + HexagonsStyleOnStop(); + } View::OnStop(); - container_ = nullptr; - + if (container_ != nullptr) { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } RootView::GetInstance()->ClearOnKeyActListener(); - RootView::GetInstance()->RemoveAll(); + FocusManager::GetInstance()->ClearFocus(); return; } -void ApplistView::AddAppItemToList(const AppItem &item) +void ApplistView::HexagonsStyleOnStop() { - listAdapter_->AddListItem(item); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::HexagonsStyleOnStop"); + if (hexagonsList_ != nullptr) { + hexagonsList_->RemoveAll(); + } + for (auto iter : listHexagonsView_) { + delete iter; + } + listHexagonsView_.clear(); } -void ApplistView::ClearAppItemToList() +void ApplistView::ListStyleOnStop() { - listAdapter_->ClearItem(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::ListStyleOnStop"); + int16_t listHeadY = contentList_->GetChildrenHead()->GetY(); + int16_t listHeadIndex = contentList_->GetChildrenHead()->GetViewIndex(); + presenter_->SetHeadItemY(listHeadY); + presenter_->SetStartIndex(listHeadIndex); } -void ApplistView::OnItemSelected(int16 index, UIView *view) +void ApplistView::AddAppItemToList(const AppItem &item) { - UNUSED(index); - if (view != nullptr) { - itemViewSele = static_cast(view); - itemViewSele->SelectedChange(); + if (presenter_->GetIsUseListStyle()) { + listAdapter_->AddListItem(item); + } else { + HexagonsItemView *itemView = new HexagonsItemView(); + itemView->SetItemInfo(item); + itemView->SetSrc(item.iconSmall); + itemView->SetTouchable(true); + itemView->SetOnClickListener(presenter_); + + hexagonsList_->Add(itemView); + listHexagonsView_.push_back(itemView); + } +} - if (preItemViewSele != nullptr && preItemViewSele != itemViewSele) { - preItemViewSele->Reset(); +void ApplistView::ClearAppItemToList() +{ + if (presenter_->GetIsUseListStyle()) { + listAdapter_->ClearItem(); + } else { + if (hexagonsList_ != nullptr) { + hexagonsList_->RemoveAll(); + } + for (auto iter : listHexagonsView_) { + delete iter; } - preItemViewSele = itemViewSele; + listHexagonsView_.clear(); } } -UIList* ApplistView::GetAppUIList(void) +void ApplistView::RefreshAppList(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::GetAppUIList"); - return contentList_; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistView::RefreshAppList"); + if (presenter_->GetIsUseListStyle()) { + contentList_->RefreshList(); + } else { + hexagonsList_->LayoutChildren(true); + } } - } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenModel.h b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenModel.h index 97863c912..d7a7aa9e3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenModel.h @@ -8,7 +8,7 @@ #ifndef BLOOD_OXYGEN_MODEL_H #define BLOOD_OXYGEN_MODEL_H -#include "stdio.h" +#include #include "gfx_utils/list.h" #include "los_mux.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenPresenter.h index 8c13dfe6a..b09e67960 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenPresenter.h @@ -21,13 +21,13 @@ class BloodOxygenPresenter : public Presenter, public UIView::OnDragListener { public: BloodOxygenPresenter(); - virtual ~BloodOxygenPresenter(); + ~BloodOxygenPresenter() override; void OnStart() override; void OnPause() override; void OnResume() override; void OnStop() override; - virtual void Notify() override; + void Notify() override; static BloodOxygenPresenter *GetInstance(void); bool OnDrag(UIView& view, const DragEvent& event) override; bool OnClick(UIView& view, const ClickEvent& event) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenView.h b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenView.h index 5a1b12cd9..fceeb7889 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodOxygenView.h @@ -25,7 +25,7 @@ namespace OHOS { class BloodOxygenView : public View { public: BloodOxygenView(); - virtual ~BloodOxygenView(); + ~BloodOxygenView() override; void OnStop() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp index 4c8f4aa4a..a21717584 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp @@ -12,6 +12,7 @@ #include "components/ui_label.h" #include "BloodBandoffView.h" #include "ChangeSliceListener.h" +#include "ui_service.h" namespace OHOS { static BloodOxygenPresenter *g_pMainView = nullptr; @@ -38,6 +39,7 @@ BloodOxygenPresenter* BloodOxygenPresenter::GetInstance() void BloodOxygenPresenter::OnStart() { Presenter::OnStart(); + SendMsgToUIService(UI_ADD_SLEEP_VETO, 0, nullptr, 0); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::On Start "); } @@ -45,7 +47,10 @@ void BloodOxygenPresenter::OnPause(void) {} void BloodOxygenPresenter::OnResume(void) {} -void BloodOxygenPresenter::OnStop(void) {} +void BloodOxygenPresenter::OnStop(void) +{ + SendMsgToUIService(UI_RM_SLEEP_VETO, 0, nullptr, 0); +} bool BloodOxygenPresenter::CheckPointersValue() { @@ -81,7 +86,7 @@ bool BloodOxygenPresenter::OnClick(UIView& view, const ClickEvent& event) UNUSED(view); UNUSED(event); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::OnClick"); - if (CheckPointersValue() == false) { + if (!CheckPointersValue()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::Pointers is empty"); return false; } @@ -98,12 +103,12 @@ bool BloodOxygenPresenter::OnClick(UIView& view, const ClickEvent& event) void BloodOxygenPresenter::ProgressNotify(void) { - if (CheckPointersValue() == false) { + if (!CheckPointersValue()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenPresenter::Pointers is empty"); return; } - if (BloodOxygenModel::GetInstance()->GetBloodOxygenViewStatus() == true) { + if (BloodOxygenModel::GetInstance()->GetBloodOxygenViewStatus()) { count--; BloodOxygenView::GetInstance()->GetCircleProgress()->SetValue(count); if (count == PROGRESS_VALUE_MIN) { @@ -118,8 +123,8 @@ void BloodOxygenPresenter::ProgressNotify(void) void BloodOxygenPresenter::ReturnInterface() { - if (BloodOxygenModel::GetInstance()->GetBloodBandoffViewStatus() == true) { - if (BloodBandoffView::GetInstance()->GetImageAnimator()->GetState() == false) { + if (BloodOxygenModel::GetInstance()->GetBloodBandoffViewStatus()) { + if (!BloodBandoffView::GetInstance()->GetImageAnimator()->GetState()) { BloodOxygenModel::GetInstance()->SetBloodBandoffViewStatus(false); BloodOxygenModel::GetInstance()->SetBloodOxygenViewStatus(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenView.cpp index 553387f9e..d9c88c030 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenView.cpp @@ -313,8 +313,6 @@ void BloodOxygenView::OnStart() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodOxygenView::OnStart"); View::OnStart(); - - group = new UIViewGroup(); if (group == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenView::new group fail"); @@ -323,11 +321,11 @@ void BloodOxygenView::OnStart() group->SetPosition(MATH_ZERO, MATH_ZERO); group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); - if (InitImageDisplay() == false) { + if (!InitImageDisplay()) { return; } - if (SetOnDragListener() == false) { + if (!SetOnDragListener()) { return; } @@ -358,7 +356,7 @@ void BloodOxygenView::OnStart() } group->Add(testButton); - if (OHOS::BloodOxygenModel::GetInstance()->GetBloodOxygenViewStatus() == true) { + if (OHOS::BloodOxygenModel::GetInstance()->GetBloodOxygenViewStatus()) { testButton->SetTouchable(false); percent->SetText(""); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothItemView.h index 3e9d617fc..563fe825d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothItemView.h @@ -22,11 +22,11 @@ namespace OHOS { class BluetoothItemView : public UIViewGroup { public: explicit BluetoothItemView(); - virtual ~BluetoothItemView(); - virtual void SetItemInfo(const BluetoothCaseInfo& itemInfo, bool isCaseList); + ~BluetoothItemView() override; + void SetItemInfo(const BluetoothCaseInfo& itemInfo, bool isCaseList); BluetoothCaseInfo *GetItemInfo(void); void SetConnectionstatus(const BluetoothCaseInfo& infoData); - virtual void SetUpChild(); + void SetUpChild(); void ConnectAnimatorStart(void); void ConnectAnimatorStop(void); bool IsConnectAnimator(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothModel.h b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothModel.h index 25c7d4157..1c9347e95 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/BluetoothModel.h @@ -9,7 +9,7 @@ #define BLUETOOTH_MODEL_H #include -#include "stdio.h" +#include #include "gfx_utils/list.h" #include "bts_def.h" @@ -29,18 +29,6 @@ typedef struct { int16_t temp; } BluetoothCaseInfo; -typedef struct { - void *stream_hdl; - uint8_t loc_volume; - uint8_t play_stat; - uint8_t dir_forward; - uint8_t avrcp_button_flag; - bd_addr_t bd_addr; - uint8_t reg_cap_auto; - uint8_t resrv; - profile_connect_state_t avrcp_srv_conn_stat; -} BtAvrcpTgInftrerface; - class BluetoothItemView; class BluetoothModel { public: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/MainBluetoothView.h b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/MainBluetoothView.h index a8703af71..a3fd9af85 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/MainBluetoothView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/include/MainBluetoothView.h @@ -32,7 +32,7 @@ class MainBluetoothView; class MainBluetoothView : public View { public: MainBluetoothView(); - virtual ~MainBluetoothView(); + ~MainBluetoothView() override; void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp index ac24bf15d..9bd3eac6f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp @@ -106,7 +106,7 @@ void BluetoothCaseListAdapter::ClickAnimation(BluetoothCaseInfo &itemData, Bluet { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothCaseListAdapter::ClickAnimation"); bool ret = BluetoothModel::GetInstance()->IsTagScanDeviceClicked(); - if (ret == true) { + if (ret) { BluetoothCaseInfo *clickInfo = BluetoothModel::GetInstance()->GetTempMacValue(); if ((clickInfo->addr[0] == itemData.addr[0]) && (clickInfo->addr[1] == itemData.addr[1]) && (clickInfo->addr[2] == itemData.addr[2]) && (clickInfo->addr[3] == itemData.addr[3]) && diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp index 8e0c806c0..94ef720d7 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp @@ -185,7 +185,7 @@ void BluetoothDeviceListView::RefreshText(void) List &bluetoothConnedList = BluetoothModel::GetInstance()->GetConnedDevicesCase(); bool ret = bluetoothConnedList.IsEmpty(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothDeviceListView::RefreshText bluetoothConnedList.IsEmpty ret = %d", ret); - if (ret == true) { + if (ret) { emptyLabel->SetVisible(true); } else { emptyLabel->SetVisible(false); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp index e7f807cf5..c26c7f573 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp @@ -23,7 +23,7 @@ static BluetoothEarPhoneView *g_pBluetoothEarPhoneView{nullptr}; #define BLUETOOTH_IMAGE_HEIGHT 104 #define BLUETOOTH_DELAY 200 -osTimerId_t g_stopScanHandle = NULL; +osTimerId_t g_stopScanHandle = nullptr; static constexpr uint64_t MS_SCAN_TIME = 25000; BluetoothEarPhoneView::BluetoothEarPhoneView() @@ -143,13 +143,13 @@ UIViewGroup *BluetoothEarPhoneView::InitShowUpView() void CancelBrScanHandle(void) { - if (g_stopScanHandle != NULL) { + if (g_stopScanHandle != nullptr) { osStatus_t ret = osTimerDelete(g_stopScanHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_stopScanHandle = NULL; + g_stopScanHandle = nullptr; } bool results = gap_br_cancel_discovery(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CancelBtDiscovery results %d", results); @@ -224,19 +224,19 @@ void BluetoothEarPhoneView::BtEnable() setScanStatus(true); // 开始扫描标记 BluetoothModel::GetInstance()->SetCaseListClear(); // 扫描list清空 ret = is_bt_discovering(BT_TRANSPORT_BR_EDR); - if (ret == true) { + if (ret) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable Bt is Discovering"); return; } else { results = gap_br_start_discovery(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable StartBtDiscovery results %d", results); } - if (g_stopScanHandle != NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable g_stopScanHandle != NULL"); + if (g_stopScanHandle != nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable g_stopScanHandle != nullptr"); return; } - g_stopScanHandle = osTimerNew((osTimerFunc_t)ScanTimerCallback, osTimerPeriodic, NULL, NULL); - if (g_stopScanHandle == NULL) { + g_stopScanHandle = osTimerNew((osTimerFunc_t)ScanTimerCallback, osTimerPeriodic, nullptr, nullptr); + if (g_stopScanHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable osTimerNew failed!!"); return; } @@ -244,13 +244,13 @@ void BluetoothEarPhoneView::BtEnable() osStatus_t retTimer = osTimerStart(g_stopScanHandle, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable osTimerStart failed, ret = %lx!!", retTimer); - if (g_stopScanHandle != NULL) { + if (g_stopScanHandle != nullptr) { retTimer = osTimerDelete(g_stopScanHandle); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView::BtEnable osTimerDelete ret = %lx!!", retTimer); return; } - g_stopScanHandle = NULL; + g_stopScanHandle = nullptr; } return; } @@ -260,7 +260,7 @@ void BluetoothEarPhoneView::BtEnable() void BluetoothEarPhoneView::StopBtDiscovery(void) { bool ret = is_bt_discovering(BT_TRANSPORT_BR_EDR); - if (ret == false) { + if (!ret) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Bt is not Discovering"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp index 6b1d6e73b..00057bc20 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp @@ -26,11 +26,14 @@ bt_avrcp_tg_bts_cbk g_avrcp_tg_audio_cb; avrcp_ct_callbacks_t g_avrcp_ct_cb; avrcp_tg_callbacks_t g_avrcp_tg_cb; BtAvrcpTgInf g_avrcp_srv_inf; -static profile_connect_state_t g_avrcpTgStat = {}; -static profile_connect_state_t BtAvrcpStat() +void BtAvrcpVolumeChangedSyncMedia(uint8_t a2dp_volume) { - return g_avrcpTgStat; + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[BtAvrcpVolumeChangedSyncMedia]::a2dp_volume = 0x%x\r\n", a2dp_volume); + int32_t audio_volume = a2dp_volume * BT_A2DP_MEDIA_VOL_LEVEL / AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100; + AudioManager::GetInstance().SetVolume(AUDIO_STREAM_A2DP_MUSIC, audio_volume); /* 设置增益音量 */ + g_avrcp_tg_local_media_vol = a2dp_volume; + avrcp_tg_notify_volume_changed(a2dp_volume); } /* tg通知媒体状态 */ @@ -74,9 +77,10 @@ static void BtAvrcpTgNotifyMeidaStatus(bt_avrcp_tg_evt_status_param *notifyEvent avrcp_tg_notify_uid_changed(*(td_u16 *)notifyEventStatusParam->event_status); break; case AVRCP_NOTIFY_EVENT_VOLUME_CHANGED: - avrcp_tg_notify_volume_changed(*(td_u8 *)notifyEventStatusParam->event_status); + BtAvrcpVolumeChangedSyncMedia(notifyEventStatusParam->event_status[0]); break; case AVRCP_NOTIFY_EVENT_RESERVED: + break; default: break; } @@ -84,7 +88,7 @@ static void BtAvrcpTgNotifyMeidaStatus(bt_avrcp_tg_evt_status_param *notifyEvent void PressButtonStatusCallback(td_u32 keyOperation, td_u32 keyValue) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PressButtonStatusCallback]::keyValue = %x keyOperation = %x", + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PressButtonStatusCallback]::keyValue = 0x%x keyOperation = 0x%x", keyValue, keyOperation); GraphicService::GetInstance()->PostGraphicEvent(std::bind(UsingPressButtonStatusCallback, keyOperation, keyValue)); } @@ -92,7 +96,8 @@ void PressButtonStatusCallback(td_u32 keyOperation, td_u32 keyValue) void BtAvrcpTgNotifyVolumeChangedProc(uint8_t a2dp_volume) { int32_t audio_volume = a2dp_volume * BT_A2DP_MEDIA_VOL_LEVEL / AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100; - AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, audio_volume); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "NotifyVolume = %d", audio_volume); + AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, audio_volume); // 耳机连接手表场景调节手表音量 } void UsingPressButtonStatusCallback(td_u32 keyOperation, td_u32 keyValue) @@ -145,10 +150,15 @@ void UsingPressButtonStatusCallback(td_u32 keyOperation, td_u32 keyValue) uint8_t BtAvrcpTgGetLocMediaVolume(void) { - uint32_t audio_volume = AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC); - uint8_t a2dp_volume = audio_volume * AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100 / BT_A2DP_MEDIA_VOL_LEVEL; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "get local media volume, a2dp_volume = 0x%x", a2dp_volume); - return a2dp_volume; + if (g_avrcp_tg_local_media_vol == AVRCP_ABSOLUTE_VOLUME_INVALID) { + int32_t audio_volume = AudioManager::GetInstance().GetVolume(AUDIO_STREAM_A2DP_MUSIC); + uint8_t a2dp_volume = (uint8_t)(audio_volume * AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100 / BT_A2DP_MEDIA_VOL_LEVEL); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "audio_volume 0x%x, a2dp_volume 0x%x\n", audio_volume, a2dp_volume); + g_avrcp_tg_local_media_vol = a2dp_volume; + } + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "get local media volume, a2dp_volume = 0x%x", g_avrcp_tg_local_media_vol); + return g_avrcp_tg_local_media_vol; } void MediaStatusCallback(bt_avrcp_tg_evt_status_param *eventStatusParam) @@ -221,7 +231,7 @@ void ConnectTgStateChangedCallback(const bd_addr_t *bdAddr, profile_connect_stat WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bdaddr nullptr"); return; } - g_avrcpTgStat = state; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnCtStateChangedCallback addr: %02x%02x%02x%02x%02x%02x ", bdAddr->addr[5], bdAddr->addr[4], bdAddr->addr[3], /* 5 4 3 idx */ bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* 2 1 0 idx */ @@ -236,7 +246,7 @@ void ConnectTgStateChangedCallback(const bd_addr_t *bdAddr, profile_connect_stat static void BtAvrcpCtPressButtonRspCallback(const bd_addr_t *bd_addr, int32_t key_operation) { - if (bd_addr == NULL) { + if (bd_addr == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } @@ -299,7 +309,7 @@ static void BtAvrcpCtReleaseButtonRspCallback(const bd_addr_t *bd_addr, int32_t static void BtAvrcpCtSupportCompanyCallback(const bd_addr_t *bd_addr, avrcp_ct_support_company_para_t *company) { - if (bd_addr == NULL || company == NULL || company->company_id == NULL) { + if (bd_addr == nullptr || company == nullptr || company->company_id == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } @@ -311,7 +321,7 @@ static void BtAvrcpCtSupportCompanyCallback(const bd_addr_t *bd_addr, avrcp_ct_s static void BtAvrcpCtSupportEventCallback(const bd_addr_t *bd_addr, avrcp_ct_support_event_para_t *event) { - if (bd_addr == NULL || event == NULL || event->event_id == NULL) { + if (bd_addr == nullptr || event == nullptr || event->event_id == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } @@ -329,7 +339,7 @@ static void BtAvrcpCtSupportEventCallback(const bd_addr_t *bd_addr, avrcp_ct_sup static void BtAvrcpCtGetElementAttriCallback(const bd_addr_t *bd_addr, avrcp_ct_element_attr_para_cb_t *attr_cb_para) { - if (bd_addr == NULL || attr_cb_para == NULL || attr_cb_para->attr_value == NULL) { + if (bd_addr == nullptr || attr_cb_para == nullptr || attr_cb_para->attr_value == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } @@ -367,7 +377,7 @@ static void BtAvrcpCtGetElementAttriCallback(const bd_addr_t *bd_addr, avrcp_ct_ } uint8_t *value = (uint8_t *)(void *)malloc(attr_cb_para->attr_value[i].value_len + 1); - if (attr_cb_para->attr_value[i].value_len > 0 && attr_cb_para->attr_value[i].value != NULL) { + if (attr_cb_para->attr_value[i].value_len > 0 && attr_cb_para->attr_value[i].value != nullptr) { if (memcpy_s(value, attr_cb_para->attr_value[i].value_len, attr_cb_para->attr_value[i].value, attr_cb_para->attr_value[i].value_len) != EOK) { free(value); @@ -383,7 +393,7 @@ static void BtAvrcpCtGetElementAttriCallback(const bd_addr_t *bd_addr, avrcp_ct_ static void BtAvrcpCtGetPlayStatusCallback(const bd_addr_t *bd_addr, avrcp_ct_play_status_cb_t *status) { - if (bd_addr == NULL || status == NULL) { + if (bd_addr == nullptr || status == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } @@ -400,7 +410,7 @@ static void BtAvrcpCtHdlNotifyVolumeRspCbk(avrcp_ct_notification_value_cb_t *not static void BtAvrcpCtNotificationCallback( const bd_addr_t *bd_addr, avrcp_notify_event_t event_id, avrcp_ct_notification_value_cb_t *notification) { - if (bd_addr == NULL || notification == NULL) { + if (bd_addr == nullptr || notification == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "null pointer\n"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp index 5f668e72a..676c0183e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp @@ -76,9 +76,9 @@ void BluetoothItemView::SetItemInfo(const BluetoothCaseInfo& itemInfo, bool isCa WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothItemView::SetItemInfo"); itemInfo_ = itemInfo; namelabel.SetText(reinterpret_cast(itemInfo_.deviceName)); - if (isCaseList == true) { + if (isCaseList) { bool ret = BluetoothModel::GetInstance()->IsTagScanDeviceClicked(); - if ((IsConnectAnimator() == false) && (ret == true)) { + if ((!IsConnectAnimator()) && (ret)) { namelabel.SetStyle(STYLE_TEXT_COLOR, Color::Gray().full); button.SetTouchable(false); SetTouchable(false); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index f7eeb073b..0be241e38 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -4,7 +4,7 @@ * Author: * Create: 2021-10-13 */ -#include "stdint.h" +#include #include "BluetoothModel.h" #include "BluetoothPresenter.h" #include "ConnectPhonePresenter.h" @@ -13,10 +13,7 @@ #include "PlayersModel.h" #include "PhoneAudio.h" #include "graphic_service.h" -#include "ui_service.h" - #include "msg_center.h" - #include "bts_def.h" #include "bts_gatt_stru.h" #include "bts_a2dp_source.h" @@ -41,11 +38,9 @@ namespace OHOS { constexpr uint16_t BLUETOOTH_MAX_NUM = 20; #define MEDIA_A2DP_SNK_INTERFACE 1 -osal_timer g_a2dp_stream_accept_timer = {NULL, NULL, 0, 0}; +osal_timer g_a2dp_stream_accept_timer = {nullptr, nullptr, 0, 0}; #define A2DP_STREAM_ACCEPT_TIMER_PERIOD 500 AudioFormatConfig g_audio_format_config = {AUDIO_DEFAULT, 0, 0}; -BtAvrcpTgInftrerface g_avrcp_srv_infterface; - void BluetoothModel::SetBluetoothCalleridStatus(int16_t value) { @@ -192,7 +187,7 @@ void BluetoothModel::SetUpConnedDevicesList() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Setup GetPariedDevicesNum ret = %d, num = %d", ret, connedDevicesNum); gap_paired_device_info_t *devInfo = (gap_paired_device_info_t*)malloc(sizeof(gap_paired_device_info_t) *connedDevicesNum); - if (devInfo == NULL) { + if (devInfo == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DevInfo malloc failed %u", sizeof(gap_paired_device_info_t) *connedDevicesNum); return; } @@ -649,8 +644,8 @@ static void ACLConnectionSuss(const bd_addr_t &bdAddr) { // 判断是否已退出蓝牙模块(无需跳转) bool tagConnectView = BluetoothModel::GetInstance()->IsTagConnectView(); - if (tagConnectView == false) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback tagConnectView == false"); + if (!tagConnectView) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback tagConnectView fail"); return; } // 成功提示 @@ -686,8 +681,8 @@ static void ACLConnectionFail(const bd_addr_t &bdAddr) bool tagConnectView = BluetoothModel::GetInstance()->IsTagConnectView(); // 判断是否无需跳转到失败界面 bool tagDisconnectView = BluetoothModel::GetInstance()->IsTagDisconnectView(); - if (tagConnectView == false || tagDisconnectView == false) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback tagDisconnectView == false"); + if ((!tagConnectView) || (!tagDisconnectView)) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback tagDisconnectView fail"); return; } // 失败提示页 @@ -717,39 +712,8 @@ static void ACLConnectionFail(const bd_addr_t &bdAddr) tipsConnFailMessageView->RefreshNameLabel(bdAddr); } -static void DisconnectBluetoothPause() -{ - int64_t playerCurrentTime; - int64_t playerMusicDuration; - int64_t playerProgressVlaue; - if (PlayersModel::GetInstance()->GetPlayerCtr() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AclStateChangedCallback GetPlayerCtr() == nullptr"); - return; - } - PlayersModel::GetInstance()->GetPlayerCtr()->Pause(); - PlayersModel::GetInstance()->SetPlayButtonState(false); - PlayersModel::GetInstance()->GetPlayerCtr()->GetCurrentTime(playerCurrentTime); - PlayersModel::GetInstance()->GetPlayerCtr()->GetDuration(playerMusicDuration); - if (playerMusicDuration == 0) { // 0:除数保护 - playerProgressVlaue = 100; // 100:进度条系数 - } else { - playerProgressVlaue = (playerCurrentTime * 100) / playerMusicDuration; // 100:百分比系数 - } - PlayersModel::GetInstance()->SetCircleProgress(playerProgressVlaue); - PlayersView *playersView = PlayersView::GetInstance(); - if (playersView != nullptr) { - playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); - if (playersView->GetPlaybackProgress() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AclStateChangedCallback playersView->GetPlaybackProgress() == nullptr"); - return; - } - playersView->GetPlaybackProgress()->SetValue(playerProgressVlaue); - } -} - static void DisconnectedHandle() { - DisconnectBluetoothPause(); BluetoothModel::GetInstance()->SetTagDisconnectView(false); BluetoothDeviceListView *bluetoothDeviceListView = BluetoothDeviceListView::GetInstance(); if (bluetoothDeviceListView == nullptr) { @@ -772,14 +736,8 @@ static void DisconnectedHandle() void BluetoothModel::BtGapAclStateChangedHandle(gap_acl_state_t state, unsigned int reason, const bd_addr_t &bdAddr) { - if ((state == GAP_ACL_STATE_CONNECTED) || (state == GAP_ACL_STATE_LE_CONNECTED)) { - SendMsgToUIService(BT_CONNECTED_TO_UI, 0, NULL, 0); - } else { - SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, NULL, 0); - } - bool tag = BluetoothModel::GetInstance()->IsTagScanDeviceClicked(); - if ((reason == 0x13) || (reason == 0x14) || (reason == 0x15) || (reason == 0x3D) || (reason == 0x08 && tag == false)) { // 连接断开 + if ((reason == 0x13) || (reason == 0x14) || (reason == 0x15) || (reason == 0x3D) || (reason == 0x08 && (!tag))) { // 连接断开 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "The peer end is disconnected."); DisconnectedHandle(); } else if (reason == 0x16) { // 主动断开连接 @@ -799,7 +757,7 @@ void BluetoothModel::BtGapAclStateChangedHandle(gap_acl_state_t state, unsigned if ((state == GAP_ACL_STATE_CONNECTED) || (state == GAP_ACL_STATE_LE_CONNECTED)) { SetLastConnedAddr(&bdAddr); // 将数据存入设备列表 - bool tag = CheckExistConnedList(*onClickBtCaseInfo); + tag = CheckExistConnedList(*onClickBtCaseInfo); if (!tag) { AddConnedDevicesCase(*onClickBtCaseInfo); } @@ -829,8 +787,8 @@ void GapAclStateChangedCallback(const bd_addr_t *bdAddr, gap_acl_state_t state, WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback: Mobile Phone Device"); return; } - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&BluetoothModel::BtGapAclStateChangedHandle, - BluetoothModel::GetInstance(), state, reason, *bdAddr)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&BluetoothModel::BtGapAclStateChangedHandle, BluetoothModel::GetInstance(), state, reason, *bdAddr)); } // 回调:远端设备名称变化 @@ -995,10 +953,10 @@ static void BtGattsRequestWriteCallback(uint8_t serverId, uint16_t connId, gatts static void BtA2dpSnkAcceptTimerStop(void) { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "stop timer\n"); - if (g_a2dp_stream_accept_timer.timer != NULL) { + if (g_a2dp_stream_accept_timer.timer != nullptr) { (void)osal_timer_stop(&g_a2dp_stream_accept_timer); (void)osal_timer_destroy(&g_a2dp_stream_accept_timer); - g_a2dp_stream_accept_timer.timer = NULL; + g_a2dp_stream_accept_timer.timer = nullptr; } WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "stop timer success!\n"); } @@ -1014,7 +972,7 @@ static void BtA2dpSnStartAcceptHandler(unsigned long data) static errcode_t BtA2dpSnkStartAcceptTimer(void) { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "start timer\n"); - if (g_a2dp_stream_accept_timer.timer != NULL) { + if (g_a2dp_stream_accept_timer.timer != nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timer is running"); return ERRCODE_SUCC; } @@ -1175,7 +1133,7 @@ void BtInitCallBacksEx() g_btGattsCallbacks.delete_service_cb = BtGattsServiceDeleteCallback; g_btGattsCallbacks.read_request_cb = BtGattsRequestReadCallback; g_btGattsCallbacks.write_request_cb = BtGattsRequestWriteCallback; - g_btGattsCallbacks.mtu_changed_cb = NULL; + g_btGattsCallbacks.mtu_changed_cb = nullptr; gatts_register_callbacks(&g_btGattsCallbacks); } @@ -1215,7 +1173,7 @@ static uint32_t GenerateUuidFromString(const char *str, uint8_t len, bt_uuid_t * { int slen = (int)strnlen(str, len); bool new_uuid = false; - if (uuid_out == NULL) { + if (uuid_out == nullptr) { return ERRCODE_INVALID_PARAM; } @@ -1272,7 +1230,7 @@ void BtSppServerAccept(uint8_t server_id) { osal_task *task = osal_kthread_create(BtSppServerAcceptTaskBody, (void *)(uintptr_t)server_id, "spp_server_accept_task", BT_SPP_TASK_STACK_SIZE); - if (task == NULL) { + if (task == nullptr) { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "create task fail\n"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp index 86ea73edb..a2c367198 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp @@ -46,7 +46,7 @@ void BluetoothOptionsView::RefreshText(void) { // 刷新状态和文字 BluetoothModel::GetInstance()->SetBtStatus(); - if (BluetoothModel::GetInstance()->GetAclConnected() == true) { + if (BluetoothModel::GetInstance()->GetAclConnected()) { connectStateLabel->SetText("已连接"); optionsOneButton->SetText("断开连接"); } else { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp index 89aa78d87..4935ffbb6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp @@ -143,7 +143,7 @@ void BluetoothPresenter::ClickOptionsOneButton(void) return; } bluetoothMode_->SetBtStatus(); - if (bluetoothMode_->GetAclConnected() == true) { + if (bluetoothMode_->GetAclConnected()) { bluetoothMode_->SetTagConnectNew(false); bluetoothOptionsView->SetBtDisconnect(); view_->ChangeView(BLUETOOTHEOPTIONSVIEW, BLUETOOTHDEVICELISTVIEW); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/MainBluetoothView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/MainBluetoothView.cpp index 7fbbc729b..e55170dfb 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/MainBluetoothView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/MainBluetoothView.cpp @@ -71,7 +71,7 @@ void MainBluetoothView::OnStart() BluetoothModel::GetInstance()->SetTagReturnToDeviceListView(false); int16_t unusedValue = BLUETOOTHEVIEW_MAX; bool ret = bluetoothCaseList.IsEmpty(); - if (ret != true) { + if (!ret) { ChangeView(unusedValue, BLUETOOTHDEVICELISTVIEW); } else { ChangeView(unusedValue, BLUETOOTHEARPHONEVIEW); @@ -135,11 +135,6 @@ bool MainBluetoothView::ChangeBluetoothDeviceListView(int16_t hideView, int16_t } deviceList->RefreshList(); } - BluetoothDeviceListView *bluetoothDeviceListView = BluetoothDeviceListView::GetInstance(); - if (bluetoothDeviceListView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick bluetoothDeviceListView new fail"); - return false; - } bluetoothDeviceListView->RefreshText(); return true; } @@ -185,7 +180,6 @@ bool MainBluetoothView::ChangeTipsConnFailMessageView(int16_t hideView, int16_t container[thisView] = group; RootView::GetInstance()->Add(container[thisView]); } - BluetoothReconnectView *bluetoothReconnectView = BluetoothReconnectView::GetInstance(); if (bluetoothReconnectView == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback bluetoothReconnectView == nullptr"); } else { @@ -312,8 +306,8 @@ bool MainBluetoothView::ChangeBluetoothReconnectView(int16_t hideView, int16_t t RootView::GetInstance()->Add(container[thisView]); } BluetoothModel::GetInstance()->SetTagDisconnectView(true); - BluetoothReconnectView::GetInstance()->RefreshBluetoothNameLabel(); - BluetoothReconnectView::GetInstance()->BtReconnectStart(); + bluetoothReconnectView->RefreshBluetoothNameLabel(); + bluetoothReconnectView->BtReconnectStart(); return true; } @@ -324,12 +318,12 @@ void MainBluetoothView::CorrespondingJump(int16_t hideView) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropView bluetoothModel == nullptr"); return; } - if (bluetoothModel->GetTagReconnectJump() == true) { + if (bluetoothModel->GetTagReconnectJump()) { ChangeView(hideView, BLUETOOTHEOPTIONSVIEW); } else { std::list &bluetoothScanList = BluetoothModel::GetInstance()->GetCase(); bool ret = bluetoothScanList.empty(); - if (ret != true) { + if (!ret) { ChangeView(hideView, BLUETOOTHEARLISTVIEW); } else { ChangeView(hideView, BLUETOOTHEARPHONEVIEW); @@ -348,7 +342,6 @@ void MainBluetoothView::ChangeSettingView() void MainBluetoothView::DropEarPhoneView() { - BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance(); if (bluetoothEarPhoneView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropView bluetoothEarPhoneView == nullptr"); return; @@ -356,7 +349,7 @@ void MainBluetoothView::DropEarPhoneView() bluetoothEarPhoneView->BtAnimatorStop(); bluetoothEarPhoneView->StopBtDiscovery(); bool ret = BluetoothModel::GetInstance()->IsTagReturnToDeviceListView(); - if (ret == true) { + if (ret) { ChangeView(BLUETOOTHEARPHONEVIEW, BLUETOOTHDEVICELISTVIEW); } else { ChangeSettingView(); @@ -374,7 +367,6 @@ void MainBluetoothView::DropEarListView() errcode_t retVal = gap_disconnect_remote_device((const bd_addr_t *)caseInfo->addr); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropEarListView gap_disconnect_remote_device retVal = %d", retVal); } - BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance(); if (bluetoothEarPhoneView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropView bluetoothEarPhoneView == nullptr"); return; @@ -417,14 +409,12 @@ void MainBluetoothView::DropView(UIView& view) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropView::container[BLUETOOTHRECONNECTVIEW]"); CorrespondingJump(BLUETOOTHRECONNECTVIEW); BluetoothModel::GetInstance()->SetTagDisconnectView(false); - BluetoothReconnectView *bluetoothReconnectView = BluetoothReconnectView::GetInstance(); bluetoothReconnectView->BtReconnectStop(); } } void MainBluetoothView::ResetEarListView(int16_t hideView) { - BluetoothEarListView *bluetoothEarListView = BluetoothEarListView::GetInstance(); if (bluetoothEarListView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::ResetEarListView bluetoothEarListView == nullptr"); return; @@ -463,14 +453,14 @@ void MainBluetoothView::ChangeView(int16_t hideView, int16_t showView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::ChangeView %d, %d", hideView, showView); - if (CheckViewParam(hideView, showView) == false) { + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::CheckViewParam failed."); return; } PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) { + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::ChangeView %d %dfailed", showView, hideView); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsConnFailMessageView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsConnFailMessageView.cpp index ffaf77d77..552f968aa 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsConnFailMessageView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsConnFailMessageView.cpp @@ -189,7 +189,7 @@ void TipsConnFailMessageView::RefreshNameLabel(const bd_addr_t &bdAddr) BluetoothCaseInfo caseInfo; (void)memcpy_s(caseInfo.addr, BD_ADDR_LEN, bdAddr.addr, BD_ADDR_LEN); bool ret = BluetoothModel::GetInstance()->FindNameFromList(&caseInfo); - if (ret == false) { + if (!ret) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TipsConnFailMessageView FindNameFromList fail"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsSuccMessageView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsSuccMessageView.cpp index 3dd80a738..9bab50fa8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsSuccMessageView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/TipsSuccMessageView.cpp @@ -149,7 +149,7 @@ void TipsSuccMessageView::RefreshNameLabel(const bd_addr_t &bdAddr) BluetoothCaseInfo caseInfo; (void)memcpy_s(caseInfo.addr, BD_ADDR_LEN, bdAddr.addr, BD_ADDR_LEN); bool ret = BluetoothModel::GetInstance()->FindNameFromList(&caseInfo); - if (ret == false) { + if (!ret) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TipsSuccMessageView FindNameFromList fail"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerItemView.h index a4c09c2ad..4a5a6970d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerItemView.h @@ -24,17 +24,17 @@ public: // @param yCoordinates Y轴坐标值 explicit CallerItemView(int32 yCoordinates); - virtual ~CallerItemView(); + ~CallerItemView() override; - virtual void SetItemInfo(CallLogInfo *itemInfo, char len); - virtual void SetUpChild(); + void SetItemInfo(CallLogInfo *itemInfo, char len); + void SetUpChild(); private: CallerItemView(const CallerItemView &); CallerItemView &operator = (const CallerItemView &); void InitDateMonTime(time_t seconds); - string infoTel; // 电话号码 - string timeDisplay; // 日期显示 + std::string infoTel; // 电话号码 + std::string timeDisplay; // 日期显示 UIImageView icon_; UIImageView icons_; UILabel label_; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h index 4069b2b0b..71448d2df 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h @@ -39,14 +39,12 @@ void UsingPhoneChangeStatusCallback(const PhoneCallInfo *phoneCall); void UsingPhoneErrorCallback(PhoneServiceErrorType type); namespace OHOS { -using namespace std; - class CallerLogModel { public: void InitPhoneService(); static CallerLogModel *GetInstance(void); - string GetPhoneNumber(void); + std::string GetPhoneNumber(void); void SetoperateNumber(const char *number, char number_len); bool GetPhoneStatus(); @@ -64,25 +62,26 @@ public: bool GetMulitplePhoneStatus(); void SetMulitplePhoneStatus(bool status); - string GetDialingStatus(void); + std::string GetDialingStatus(void); void SetDialingStatus(const char *text); - string InitDateHourTime(); - char *DisplayCallDuration(); + std::string InitDateHourTime(); + std::string& DisplayCallDuration(); int CurrCallNum(); bool GetNotifyFlag(void); void SetNotifyFlag(bool flag); + bool IsMulitplePhoneStatus(void); private: CallerLogModel(); CallerLogModel(const CallerLogModel &); CallerLogModel &operator=(const CallerLogModel &); virtual ~CallerLogModel(); - string dialingStatus; // 拨号状态 - string timers; // 时间显示 - string callDuration; // 通话时长 - string phoneNumber; // 电话号码 + std::string dialingStatus; // 拨号状态 + std::string timers; // 时间显示 + std::string callDuration; // 通话时长 + std::string phoneNumber; // 电话号码 bool mulitplePhoneStatus{false}; // 判断是否多路通话界面 bool waitingStatus{false}; // 判断是否等待提醒界面 bool volumeStatus{false}; // 判断是否音量界面 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogPresenter.h index e66e4fb6b..23a86fd69 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogPresenter.h @@ -19,7 +19,7 @@ class CallerLogView; class CallerLogPresenter : public Presenter, public UIView::OnClickListener { public: CallerLogPresenter(); - virtual ~CallerLogPresenter(); + ~CallerLogPresenter() override; void OnStart() override; void OnPause() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogView.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogView.h index adc309cd8..935314bbf 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogView.h @@ -28,9 +28,9 @@ using namespace Graphic; class CallerListOnDragListener : public UIView::OnDragListener { public: CallerListOnDragListener() {} - virtual ~CallerListOnDragListener() {} + ~CallerListOnDragListener() override {} - virtual bool OnDrag(UIView& view, const DragEvent& event) + bool OnDrag(UIView& view, const DragEvent& event) override { UNUSED(view); if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && @@ -45,7 +45,7 @@ public: class CallerUIScrollView : public UIScrollView { public: CallerUIScrollView() {} - virtual ~CallerUIScrollView() {} + ~CallerUIScrollView() {} bool OnDragEvent(const DragEvent& event) override { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerItemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerItemView.cpp index c0acd5464..c63f1851c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerItemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerItemView.cpp @@ -34,7 +34,6 @@ CallerItemView::CallerItemView(int32 yCoordinates) SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); SetTouchable(true); - } CallerItemView::~CallerItemView() @@ -78,11 +77,11 @@ void CallerItemView::InitDateMonTime(time_t seconds) localtime_r(&seconds, &pTM); timeDisplay.erase(); if (pTM.tm_mday < NUM_10) { - string day = "0" + to_string(pTM.tm_mday); - timeDisplay = to_string(pTM.tm_mon) + "/" + day; + std::string day = "0" + std::to_string(pTM.tm_mday); + timeDisplay = std::to_string(pTM.tm_mon) + "/" + day; return; } - timeDisplay = to_string(pTM.tm_mon) + "/" + to_string(pTM.tm_mday); + timeDisplay = std::to_string(pTM.tm_mon) + "/" + std::to_string(pTM.tm_mday); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp index df203e056..b3d48751d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp @@ -7,7 +7,7 @@ #include "CallerLogModel.h" #include "CallerLogView.h" #include "DialingScreenView.h" -#include "MainCallingView.h" +#include "CallingView.h" #include "service_id_define.h" #include "cmsis_os.h" #include "samgr_lite.h" @@ -29,7 +29,7 @@ static int g_isCall{NO_NUMBER_STATUS}; // 电话状态 static PhoneCallInfo callInfo{}; static int g_retNum{0}; // 电话个数 static int g_volumeLocal{0}; // 错误码返回 -osTimerId_t g_startCounting = NULL; // 定时器 +osTimerId_t g_startCounting = nullptr; // 定时器 static constexpr uint64_t MS_ONE_SECONDS = 1000; static PhoneCallInfo callList[MULTI_CALL_MAX_NUME]{}; // 电话优先级标志位 @@ -37,6 +37,8 @@ static int g_firstPriority = NO_NUMBER_STATUS; static int g_secondPriority = NO_NUMBER_STATUS; static int g_thirdPriority = NO_NUMBER_STATUS; static int g_fourthPriority = NO_NUMBER_STATUS; +// 是否为手表接听状态 +static bool g_isWatchCallView = false; static void SetPriorityNumber() { @@ -65,13 +67,13 @@ static void SetPriorityNumber() /* 关闭定时器 */ static void DisableCallingTimer() { - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { osStatus_t ret = osTimerDelete(g_startCounting); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_startCounting = NULL; + g_startCounting = nullptr; g_callTimes = 0; } } @@ -83,8 +85,10 @@ static void StatusReset() CallerLogModel::GetInstance()->SetWaitingStatus(false); DisableCallingTimer(); // If the call is handling in the notification, the slice is not switched - if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) { + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + } else { + g_isWatchCallView = false; } return; } @@ -95,22 +99,17 @@ static void CallTimerCallbackProc(int data) g_callTimes++; if (CallingView::GetInstance() == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance is NULL"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance is nullptr"); return; } if (CallingView::GetInstance()->GetCallingDurationLabel() == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance()->GetCallingDurationLabel is NULL"); - return; - } - - if (CallerLogModel::GetInstance()->DisplayCallDuration() == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] DisplayCallDuration is NULL"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance()->GetCallingDurationLabel is nullptr"); return; } CallingView::GetInstance()->GetCallingDurationLabel()-> - SetText(CallerLogModel::GetInstance()->DisplayCallDuration()); + SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); } static void CallTimerCallback(int data) @@ -121,12 +120,12 @@ static void CallTimerCallback(int data) /* 开启定时器 */ static void InitCallingTimer() { - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallerLogModel::CallerTimer already exists!!"); return; } - g_startCounting = osTimerNew((osTimerFunc_t)CallTimerCallback, osTimerPeriodic, NULL, NULL); - if (g_startCounting == NULL) { + g_startCounting = osTimerNew((osTimerFunc_t)CallTimerCallback, osTimerPeriodic, nullptr, nullptr); + if (g_startCounting == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogModel::CallerTimer osTimerNew failed!!"); return; } @@ -134,13 +133,13 @@ static void InitCallingTimer() osStatus_t retTimer = osTimerStart(g_startCounting, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogModel::CallerTimer osTimerStart failed, ret = %lx!!", retTimer); - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { retTimer = osTimerDelete(g_startCounting); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogModel::osTimerDelete failed, ret = %lx!!", retTimer); return; } - g_startCounting = NULL; + g_startCounting = nullptr; } return; } @@ -204,7 +203,7 @@ static void CallModelResumePlayer(void) usleep(5000); // 延时等待通话释放媒体资源 std::shared_ptr PlayerIntrptListener = OHOS::PlayersModel::GetInstance()->GetPlayerIntrptListener(); - if (PlayerIntrptListener != nullptr && PlayerIntrptListener->IsPaused() == true) { + if (PlayerIntrptListener != nullptr && PlayerIntrptListener->IsPaused()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallModelResumePlayer] ResumePlayer "); PlayerIntrptListener->ResumePlayer(); } @@ -231,6 +230,9 @@ static void ExitMakePhoneSlice(void) } CallerLogModel::GetInstance()->SetCallStatus(false); DisableCallingTimer(); + if (CallerLogModel::GetInstance()->GetNotifyFlag()) { + g_isWatchCallView = false; + } } static void DialingHandle(void) @@ -253,7 +255,7 @@ static void IncomingHandle(void) // 来电等待界面 static void WaitingOpreate() { - if (IsCompleteCallFlow() == false) { + if (!IsCompleteCallFlow()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[UsingPhoneChangeStatusCallback] is not complete call flow"); return; } @@ -261,8 +263,11 @@ static void WaitingOpreate() CallerLogModel::GetInstance()->SetCallStatus(false); CallerLogModel::GetInstance()->SetWaitingStatus(true); // If the call is handling in the notification, the slice is not switched - if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, + PRIORITY_ONE); + } else { + g_isWatchCallView = true; } } @@ -270,7 +275,7 @@ static void WatchActiveHandle(const PhoneCallInfo *phoneCall) { if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || NativeAbility::GetInstance().GetCurSliceId() == VIEW_OFFLINEVOICE || - CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + CallerLogModel::GetInstance()->GetNotifyFlag()) { time_t seconds; time(&seconds); g_callTimes = seconds - phoneCall->activeTime; @@ -278,12 +283,15 @@ static void WatchActiveHandle(const PhoneCallInfo *phoneCall) InitCallingTimer(); CallerLogModel::GetInstance()->SetCallStatus(true); } + if (CallerLogModel::GetInstance()->GetNotifyFlag()) { + g_isWatchCallView = true; + } } static void PhoneActiveHandle(void) { if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || - CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + g_isWatchCallView) { if (GetCurrCallNum() > 1) { g_phoneStatus = PHONE_MULTI_STATUS; if (GetScoConnectState() == HFP_SCO_STATE_DISCONNECTED) { @@ -292,8 +300,10 @@ static void PhoneActiveHandle(void) } TransCallToMobilePhone(); // If the call is handling in the notification, the slice is not switched - if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) { + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); // 退出通话界面,回到主表盘应用 + } else { + g_isWatchCallView = false; } CallModelPostGraphicEvent(CallModelResumePlayer); } @@ -304,7 +314,7 @@ static void PhoneActiveHandle(void) static void OppoActiveHandle(const PhoneCallInfo *phoneCall) { if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || - CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + g_isWatchCallView) { if (GetCurrCallNum() > 1) { g_phoneStatus = PHONE_MULTI_STATUS; return; @@ -322,27 +332,27 @@ bool MulitplePhoneTextReplaces() { DisableCallingTimer(); if (CallingView::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance is nullptr"); return false; } if (CallingView::GetInstance()->GetCallingDurationLabel() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->GetCallingDurationLabel is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->GetCallingDurationLabel is nullptr"); return false; } if (CallingView::GetInstance()->GetCallingDisplayLabel() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->GetCallingDurationLabel is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->GetCallingDurationLabel is nullptr"); return false; } if (MainCallingPresenter::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->MainCallingPresenter is NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->MainCallingPresenter is nullptr"); return false; } - if (MainCallingPresenter::GetInstance()->CallingViewDisplay() == false) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->CallingViewDisplay is NULL"); + if (!MainCallingPresenter::GetInstance()->CallingViewDisplay()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay] GetInstance()->CallingViewDisplay is nullptr"); return false; } @@ -360,10 +370,15 @@ static bool MultiplePhonesViewDisplay() DisableCallingTimer(); CallerLogModel::GetInstance()->SetMulitplePhoneStatus(true); CallerLogModel::GetInstance()->SetCallStatus(true); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, + PRIORITY_ONE); + } else { + g_isWatchCallView = true; + } return true; } - if (MulitplePhoneTextReplaces() == false) { + if (!MulitplePhoneTextReplaces()) { return false; } return true; @@ -375,14 +390,14 @@ static bool MultiplePhonesViewDisplay() static void NonWatchFinishHandle(int laststatus) { if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || - CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + CallerLogModel::GetInstance()->GetNotifyFlag()) { if (GetCurrCallNum() == 0) { StatusReset(); CallModelPostGraphicEvent(CallModelResumePlayer); g_phoneStatus = PHONE_SINGLE_STATUS; } else if (g_phoneStatus == PHONE_MULTI_STATUS) { MultiplePhonesViewDisplay(); - } else if (FindCallListInfoAndSetPriorityNumber() == true) { + } else if (FindCallListInfoAndSetPriorityNumber()) { if (laststatus == HFP_HF_CALL_STATE_ACTIVE || laststatus == HFP_HF_CALL_STATE_HELD) { CallerLogModel::GetInstance()->SetCallStatus(false); CallerLogModel::GetInstance()->SetWaitingStatus(false); @@ -391,11 +406,16 @@ static void NonWatchFinishHandle(int laststatus) CallerLogModel::GetInstance()->SetWaitingStatus(false); } // If the call is handling in the notification, the slice is not switched - if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, + PRIORITY_ONE); + } else { + g_isWatchCallView = true; } } - CallerLogModel::GetInstance()->SetNotifyFlag(false); + if (GetCurrCallNum() == 0) { + CallerLogModel::GetInstance()->SetNotifyFlag(false); + } } if (GetCurrCallNum() == 0) { g_phoneStatus = PHONE_SINGLE_STATUS; @@ -405,16 +425,16 @@ static void NonWatchFinishHandle(int laststatus) static void WatchFinishHandle(void) { if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE || - CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + CallerLogModel::GetInstance()->GetNotifyFlag()) { if (GetCurrCallNum() == 0) { StatusReset(); + CallerLogModel::GetInstance()->SetNotifyFlag(false); } else { StatusReset(); for (int i = GetCurrCallNum(); i > 0; i--) { FinishCall(); } } - CallerLogModel::GetInstance()->SetNotifyFlag(false); } g_phoneStatus = PHONE_SINGLE_STATUS; } @@ -433,17 +453,18 @@ static void ChangeStatusScreendisplay(int lastStatus) return; } } - if (IsCompleteCallFlow() == false) { + if (!IsCompleteCallFlow()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ChangeStatusScreendisplay] is not complete call flow"); return; } - if (MultiplePhonesViewDisplay() == true) { + if (MultiplePhonesViewDisplay()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ChangeStatusScreendisplay] MultiplePhonesViewDisplay"); return; } // If the call is handling in the notification, the slice is not switched - if (g_callOperate != OPERATE_PHONE_ACTIVE && CallerLogModel::GetInstance()->GetNotifyFlag() != true) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + if (g_callOperate != OPERATE_PHONE_ACTIVE && (!CallerLogModel::GetInstance()->GetNotifyFlag())) { + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, + PRIORITY_ONE); } } @@ -522,7 +543,7 @@ static void ScoConnectHandle(void) return; } - if (FindCallListInfoAndSetPriorityNumber() == false) { + if (!FindCallListInfoAndSetPriorityNumber()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ScoConnectHandle FindCallListInfoAndSetPriorityNumber false"); return; } @@ -556,17 +577,20 @@ static void ScoConnectHandle(void) break; } g_isCall = NO_NUMBER_STATUS; - if (IsCompleteCallFlow() == false) { + if (!IsCompleteCallFlow()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectHandle] is not complete call flow"); return; } - if (MultiplePhonesViewDisplay() == true) { + if (MultiplePhonesViewDisplay()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectHandle] MultiplePhonesViewDisplay"); return; } // If the call is handling in the notification, the slice is not switched - if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, + PRIORITY_ONE); + } else { + g_isWatchCallView = true; } } @@ -580,7 +604,7 @@ void UsingPhoneScoStatausCallback(hfp_sco_connect_state_t state) { WEARABLE_LOGD(HILOG_MODULE_AAFWK, "UsingPhoneScoStatausCallback SOC state: %d", state); - if (IsCompleteCallFlow() == false) { + if (!IsCompleteCallFlow()) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[UsingPhoneScoStatausCallback] is not complete call flow"); return; } @@ -640,7 +664,7 @@ void CallerLogModel::InitPhoneService() } /* 表盘底部时间显示 */ -string CallerLogModel::InitDateHourTime(void) +std::string CallerLogModel::InitDateHourTime(void) { struct tm pTM; time_t seconds; @@ -648,21 +672,21 @@ string CallerLogModel::InitDateHourTime(void) localtime_r(&seconds, &pTM); timers.erase(); if (pTM.tm_min < NUM_TEN) { - string min = "0" + to_string(pTM.tm_min); - timers = to_string(pTM.tm_hour) + ":" + min; + std::string min = "0" + std::to_string(pTM.tm_min); + timers = std::to_string(pTM.tm_hour) + ":" + min; return timers; } - timers = to_string(pTM.tm_hour) + ":" + to_string(pTM.tm_min); + timers = std::to_string(pTM.tm_hour) + ":" + std::to_string(pTM.tm_min); return timers; } /* 表盘通话时间显示 */ -char *CallerLogModel::DisplayCallDuration() +std::string& CallerLogModel::DisplayCallDuration() { callDuration.erase(); - string hours; - string minute; - string seconds; + std::string hours; + std::string minute; + std::string seconds; if (g_callTimes >= NUM_TIME_DAY) { g_callTimes = 0; } @@ -670,19 +694,19 @@ char *CallerLogModel::DisplayCallDuration() int min = (g_callTimes % NUM_TIME_HOUR) / NUM_TIME_MIN; int sec = (g_callTimes % NUM_TIME_HOUR) % NUM_TIME_MIN; if (hour >= 0 && hour < NUM_TEN) { - hours = "0" + to_string(hour); + hours = "0" + std::to_string(hour); } else { - hours = to_string(hour); + hours = std::to_string(hour); } if (min >= 0 && min < NUM_TEN) { - minute = "0" + to_string(min); + minute = "0" + std::to_string(min); } else { - minute = to_string(min); + minute = std::to_string(min); } if (sec >= 0 && sec < NUM_TEN) { - seconds = "0" + to_string(sec); + seconds = "0" + std::to_string(sec); } else { - seconds = to_string(sec); + seconds = std::to_string(sec); } if (hour == 0) { @@ -690,7 +714,7 @@ char *CallerLogModel::DisplayCallDuration() } else { callDuration = hours + ":" + minute + ":" + seconds; } - return (char *)callDuration.c_str(); + return callDuration; } /* 拨号与响铃状态显示 */ @@ -700,7 +724,7 @@ void CallerLogModel::SetDialingStatus(const char *text) dialingStatus.append(reinterpret_cast(text)); } -string CallerLogModel::GetDialingStatus(void) +std::string CallerLogModel::GetDialingStatus(void) { return dialingStatus; } @@ -715,6 +739,13 @@ bool CallerLogModel::GetNotifyFlag(void) return notifyFlag; } +// 电话是否为多路状态 +bool CallerLogModel::IsMulitplePhoneStatus(void) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "IsMulitplePhoneStatus phoneStatus:%d", g_phoneStatus); + return g_phoneStatus == PHONE_MULTI_STATUS; +} + /* 是否为多路通话界面 */ void CallerLogModel::SetMulitplePhoneStatus(bool status) { @@ -765,7 +796,7 @@ void CallerLogModel::SetoperateNumber(const char *number, char number_len) phoneNumber.append(reinterpret_cast(number), number_len); } -string CallerLogModel::GetPhoneNumber(void) +std::string CallerLogModel::GetPhoneNumber(void) { return phoneNumber; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogPresenter.cpp index 63d74d946..6311f7b94 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogPresenter.cpp @@ -46,7 +46,7 @@ void CallerLogPresenter::OnPause(void) {} void CallerLogPresenter::OnStop(void) { - if (hintsCounting != NULL) { + if (hintsCounting != nullptr) { if (g_pMainView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogPresenter::CallerLogPresenter g_pMainView nullptr"); return; @@ -65,12 +65,12 @@ void BuletoothHintsCallback(int data) /* 开启定时器 */ void CallerLogPresenter::InitBluetoothHints() { - if (hintsCounting != NULL) { + if (hintsCounting != nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallerLogPresenter::BluetoothHints already exists!"); return; } - hintsCounting = osTimerNew((osTimerFunc_t)BuletoothHintsCallback, osTimerPeriodic, NULL, NULL); - if (hintsCounting == NULL) { + hintsCounting = osTimerNew((osTimerFunc_t)BuletoothHintsCallback, osTimerPeriodic, nullptr, nullptr); + if (hintsCounting == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogPresenter::BluetoothHints osTimerNew failed!"); return; } @@ -78,13 +78,13 @@ void CallerLogPresenter::InitBluetoothHints() osStatus_t retTimer = osTimerStart(hintsCounting, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogPresenter::BluetoothHints osTimerStart failed, ret = %lx!", retTimer); - if (hintsCounting != NULL) { + if (hintsCounting != nullptr) { retTimer = osTimerDelete(hintsCounting); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogPresenter::osTimerDelete failed, ret = %lx!", retTimer); return; } - hintsCounting = NULL; + hintsCounting = nullptr; } return; } @@ -107,13 +107,13 @@ void CallerLogPresenter::BuletoothHintsCallbackProc(int data) /* 关闭定时器 */ void CallerLogPresenter::DisableBluetoothHints() { - if (hintsCounting != NULL) { + if (hintsCounting != nullptr) { osStatus_t ret = osTimerDelete(hintsCounting); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanBuletoothHintsCallback osTimerDelete failed, ret = %lx!!", ret); return; } - hintsCounting = NULL; + hintsCounting = nullptr; } } @@ -147,8 +147,8 @@ bool CallerLogPresenter::OnClick(UIView &view, const ClickEvent &event) } if (0 <= view.GetViewIndex() && view.GetViewIndex() < dataNumber) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "callnumber %s, callnumbernum %d", - (char *)(view_->GetCurrentCallInfo() + dataNumber - view.GetViewIndex() - 1)->tel, - (view_->GetCurrentCallInfo() + dataNumber - view.GetViewIndex() - 1)->telLen); + (char *)(view_->GetCurrentCallInfo() + dataNumber - view.GetViewIndex() - 1)->tel, + (view_->GetCurrentCallInfo() + dataNumber - view.GetViewIndex() - 1)->telLen); CallerLogModel::GetInstance()->SetoperateNumber( (char *)(view_->GetCurrentCallInfo() + dataNumber - view.GetViewIndex() - 1)->tel, diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogView.cpp index ac65dc782..8d4452510 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/src/CallerLogView.cpp @@ -41,7 +41,7 @@ CallerLogView::~CallerLogView() delete imageView; imageView = nullptr; - if (item.IsEmpty() == false) { + if (!item.IsEmpty()) { Vector().Swap(item); } @@ -206,18 +206,18 @@ void CallerLogView::OnStart() View::OnStart(); BaseView::RootView(Color::Black().full); - if (CreateNoDataCallerLogViewGroup() == false) { + if (!CreateNoDataCallerLogViewGroup()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogView::CreateNoDataCallerLogViewGroup error"); return; } RootView::GetInstance()->Add(group); - if (CreateCallerLogViewGroup() == false) { + if (!CreateCallerLogViewGroup()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogView::CreateCallerLogViewGroup error"); return; } - if (InitOrBandOnclickEvent() == false) { + if (!InitOrBandOnclickEvent()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogView::InitOrBandOnclickEvent fail"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/MainClockView.h b/code/sdk/application/wearable/nativeapp/nativeui/clock/include/MainClockView.h index 9f67b8134..861d2dec0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/include/MainClockView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/clock/include/MainClockView.h @@ -9,7 +9,7 @@ #define MAIN_CLOCK_VIEW_H #include -#include +#include #include "View.h" #include "components/ui_label.h" #include "components/root_view.h" @@ -27,14 +27,14 @@ #include "UiConfig.h" #include "components/ui_card_page.h" #include "animator/animator_manager.h" -#include "time.h" +#include #include "sys/time.h" namespace OHOS { class MainClockView : public UICardPage { public: MainClockView(); - virtual ~MainClockView(); + ~MainClockView() override; static MainClockView *GetInstance(void); bool InitView(void); void PreLoad(void) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp index 0b446b997..6fb226b6e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp @@ -11,7 +11,7 @@ #include "wearable_log.h" #include "ui_resource_image.h" #include "common/image_cache_manager.h" -#include +#include namespace OHOS { static MainClockView *g_pMainClockView = nullptr; @@ -64,41 +64,43 @@ MainClockView::MainClockView() MainClockView::~MainClockView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::~MainClockView"); - mainSweepClock->RemoveAll(); - delete curFace; - curFace = nullptr; - delete stepLabel; - stepLabel = nullptr; - delete batteryLabel; - batteryLabel = nullptr; - delete secondHand; - secondHand = nullptr; - delete minuteHand; - minuteHand = nullptr; - delete hourHand; - hourHand = nullptr; - delete weekLabel; - weekLabel = nullptr; - delete heartRateLabel; - heartRateLabel = nullptr; - delete heartRate; - heartRate = nullptr; - delete hand24Hour; - hand24Hour = nullptr; - delete weekDay; - weekDay = nullptr; - delete progress; - progress = nullptr; - delete bigCircle; - bigCircle = nullptr; - delete medCircle; - medCircle = nullptr; - delete smallCircle; - smallCircle = nullptr; - Remove(mainSweepClock); - delete mainSweepClock; - mainSweepClock = nullptr; - g_pMainClockView = nullptr; + if (viewiInitStatus) { + mainSweepClock->RemoveAll(); + delete curFace; + curFace = nullptr; + delete stepLabel; + stepLabel = nullptr; + delete batteryLabel; + batteryLabel = nullptr; + delete secondHand; + secondHand = nullptr; + delete minuteHand; + minuteHand = nullptr; + delete hourHand; + hourHand = nullptr; + delete weekLabel; + weekLabel = nullptr; + delete heartRateLabel; + heartRateLabel = nullptr; + delete heartRate; + heartRate = nullptr; + delete hand24Hour; + hand24Hour = nullptr; + delete weekDay; + weekDay = nullptr; + delete progress; + progress = nullptr; + delete bigCircle; + bigCircle = nullptr; + delete medCircle; + medCircle = nullptr; + delete smallCircle; + smallCircle = nullptr; + Remove(mainSweepClock); + delete mainSweepClock; + mainSweepClock = nullptr; + g_pMainClockView = nullptr; + } } MainClockView *MainClockView::GetInstance(void) @@ -185,7 +187,7 @@ bool MainClockView::InitCenterCircleView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bigCircle new fail"); return false; } - if (LoadClockImage(bigCircle, CLOCK_BIGCIRCLE_IMAGE_PATH) == false) { + if (!LoadClockImage(bigCircle, CLOCK_BIGCIRCLE_IMAGE_PATH)) { return false; } @@ -194,7 +196,7 @@ bool MainClockView::InitCenterCircleView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "medCircle new fail"); return false; } - if (LoadClockImage(medCircle, CLOCK_MEDCIRCLE_IMAGE_PATH) == false) { + if (!LoadClockImage(medCircle, CLOCK_MEDCIRCLE_IMAGE_PATH)) { return false; } @@ -203,7 +205,7 @@ bool MainClockView::InitCenterCircleView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "smallCircle new fail"); return false; } - if (LoadClockImage(smallCircle, CLOCK_CIRCLE_IMAGE_PATH) == false) { + if (!LoadClockImage(smallCircle, CLOCK_CIRCLE_IMAGE_PATH)) { return false; } return true; @@ -216,7 +218,7 @@ bool MainClockView::InitHandView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "secondHand new fail"); return false; } - if (LoadClockImage(secondHand, CLOCK_SECONDHAND) == false) { + if (!LoadClockImage(secondHand, CLOCK_SECONDHAND)) { return false; } @@ -225,7 +227,7 @@ bool MainClockView::InitHandView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "minuteHand new fail"); return false; } - if (LoadClockImage(minuteHand, CLOCK_MINUTEHAND) == false) { + if (!LoadClockImage(minuteHand, CLOCK_MINUTEHAND)) { return false; } hourHand = new Image(); @@ -233,7 +235,7 @@ bool MainClockView::InitHandView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hourHand new fail"); return false; } - if (LoadClockImage(hourHand, CLOCK_HOURHAND) == false) { + if (!LoadClockImage(hourHand, CLOCK_HOURHAND)) { return false; } @@ -242,7 +244,7 @@ bool MainClockView::InitHandView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hand24Hour new fail"); return false; } - if (LoadClockImage(hand24Hour, CLOCK_HAND24HOUR_IMAGE_PATH) == false) { + if (!LoadClockImage(hand24Hour, CLOCK_HAND24HOUR_IMAGE_PATH)) { return false; } return true; @@ -281,16 +283,16 @@ bool MainClockView::InitSweepClock(void) } curFace->SetPosition(0, 0); - if (LoadClockImage(curFace, CLOCK_MAIN_FACE_IMAGE) == false) { + if (!LoadClockImage(curFace, CLOCK_MAIN_FACE_IMAGE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace LoadClockImage CLOCK_MAIN_FACE_IMAGE fail"); return false; } - if (InitLabelView() == false) { + if (!InitLabelView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabelView() fail"); return false; } - if (InitCenterCircleView() == false) { + if (!InitCenterCircleView()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitCenterCircleView() fail"); return false; } @@ -300,7 +302,7 @@ bool MainClockView::InitSweepClock(void) return false; } heartRate->SetPosition(HEARTRATE_POSITION_X, HEARTRATE_POSITION_Y); - if (LoadClockImage(heartRate, CLOCK_HEARTRATE_IMAGE_PATH) == false) { + if (!LoadClockImage(heartRate, CLOCK_HEARTRATE_IMAGE_PATH)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "heartRate LoadClockImage CLOCK_HEARTRATE_IMAGE_PATH fail"); return false; } @@ -311,7 +313,7 @@ bool MainClockView::InitSweepClock(void) return false; } progress->SetPosition(PROGRESS_POSITION_X, PROGRESS_POSITION_Y); - if (LoadClockImage(progress, CLOCK_PROGRESS_IMAGE_PATH) == false) { + if (!LoadClockImage(progress, CLOCK_PROGRESS_IMAGE_PATH)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress LoadClockImage CLOCK_PROGRESS_IMAGE_PATH fail"); return false; } @@ -323,7 +325,7 @@ bool MainClockView::InitSweepClock(void) return false; } weekDay->SetPosition(WEEKDAY_POSITION_X, WEEKDAY_POSITION_Y); - if (LoadClockImage(weekDay, CLOCK_THURSDAY_IMAGE_PATH) == false) { + if (!LoadClockImage(weekDay, CLOCK_THURSDAY_IMAGE_PATH)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "weekDay LoadClockImage CLOCK_THURSDAY_IMAGE_PATH fail"); return false; } @@ -352,7 +354,7 @@ bool MainClockView::InitView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainSweepClock new fail"); return false; } - if (InitSweepClock() == false) { + if (!InitSweepClock()) { return false; } @@ -422,7 +424,7 @@ void MainClockView::InitDateTime(void) void MainClockView::UpdateTime(void) { struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); uint64_t second = tv.tv_sec; uint64_t uSecond = tv.tv_usec; uint64_t minute = second / MIN_TO_HOUR; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassCalibrationView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassCalibrationView.h index 084a63013..704e60d96 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassCalibrationView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassCalibrationView.h @@ -18,7 +18,7 @@ namespace OHOS { class CompassCalibrationView : public AppGroupView { public: CompassCalibrationView(); - virtual ~CompassCalibrationView(); + ~CompassCalibrationView() override; bool CreateUIViewGroup(void); static CompassCalibrationView *GetInstance(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassControlView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassControlView.h index 1e20fe6d1..3dc43f20f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassControlView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassControlView.h @@ -19,7 +19,7 @@ namespace OHOS { class CompassControlView : public UICardPage { public: CompassControlView(); - virtual ~CompassControlView(); + ~CompassControlView() override; bool InitView(void); void PreLoad(void) override; void UnLoad(void) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassModel.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassModel.h index 0913d97b2..d15e900ac 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassModel.h @@ -8,7 +8,7 @@ #ifndef COMPASS_MODEL_H #define COMPASS_MODEL_H -#include "stdint.h" +#include namespace OHOS { class CompassModel { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassView.h index 72597b580..97cd957d1 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassView.h @@ -23,7 +23,7 @@ static constexpr float VIEW_CENTERS = 227; class CompassView : public AppGroupView { public: CompassView(); - virtual ~CompassView(); + ~CompassView() override; void DirectionSetText(const char *text, const char *angle); static CompassView *GetInstance(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h index 0fc70617c..f3f835770 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h @@ -23,16 +23,16 @@ class MainCompassPresenter : public Presenter, public CompassPresen public ModelListenerSample, public UIView::OnDragListener { public: MainCompassPresenter(); - virtual ~MainCompassPresenter(); + ~MainCompassPresenter() override; - virtual void OnStart() override; - virtual void OnPause() override; - virtual void OnResume() override; - virtual void OnStop() override; + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; static MainCompassPresenter *GetInstance(void); bool OnDrag(UIView& view, const DragEvent& event) override; - virtual void Notify() override; + void Notify() override; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassView.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassView.h index fe78abe5f..b3bacb97c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassView.h @@ -28,7 +28,7 @@ class CompassView; class MainCompassView : public View { public: MainCompassView(); - virtual ~MainCompassView(); + ~MainCompassView() override; void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassCalibrationView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassCalibrationView.cpp index 568a6558b..390c0ae82 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassCalibrationView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassCalibrationView.cpp @@ -113,7 +113,7 @@ bool CompassCalibrationView::InitView(void *caller) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CompassCalibrationView InitView %p", caller); bool ret = CreateUIViewGroup(); - if (ret == false) { + if (!ret) { return false; } SetDraggable(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp index da7f8f46f..546dd33f8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp @@ -17,7 +17,9 @@ CompassControlView::CompassControlView() CompassControlView::~CompassControlView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CompassControlView::~CompassControlView()"); - ClearAll(); + if (viewiInitStatus) { + ClearAll(); + } } void CompassControlView::ClearAll(void) @@ -41,7 +43,7 @@ bool CompassControlView::InitView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CompassCalibrationView::new compassCalibrationView fail"); return false; } - if (compassCalibrationView->CreateUIViewGroup() == false) { + if (!compassCalibrationView->CreateUIViewGroup()) { return false; } @@ -50,7 +52,7 @@ bool CompassControlView::InitView(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CompassView::new compassView fail"); return false; } - if (compassView->InitPage() == false) { + if (!compassView->InitPage()) { return false; } Add(compassView); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassModel.cpp index 1675aa814..e9ff3f5c8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassModel.cpp @@ -7,7 +7,7 @@ #include #include "CompassModel.h" -#include "time.h" +#include #ifdef __cplusplus extern "C" { @@ -62,7 +62,7 @@ time_t CompassModel::GetLastTime(void) time_t CompassModel::GetCurrentTime(void) { struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); return tv.tv_sec; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassPresenter.cpp index 48aa8bcda..4a48b5458 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassPresenter.cpp @@ -145,15 +145,15 @@ void CompassPresenter::DetermineToRotate(void) return; } bool initState = CompassView::GetInstance()->GetInitViewState(); - if (initState == true) { - if (initDisplayStatus == true) { + if (initState) { + if (initDisplayStatus) { currentRotateAngle = CompassModel::GetInstance()->GetDisplayAngle(); lastRotateAngle = currentRotateAngle; CompassView::GetInstance()->CompassStartRotate(lastRotateAngle); DisplayAngleDir(currentRotateAngle); initDisplayStatus = false; } else { - if (getAngleStatus == false) { + if (!getAngleStatus) { currentRotateAngle = CompassModel::GetInstance()->GetDisplayAngle(); } InScopeRotate(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp index 5f4b901a5..5b3bbc27d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassView.cpp @@ -94,7 +94,7 @@ bool CompassView::InitCompassImage(void) } backGround->SetPosition(0, 0); - if (LoadCompassImage(backGround, COMPASS_COMPASS) == false) { + if (!LoadCompassImage(backGround, COMPASS_COMPASS)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], triangulation load fail", __LINE__); return false; } @@ -105,7 +105,7 @@ bool CompassView::InitCompassImage(void) return false; } rotateShaft->SetPosition(POINT_CENTER_IMAGE_X, POINT_CENTER_IMAGE_Y); - if (LoadCompassImage(rotateShaft, COMPASS_ROTATE_CENTER_IMAGE) == false) { + if (!LoadCompassImage(rotateShaft, COMPASS_ROTATE_CENTER_IMAGE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d], rotateShaft load fail", __LINE__); return false; } @@ -116,7 +116,7 @@ bool CompassView::InitCompassImage(void) return false; } triangulation->SetPosition(TRIANGULATION_X, TRIANGULATION_Y); - if (LoadCompassImage(triangulation, COMPASS_CORRESPONDENCE_DEGREE) == false) { + if (!LoadCompassImage(triangulation, COMPASS_CORRESPONDENCE_DEGREE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "triangulation load fail"); return false; } @@ -125,7 +125,7 @@ bool CompassView::InitCompassImage(void) bool CompassView::InitPage(void) { - if (InitCompassImage() == false) { + if (!InitCompassImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitCompassImage fail"); ClearAll(); return false; @@ -176,7 +176,7 @@ bool CompassView::InitPage(void) bool CompassView::InitView(void *caller) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CompassView InitView %p", caller); - if (InitPage() == false) { + if (!InitPage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitPage fail"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/include/ConnectPhonePresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/include/ConnectPhonePresenter.h index 0c73d6fbc..2920e0667 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/include/ConnectPhonePresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/include/ConnectPhonePresenter.h @@ -47,7 +47,6 @@ public: private: char watchName[32]; - }; } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectOpenView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectOpenView.cpp index b68888a45..47ad06a7b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectOpenView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectOpenView.cpp @@ -49,7 +49,7 @@ void ConnectOpenView::ShowUpBackView() watchNameLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); // 40:font data watchNameLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE); watchNameLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, - UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER); + UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER); group->Add(watchNameLabel); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp index 67014059c..06a0bce1e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp @@ -81,7 +81,7 @@ void ConnectPhonePresenter::RemovePair() if (connedDevicesNum != 0) { gap_paired_device_info_t *devInfo = (gap_paired_device_info_t *)malloc(sizeof(gap_paired_device_info_t) * connedDevicesNum); - if (devInfo == NULL) { + if (devInfo == nullptr) { return; } ret = gap_get_paired_devices_list(devInfo, (int *)&connedDevicesNum); @@ -105,12 +105,12 @@ void ConnectPhonePresenter::ConfirmOnClick() (void)sprintf_s(watchName, sizeof(watchName), "Watch%x", ((uint32_t)uapi_tcxo_get_us() & 0xFFFF)); ret = bluetooth_set_local_name((unsigned char*)watchName, strlen((char*)watchName) + 1); - if (ret == false) { + if (!ret) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectPhonePresenter: bt SetLocalName ret = 0x%x", ret); } ret = gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE, 60); // start scan - if (ret == false) { + if (!ret) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectPhonePresenter bt gap_br_set_bt_scan_mode ret = 0x%x", ret); } #ifndef SUPPORT_ALIPAY_SEC @@ -121,7 +121,6 @@ void ConnectPhonePresenter::ConfirmOnClick() bool ConnectPhonePresenter::OnDrag(UIView& view, const DragEvent& event) { std::string viewId = view.GetViewId(); - if ((viewId == CONNECT_SELECT_VIEW) || (viewId == CONNECT_OPEN_VIEW)) { if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectPhonePresenter::OnDrag"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhoneView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhoneView.cpp index 0738e4b5c..3ad8e6669 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhoneView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhoneView.cpp @@ -132,14 +132,14 @@ void ConnectPhoneView::ChangeView(int16_t hideView, int16_t showView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ConnectPhoneView::ChangeView %d, %d", hideView, showView); - if (CheckViewParam(hideView, showView) == false) { + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectPhoneView::CheckViewParam failed."); return; } PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) { + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ConnectPhoneView::ChangeView %d %dfailed", showView, hideView); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartModel.h b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartModel.h index e073bcecb..3891ec79a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartModel.h @@ -1,7 +1,7 @@ #ifndef HEART_MODEL_H #define HEART_MODEL_H -#include +#include #include "broadcast_feature.h" #include "broadcast_service.h" #include "samgr_lite.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartRateView.h b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartRateView.h index 37615cb5d..11d02cc14 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartRateView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/include/HeartRateView.h @@ -35,7 +35,7 @@ namespace OHOS { class HeartRateView : public UICardPage { public: HeartRateView(); - virtual ~HeartRateView(); + ~HeartRateView() override; static HeartRateView *GetInstance(void); bool InitView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp index e8b771345..852053b9b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartModel.cpp @@ -24,20 +24,20 @@ using namespace OHOS; static void Notify(void *args, const Topic topic, Request* request); Subscriber heartSubscirber = { - .identity = NULL, - .args = NULL, + .identity = nullptr, + .args = nullptr, .Notify = Notify, }; void HeartDataSubscribeTopic(Topic topic) { - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { return; } int ret = broadcastApi->SubscribeTopic((IUnknown *)broadcastApi, topic, &heartSubscirber); @@ -47,13 +47,13 @@ void HeartDataSubscribeTopic(Topic topic) void HearDatatUnsubscribeTopic(Topic topic) { - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { return; } broadcastApi->UnsubscribeTopic((IUnknown *)broadcastApi, topic, &heartSubscirber); @@ -64,19 +64,19 @@ static void Notify(void *args, const Topic topic, Request* request) { UNUSED(args); UNUSED(topic); - if (request == NULL) { + if (request == nullptr) { return; } if (request->msgId == TOPIC_EVENT_HEARTRATE_UPDATA) { HeartDatas *heartInfo = (HeartDatas*)malloc(sizeof(HeartDatas)); - if (heartInfo == NULL) { + if (heartInfo == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[Notify] malloc fail"); } int rets = memcpy_s(heartInfo, sizeof(HeartDatas), (HeartInfo*)request->data, request->len); if (rets != EOK) { free(heartInfo); - heartInfo = NULL; + heartInfo = nullptr; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s heartRateData fail! ret = %d", rets); return; } @@ -84,7 +84,7 @@ static void Notify(void *args, const Topic topic, Request* request) OHOS::HeartModel::GetInstance()->HeartRatePros(heartInfo); free(heartInfo); - heartInfo = NULL; + heartInfo = nullptr; } if (request->msgId == TOPIC_EVENT_NEXTDAY_UPDATE) { OHOS::HeartModel::GetInstance()->ClearHeartData(); @@ -338,7 +338,7 @@ void HeartModel::RefreshHeartRateScreen(uint16_t perSec, uint16_t rest, uint16_t } if (MainViewSample::GetInstance() != nullptr && HeartRateView::GetInstance() != nullptr) { - if (MainViewSample::GetInstance()->GetHorCurrentPage() == HEART_RATE) { + if (MainViewSample::GetInstance()->GetHorCurrentCard() == HEART_RATE) { HeartRateView::GetInstance()->SetHeartRateData(rateData, sizeof(Point) * len); HeartRateView::GetInstance()->RefreshElectrocardiogram(); HeartRateView::GetInstance()->RefreshHeartRatePerSec(perSec); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartRateView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartRateView.cpp index 5ece7d2b7..8c9643544 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartRateView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/heartrate/src/HeartRateView.cpp @@ -161,7 +161,7 @@ HeartRateView::HeartRateView() HeartRateView::~HeartRateView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HeartRateView::~HeartRateView"); - if (viewiInitStatus == true) { + if (viewiInitStatus) { int32_t i; RemoveAll(); delete imageViewCoordinate; @@ -208,22 +208,18 @@ HeartRateView *HeartRateView::GetInstance(void) int32_t HeartRateView::InitHeartRateData(void) // 初始化心率数据,将存放心率数据的有效字节设置为无效值 { - int32_t ret; - heartRateData[0].x = INVALID_HEART_VALUE; heartRateData[0].y = INVALID_HEART_VALUE; - ret = memset_s(heartRateData, sizeof(Point) * HEART_AVE_NUM, INVALID_HEART_VALUE, sizeof(Point) * HEART_AVE_NUM); + int32_t ret = memset_s(heartRateData, sizeof(Point) * HEART_AVE_NUM, INVALID_HEART_VALUE, sizeof(Point) * HEART_AVE_NUM); if (ret != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[InitHeartRateData] memset_s heartRateData fail! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[InitHeartRateData] memset_s heartRateData fail! ret = %d", ret); } return ret; } int32_t HeartRateView::SetHeartRateData(Point *rateData, uint32 rateDataSize) { - int ret; - if (rateData == nullptr) { return OHOS_FAILURE; } @@ -232,35 +228,32 @@ int32_t HeartRateView::SetHeartRateData(Point *rateData, uint32 rateDataSize) rateDataSize = sizeof(Point) * HEART_AVE_NUM; } InitHeartRateData(); - ret = memcpy_s(heartRateData, sizeof(Point) * HEART_AVE_NUM, rateData, rateDataSize); + int32_t ret = memcpy_s(heartRateData, sizeof(Point) * HEART_AVE_NUM, rateData, rateDataSize); if (ret != EOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[HeartRateDataProc] memcpy_s heartRateData fail! ret = %d", ret); return OHOS_FAILURE; } - return OHOS_SUCCESS; } int32_t HeartRateView::HeartRateDataProc(void) { - int32_t i, ret; Point datain[HEART_AVE_NUM]; - - ret = memcpy_s(datain, sizeof(Point) * HEART_AVE_NUM, heartRateData, sizeof(Point) * HEART_AVE_NUM); + int32_t ret = memcpy_s(datain, sizeof(Point) * HEART_AVE_NUM, heartRateData, sizeof(Point) * HEART_AVE_NUM); if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[HeartRateDataProc] memcpy_s rateDataTmp fail! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[HeartRateDataProc] memcpy_s rateDataTmp fail! ret = %d", ret); return OHOS_FAILURE; } ret = memset_s(rateDataTmp, sizeof(Point) * HEART_AVE_NUM, INVALID_HEART_VALUE, sizeof(Point) * HEART_AVE_NUM); // 替换为无效值 if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[HeartRateDataProc] memset_s rateDataTmp fail! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[HeartRateDataProc] memset_s rateDataTmp fail! ret = %d", ret); return OHOS_FAILURE; } dataNume = 0; - for (i = 0; i < HEART_AVE_NUM; i++) { + for (int32_t i = 0; i < HEART_AVE_NUM; i++) { if (datain[i].x >= 0 && datain[i].x < HEART_AVE_NUM && datain[i].y > 0 && datain[i].y <= HEART_RATE_LIMIT_UPPER) { rateDataTmp[dataNume].x = datain[i].x + COORDINATE_VALUE; @@ -390,7 +383,6 @@ void HeartRateView::InsertTopAndBottomRateImage(void) void HeartRateView::UpdataTopAndBottomRate(void) { - uint16_t bottom, top; if (chart == nullptr) { return; } @@ -427,7 +419,7 @@ void HeartRateView::UpdataTopAndBottomRate(void) dataTopAndbottom->SetBottomPointStyle(pointStyle); chart->Invalidate(); - bottom = dataTopAndbottom->GetValleyData() * ACT_IMAGE_COOR_VALUE / ACT_IMAGE_COOR_PIXELS; + uint16_t bottom = dataTopAndbottom->GetValleyData() * ACT_IMAGE_COOR_VALUE / ACT_IMAGE_COOR_PIXELS; // 最高心跳 dataTopAndbottom->EnableTopPoint(true); pointStyle.fillColor = Color::Red(); @@ -437,7 +429,7 @@ void HeartRateView::UpdataTopAndBottomRate(void) dataTopAndbottom->SetTopPointStyle(pointStyle); chart->Invalidate(); - top = dataTopAndbottom->GetPeakData() * ACT_IMAGE_COOR_VALUE / ACT_IMAGE_COOR_PIXELS; + uint16_t top = dataTopAndbottom->GetPeakData() * ACT_IMAGE_COOR_VALUE / ACT_IMAGE_COOR_PIXELS; if (top <= HEART_RATE_LIMIT_UPPER) { maxRate = (maxRate >= top) ? maxRate : top; } @@ -615,13 +607,13 @@ void HeartRateView::InitRefreshInterface(void) Point *rateData = HeartModel::GetInstance()->GetAveHeartRate(); uint16_t len = HeartModel::GetInstance()->GetAveHeartRateCount(); SetHeartRateData(rateData, sizeof(Point) * len); - uint16_t maxRate = HeartModel::GetInstance()->GetHeartRateMax(); - uint16_t minRate = HeartModel::GetInstance()->GetHeartRateMin(); + uint16_t maxHeartRate = HeartModel::GetInstance()->GetHeartRateMax(); + uint16_t minHeartRate = HeartModel::GetInstance()->GetHeartRateMin(); RefreshElectrocardiogram(); - if (maxRate > 0 && maxRate < HEART_RATE_LIMIT_UPPER) { + if (maxHeartRate > 0 && maxHeartRate < HEART_RATE_LIMIT_UPPER) { RefreshHeartRateMax(HeartModel::GetInstance()->GetHeartRateMax()); } - if (minRate > 0 && minRate < HEART_RATE_LIMIT_UPPER) { + if (minHeartRate > 0 && minHeartRate < HEART_RATE_LIMIT_UPPER) { RefreshHeartRateMin(HeartModel::GetInstance()->GetHeartRateMin()); } } @@ -629,17 +621,12 @@ void HeartRateView::InitRefreshInterface(void) // 刷新心率曲线 void HeartRateView::RefreshElectrocardiogram(void) { - int32_t ret; - uint16_t tmp, count; - Point *rate = nullptr; - Point modPoint; - - ret = HeartRateDataProc(); + int32_t ret = HeartRateDataProc(); if (ret != OHOS_SUCCESS) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartRateView::[RefreshElectrocardiogram()] fail"); return; } - rate = rateDataTmp; + Point *rate = rateDataTmp; if (chart == nullptr) { return; @@ -649,7 +636,7 @@ void HeartRateView::RefreshElectrocardiogram(void) currIndex = HEART_AVE_NUM; } if (dataNume > currIndex) { - tmp = dataNume - currIndex; + uint16_t tmp = dataNume - currIndex; if (currIndex > 0) { rate += (currIndex - 1); tmp += 1; @@ -658,10 +645,11 @@ void HeartRateView::RefreshElectrocardiogram(void) currIndex = dataNume; } else if (dataNume == currIndex) { // 当前点平均心率刷新 if (serialIndex > 0 && serialIndex <= HEART_AVE_NUM && dataSerial[serialIndex - 1] != nullptr) { + Point modPoint; modPoint.x = rate[currIndex - 1].x; modPoint.y = rate[currIndex - 1].y; - count = dataSerial[serialIndex - 1]->GetDataCount(); + uint16_t count = dataSerial[serialIndex - 1]->GetDataCount(); dataSerial[serialIndex - 1]->ModifyPoint(count - 1, modPoint); chart->Invalidate(); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/CustomizationView.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/CustomizationView.h index 557cde567..6ad618fbd 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/CustomizationView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/CustomizationView.h @@ -20,7 +20,7 @@ namespace OHOS { class IndoorWalkUIScrollView : public UIScrollView { public: IndoorWalkUIScrollView() {} - virtual ~IndoorWalkUIScrollView() {} + ~IndoorWalkUIScrollView() override {} bool OnDragEvent(const DragEvent& event) override { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkModel.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkModel.h index 679802aec..2afd4efd3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkModel.h @@ -7,7 +7,7 @@ #ifndef INDOORWALK_MODEL_H #define INDOORWALK_MODEL_H -#include "stdio.h" +#include #include "string" #include "gfx_utils/list.h" #include "components/ui_label.h" @@ -24,46 +24,45 @@ void DisableIndoorWalkTimer(); #endif namespace OHOS { -using namespace std; class IndoorWalkModel { public: ~IndoorWalkModel(); static IndoorWalkModel *GetInstance(void); - string GetConnectionView(); + std::string GetConnectionView(); void SetConnectionView(const char* id); void SetTextLableFirstTop(const char *lable, const char *lableUnit); - string GetTextLableFirstTop(); - string GetTextLableUnitFirstTop(); + std::string GetTextLableFirstTop(); + std::string GetTextLableUnitFirstTop(); void SetTextLableFirstLeft(const char *lable, const char *lableUnit); - string GetTextLableFirstLeft(); - string GetTextLableUnitFirstLeft(); + std::string GetTextLableFirstLeft(); + std::string GetTextLableUnitFirstLeft(); void SetTextLableFirstRight(const char *lable, const char *lableUnit); - string GetTextLableFirstRight(); - string GetTextLableUnitFirstRight(); + std::string GetTextLableFirstRight(); + std::string GetTextLableUnitFirstRight(); void SetTextLableFirstBottom(const char *lable, const char *lableUnit); - string GetTextLableFirstBottom(); - string GetTextLableUnitFirstBottom(); + std::string GetTextLableFirstBottom(); + std::string GetTextLableUnitFirstBottom(); void SetTextLableSecondTop(const char *lable, const char *lableUnit); - string GetTextLableSecondTop(); - string GetTextLableUnitSecondTop(); + std::string GetTextLableSecondTop(); + std::string GetTextLableUnitSecondTop(); void SetTextLableSecondLeft(const char *lable, const char *lableUnit); - string GetTextLableSecondLeft(); - string GetTextLableUnitSecondLeft(); + std::string GetTextLableSecondLeft(); + std::string GetTextLableUnitSecondLeft(); void SetTextLableSecondRight(const char *lable, const char *lableUnit); - string GetTextLableSecondRight(); - string GetTextLableUnitSecondRight(); + std::string GetTextLableSecondRight(); + std::string GetTextLableUnitSecondRight(); void SetTextLableThirdTop(const char *lable, const char *lableUnit); - string GetTextLableThirdTop(); - string GetTextLableUnitThirdTop(); + std::string GetTextLableThirdTop(); + std::string GetTextLableUnitThirdTop(); void SetTextLableThirdBottom(const char *lable, const char *lableUnit); - string GetTextLableThirdBottom(); - string GetTextLableUnitThirdBottom(); + std::string GetTextLableThirdBottom(); + std::string GetTextLableUnitThirdBottom(); void SetTextLableFourth(const char *lable, const char *lableUnit); - string GetTextLableFourth(); - string GetTextLableUnitFourth(); + std::string GetTextLableFourth(); + std::string GetTextLableUnitFourth(); void SetInitialStep(const uint32_t &value); int GetInitialStep(); - char *DisplayMotionDuration(); + std::string& DisplayMotionDuration(); bool OpenDistancesSensor(void); bool CloseDistancesSensor(void); void SetInitialDistances(const float &value); @@ -73,32 +72,32 @@ public: private: IndoorWalkModel(); - string selectPropertiesID; + std::string selectPropertiesID; uint32_t initialStep; float initialDistances; float currentDistances; - string textLableFirstTop{"00:00:00"}; - string textLableUnitFirstTop{"时间"}; - string textLableFirstLeft{"00:00:00"}; - string textLableUnitFirstLeft{"时间"}; - string textLableFirstRight{"00:00:00"}; - string textLableUnitFirstRight{"时间"}; - string textLableFirstBottom{"00:00:00"}; - string textLableUnitFirstBottom{"时间"}; - string textLableSecondTop{"00:00:00"}; - string textLableUnitSecondTop{"时间"}; - string textLableSecondLeft{"00:00:00"}; - string textLableUnitSecondLeft{"时间"}; - string textLableSecondRight{"00:00:00"}; - string textLableUnitSecondRight{"时间"}; - string textLableThirdTop{"00:00:00"}; - string textLableUnitThirdTop{"时间"}; - string textLableThirdBottom{"00:00:00"}; - string textLableUnitThirdBottom{"时间"}; - string textLableFourth{"00:00:00"}; - string textLableUnitFourth{"时间"}; + std::string textLableFirstTop{"00:00:00"}; + std::string textLableUnitFirstTop{"时间"}; + std::string textLableFirstLeft{"00:00:00"}; + std::string textLableUnitFirstLeft{"时间"}; + std::string textLableFirstRight{"00:00:00"}; + std::string textLableUnitFirstRight{"时间"}; + std::string textLableFirstBottom{"00:00:00"}; + std::string textLableUnitFirstBottom{"时间"}; + std::string textLableSecondTop{"00:00:00"}; + std::string textLableUnitSecondTop{"时间"}; + std::string textLableSecondLeft{"00:00:00"}; + std::string textLableUnitSecondLeft{"时间"}; + std::string textLableSecondRight{"00:00:00"}; + std::string textLableUnitSecondRight{"时间"}; + std::string textLableThirdTop{"00:00:00"}; + std::string textLableUnitThirdTop{"时间"}; + std::string textLableThirdBottom{"00:00:00"}; + std::string textLableUnitThirdBottom{"时间"}; + std::string textLableFourth{"00:00:00"}; + std::string textLableUnitFourth{"时间"}; - string motionDuration; + std::string motionDuration; }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkMotionView.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkMotionView.h index 4a4ebaa49..40e0e4502 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkMotionView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkMotionView.h @@ -48,9 +48,6 @@ private: MotionPageFifth *motionPageFifth{nullptr}; AppGroupView *recordCard[MAX_MOTIONPAGE]{nullptr}; bool pageStatus[MAX_MOTIONPAGE]{false}; - UISwipeView::OnSwipeListener* motionclickListener{nullptr}; - UIView::OnDragListener* motionDragListener{nullptr}; - AppGroupView *GreatePage(int32_t MotionPageId); }; } // namespace OHOS #endif // INDOORWALK_MOTION_VIEW_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h index b3f4c7df5..20755a196 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h @@ -66,7 +66,7 @@ class IndoorWalkPresenter : public Presenter, public UISwipeView public UIView::OnDragListener { public: IndoorWalkPresenter(); - virtual ~IndoorWalkPresenter(); + ~IndoorWalkPresenter() override; static IndoorWalkPresenter *GetInstance(); void OnStart() override; void OnPause() override; @@ -75,7 +75,7 @@ public: bool OnClick(UIView& view, const ClickEvent& event) override; bool OnDrag(UIView& view, const DragEvent& event) override; bool OnLongPress(UIView& view, const LongPressEvent& event) override; - virtual void OnSwipe(UISwipeView& view) override; + void OnSwipe(UISwipeView& view) override; void HidePageImageView(void); void ModifiesProperties(const char* id, const char *lable, const char *lableUnit); void ModifiesPageFirstTop(const char *lable, const char *lableUnit); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFifth.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFifth.h index 745f0fce0..61f676d58 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFifth.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFifth.h @@ -19,7 +19,7 @@ namespace OHOS { class MotionPageFifth : public AppGroupView { public: MotionPageFifth(); - virtual ~MotionPageFifth(); + ~MotionPageFifth() override; static MotionPageFifth *GetInstance(void); bool InitView(void *caller) override; bool InitPageFifthLableView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFirst.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFirst.h index 8b0c1d188..78259fe71 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFirst.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFirst.h @@ -19,7 +19,7 @@ namespace OHOS { class MotionPageFirst : public AppGroupView { public: MotionPageFirst(); - virtual ~MotionPageFirst(); + ~MotionPageFirst() override; static MotionPageFirst *GetInstance(void); bool InitView(void *caller) override; bool InitPageFirstImageView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFourth.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFourth.h index f141257d1..34dc3168f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFourth.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageFourth.h @@ -19,7 +19,7 @@ namespace OHOS { class MotionPageFourth : public AppGroupView { public: MotionPageFourth(); - virtual ~MotionPageFourth(); + ~MotionPageFourth() override; static MotionPageFourth *GetInstance(void); bool InitView(void *caller) override; bool InitPageFourthLableView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageSecond.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageSecond.h index 005178aa7..2297aa614 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageSecond.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageSecond.h @@ -19,7 +19,7 @@ namespace OHOS { class MotionPageSecond : public AppGroupView { public: MotionPageSecond(); - virtual ~MotionPageSecond(); + ~MotionPageSecond() override; static MotionPageSecond *GetInstance(void); bool InitView(void *caller) override; bool InitPageSecondImageView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageThird.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageThird.h index de2e51743..e26fcc392 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageThird.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/MotionPageThird.h @@ -19,7 +19,7 @@ namespace OHOS { class MotionPageThird : public AppGroupView { public: MotionPageThird(); - virtual ~MotionPageThird(); + ~MotionPageThird() override; static MotionPageThird *GetInstance(void); bool InitView(void *caller) override; bool InitPageThirdImageView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp index 1762a8b00..4e3e637ea 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp @@ -353,8 +353,8 @@ UIViewGroup *CustomizationView::InitPropertiesView() group->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); group->SetHorizontalScrollState(false); - if ((ShowUpTitleLabel() == false) || (InitTimeView() == false) || (InitDistancesView() == false) || - (InitHeartView() == false) || (InitSpeedView() == false) || (InitStepsView() == false)) { + if ((!ShowUpTitleLabel()) || (!InitTimeView()) || (!InitDistancesView()) || + (!InitHeartView()) || (!InitSpeedView()) || (!InitStepsView())) { return nullptr; } group->Add(lable); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp index ae3972416..bcaa1e761 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp @@ -104,12 +104,12 @@ UIViewGroup *IndoorWalkEndView::InitShowUpView() group->SetWidth(HORIZONTAL_RESOLUTION); group->SetHeight(VERTICAL_RESOLUTION); ret = ShowUpTitleLabel(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(titleLabel); ret = CreateUIButton(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(cancelButton); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkModel.cpp index ebfb885d6..a89626e86 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkModel.cpp @@ -17,7 +17,7 @@ typedef struct { } fa_treadmill_distance_result; static int g_motionTimes{0}; -osTimerId_t g_startCounting = NULL; // 定时器 +osTimerId_t g_startCounting = nullptr; // 定时器 static constexpr uint64_t MS_ONE_SECONDS = 1000; static constexpr uint16_t NUM_TEN = 10; static constexpr uint16_t NUM_TIME_MIN = 60; @@ -40,7 +40,7 @@ void IndoorWalkModel::SetConnectionView(const char* id) selectPropertiesID = id; } -string IndoorWalkModel::GetConnectionView() +std::string IndoorWalkModel::GetConnectionView() { return selectPropertiesID; } @@ -51,12 +51,12 @@ void IndoorWalkModel::SetTextLableFirstTop(const char *lable, const char *lableU textLableUnitFirstTop = lableUnit; } -string IndoorWalkModel::GetTextLableFirstTop() +std::string IndoorWalkModel::GetTextLableFirstTop() { return textLableFirstTop; } -string IndoorWalkModel::GetTextLableUnitFirstTop() +std::string IndoorWalkModel::GetTextLableUnitFirstTop() { return textLableUnitFirstTop; } @@ -67,12 +67,12 @@ void IndoorWalkModel::SetTextLableFirstLeft(const char *lable, const char *lable textLableUnitFirstLeft = lableUnit; } -string IndoorWalkModel::GetTextLableFirstLeft() +std::string IndoorWalkModel::GetTextLableFirstLeft() { return textLableFirstLeft; } -string IndoorWalkModel::GetTextLableUnitFirstLeft() +std::string IndoorWalkModel::GetTextLableUnitFirstLeft() { return textLableUnitFirstLeft; } @@ -83,12 +83,12 @@ void IndoorWalkModel::SetTextLableFirstRight(const char *lable, const char *labl textLableUnitFirstRight = lableUnit; } -string IndoorWalkModel::GetTextLableFirstRight() +std::string IndoorWalkModel::GetTextLableFirstRight() { return textLableFirstRight; } -string IndoorWalkModel::GetTextLableUnitFirstRight() +std::string IndoorWalkModel::GetTextLableUnitFirstRight() { return textLableUnitFirstRight; } @@ -99,12 +99,12 @@ void IndoorWalkModel::SetTextLableFirstBottom(const char *lable, const char *lab textLableUnitFirstBottom = lableUnit; } -string IndoorWalkModel::GetTextLableFirstBottom() +std::string IndoorWalkModel::GetTextLableFirstBottom() { return textLableFirstBottom; } -string IndoorWalkModel::GetTextLableUnitFirstBottom() +std::string IndoorWalkModel::GetTextLableUnitFirstBottom() { return textLableUnitFirstBottom; } @@ -115,12 +115,12 @@ void IndoorWalkModel::SetTextLableSecondTop(const char *lable, const char *lable textLableUnitSecondTop = lableUnit; } -string IndoorWalkModel::GetTextLableSecondTop() +std::string IndoorWalkModel::GetTextLableSecondTop() { return textLableSecondTop; } -string IndoorWalkModel::GetTextLableUnitSecondTop() +std::string IndoorWalkModel::GetTextLableUnitSecondTop() { return textLableUnitSecondTop; } @@ -131,12 +131,12 @@ void IndoorWalkModel::SetTextLableSecondLeft(const char *lable, const char *labl textLableUnitSecondLeft = lableUnit; } -string IndoorWalkModel::GetTextLableSecondLeft() +std::string IndoorWalkModel::GetTextLableSecondLeft() { return textLableSecondLeft; } -string IndoorWalkModel::GetTextLableUnitSecondLeft() +std::string IndoorWalkModel::GetTextLableUnitSecondLeft() { return textLableUnitSecondLeft; } @@ -147,12 +147,12 @@ void IndoorWalkModel::SetTextLableSecondRight(const char *lable, const char *lab textLableUnitSecondRight = lableUnit; } -string IndoorWalkModel::GetTextLableSecondRight() +std::string IndoorWalkModel::GetTextLableSecondRight() { return textLableSecondRight; } -string IndoorWalkModel::GetTextLableUnitSecondRight() +std::string IndoorWalkModel::GetTextLableUnitSecondRight() { return textLableUnitSecondRight; } @@ -163,12 +163,12 @@ void IndoorWalkModel::SetTextLableThirdTop(const char *lable, const char *lableU textLableUnitThirdTop = lableUnit; } -string IndoorWalkModel::GetTextLableThirdTop() +std::string IndoorWalkModel::GetTextLableThirdTop() { return textLableThirdTop; } -string IndoorWalkModel::GetTextLableUnitThirdTop() +std::string IndoorWalkModel::GetTextLableUnitThirdTop() { return textLableUnitThirdTop; } @@ -179,12 +179,12 @@ void IndoorWalkModel::SetTextLableThirdBottom(const char *lable, const char *lab textLableUnitThirdBottom = lableUnit; } -string IndoorWalkModel::GetTextLableThirdBottom() +std::string IndoorWalkModel::GetTextLableThirdBottom() { return textLableThirdBottom; } -string IndoorWalkModel::GetTextLableUnitThirdBottom() +std::string IndoorWalkModel::GetTextLableUnitThirdBottom() { return textLableUnitThirdBottom; } @@ -195,12 +195,12 @@ void IndoorWalkModel::SetTextLableFourth(const char *lable, const char *lableUni textLableUnitFourth = lableUnit; } -string IndoorWalkModel::GetTextLableFourth() +std::string IndoorWalkModel::GetTextLableFourth() { return textLableFourth; } -string IndoorWalkModel::GetTextLableUnitFourth() +std::string IndoorWalkModel::GetTextLableUnitFourth() { return textLableUnitFourth; } @@ -236,12 +236,12 @@ float IndoorWalkModel::GetCurrentDistances() } /* 时间显示 */ -char *IndoorWalkModel::DisplayMotionDuration() +std::string& IndoorWalkModel::DisplayMotionDuration() { motionDuration.erase(); - string hours; - string minute; - string seconds; + std::string hours; + std::string minute; + std::string seconds; if (g_motionTimes >= NUM_TIME_DAY) { g_motionTimes = 0; } @@ -249,23 +249,23 @@ char *IndoorWalkModel::DisplayMotionDuration() int min = (g_motionTimes % NUM_TIME_HOUR) / NUM_TIME_MIN; int sec = (g_motionTimes % NUM_TIME_HOUR) % NUM_TIME_MIN; if (hour >= 0 && hour < NUM_TEN) { - hours = "0" + to_string(hour); + hours = "0" + std::to_string(hour); } else { - hours = to_string(hour); + hours = std::to_string(hour); } if (min >= 0 && min < NUM_TEN) { - minute = "0" + to_string(min); + minute = "0" + std::to_string(min); } else { - minute = to_string(min); + minute = std::to_string(min); } if (sec >= 0 && sec < NUM_TEN) { - seconds = "0" + to_string(sec); + seconds = "0" + std::to_string(sec); } else { - seconds = to_string(sec); + seconds = std::to_string(sec); } motionDuration = hours + ":" + minute + ":" + seconds; - return (char *)motionDuration.c_str(); + return motionDuration; } #ifdef __cplusplus @@ -287,12 +287,12 @@ void IndoorWalkTimerCallback() /* 开启定时器 */ void InitIndoorWalkTimer() { - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer already exists!!"); return; } - g_startCounting = osTimerNew((osTimerFunc_t)IndoorWalkTimerCallback, osTimerPeriodic, NULL, NULL); - if (g_startCounting == NULL) { + g_startCounting = osTimerNew((osTimerFunc_t)IndoorWalkTimerCallback, osTimerPeriodic, nullptr, nullptr); + if (g_startCounting == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer osTimerNew failed!!"); return; } @@ -300,13 +300,13 @@ void InitIndoorWalkTimer() osStatus_t retTimer = osTimerStart(g_startCounting, tick); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::IndoorWalkTimer osTimerStart failed, ret = %lx!!", retTimer); - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { retTimer = osTimerDelete(g_startCounting); if (retTimer != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::osTimerDelete failed, ret = %lx!!", retTimer); return; } - g_startCounting = NULL; + g_startCounting = nullptr; } return; } @@ -314,13 +314,13 @@ void InitIndoorWalkTimer() /* 关闭定时器 */ void DisableIndoorWalkTimer() { - if (g_startCounting != NULL) { + if (g_startCounting != nullptr) { osStatus_t ret = osTimerDelete(g_startCounting); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); return; } - g_startCounting = NULL; + g_startCounting = nullptr; g_motionTimes = 0; } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp index 866e42f86..a3350f28e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp @@ -127,7 +127,7 @@ UIViewGroup *IndoorWalkMotionView::WalkMotionViewInit(void) walkMotionList->SetAnimatorTime(50); // 50:animator drag time(ms) for (uint16_t i = 0; i < maxPage; i++) { - recordCard[i] = GreatePage(i); + recordCard[i] = (this->*(g_pageMapper[i].func))(); if (recordCard[i] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkMotionView:: recordCard %d error", i); return nullptr; @@ -170,20 +170,4 @@ void IndoorWalkMotionView::InitialStep() IndoorWalkModel::GetInstance()->SetInitialStep(stepValue); } -AppGroupView *IndoorWalkMotionView::GreatePage(int32_t StreamId) -{ - uint16_t i; - AppGroupView *view = nullptr; - int32_t MotionPageId = ScreenModels::GetInstance()->GetCardPage(StreamId); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GreatePage MotionPageId:%d", MotionPageId); - for (i = 0; i < sizeof(g_pageMapper) / sizeof(g_pageMapper[0]); i++) { - if (g_pageMapper[i].id == MotionPageId) { - view = (this->*(g_pageMapper[i].func))(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GreatePage view:%p", view); - return view; - } - } - return nullptr; -} - } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp index c0d8cf3a7..6f3efcd2b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp @@ -247,15 +247,15 @@ UIViewGroup *IndoorWalkPreparedView::InitShowUpView() walkButton->SetViewId(WALK_BUTTON); group->Add(walkButton); ret = InitBatteryView(); - if (ret == false) { + if (!ret) { return nullptr; } ret = InitHeartbeatView(); - if (ret == false) { + if (!ret) { return nullptr; } ret = InitLableVIew(); - if (ret == false) { + if (!ret) { return nullptr; } UIView::OnDragListener *indoorWalkDragListener = (UIView::OnDragListener *)OHOS::IndoorWalkPresenter::GetInstance(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp index 6e33f8f50..6f817f0c0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp @@ -15,7 +15,7 @@ namespace OHOS { static IndoorWalkPresenter *g_pIndoorWalkPresenter = nullptr; -static string g_distancesChar; +static std::string g_distancesChar; static constexpr uint16_t CENTERED_Y = 192; static constexpr uint32_t CONVERSION_NUM = 100000; static constexpr uint16_t STEP_CHAR_NUM = 255; @@ -78,35 +78,36 @@ void IndoorWalkPresenter::WalkButtonOnClick(const char* id) void IndoorWalkPresenter::TimeViewOnClick(const char* id) { UNUSED(id); - string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); - ModifiesProperties(selectPropertiesid.c_str(), IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); + std::string duration = IndoorWalkModel::GetInstance()->DisplayMotionDuration(); + ModifiesProperties(selectPropertiesid.c_str(), duration.c_str(), "时间"); } void IndoorWalkPresenter::DistancesViewOnClick(const char* id) { UNUSED(id); - string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); + std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); ModifiesProperties(selectPropertiesid.c_str(), "0.00", "距离(km)"); } void IndoorWalkPresenter::HeartViewOnClick(const char* id) { UNUSED(id); - string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); + std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); ModifiesProperties(selectPropertiesid.c_str(), "--", "心率(bpm)"); } void IndoorWalkPresenter::SpeedViewOnClick(const char* id) { UNUSED(id); - string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); + std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); ModifiesProperties(selectPropertiesid.c_str(), "0.00", "速度(km/h)"); } void IndoorWalkPresenter::StepsViewOnClick(const char* id) { UNUSED(id); - string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); + std::string selectPropertiesid = IndoorWalkModel::GetInstance()->GetConnectionView(); char stepChar[STEP_CHAR_NUM] = {0}; InitStepsValue(stepChar); ModifiesProperties(selectPropertiesid.c_str(), stepChar, "步数(steps)"); @@ -419,71 +420,61 @@ static const IndoorWalkPropertiesMapper g_pWalkPropertiesMapper[] = { void IndoorWalkPresenter::SetPropertiesPageFirstTop() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageFirstLeft() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageFirstRight() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageFirstBottom() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageSecondTop() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageSecondLeft() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageSecondRight() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageThirdTop() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageThirdBottom() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom(); SetCustomizationState(lableUnit.c_str()); } void IndoorWalkPresenter::SetPropertiesPageFourth() { - string lableUnit; - lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth(); + std::string lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth(); SetCustomizationState(lableUnit.c_str()); } @@ -550,39 +541,36 @@ void IndoorWalkPresenter::SetCustomizationState(const char *lableUnit) void IndoorWalkPresenter::ModifiesTime() { - if (IndoorWalkModel::GetInstance()->DisplayMotionDuration() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkModel::GetInstance()->DisplayMotionDuration() nullptr"); - return; - } + std::string duration = IndoorWalkModel::GetInstance()->DisplayMotionDuration(); if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop().c_str(), "时间") == 0) { - ModifiesPageFirstTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageFirstTop(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft().c_str(), "时间") == 0) { - ModifiesPageFirstLeft(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageFirstLeft(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight().c_str(), "时间") == 0) { - ModifiesPageFirstRight(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageFirstRight(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom().c_str(), "时间") == 0) { - ModifiesPageFirstBottom(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageFirstBottom(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop().c_str(), "时间") == 0) { - ModifiesPageSecondTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageSecondTop(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft().c_str(), "时间") == 0) { - ModifiesPageSecondLeft(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageSecondLeft(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight().c_str(), "时间") == 0) { - ModifiesPageSecondRight(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageSecondRight(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop().c_str(), "时间") == 0) { - ModifiesPageThirdTop(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageThirdTop(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom().c_str(), "时间") == 0) { - ModifiesPageThirdBottom(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageThirdBottom(duration.c_str(), "时间"); } if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFourth().c_str(), "时间") == 0) { - ModifiesPageFourth(IndoorWalkModel::GetInstance()->DisplayMotionDuration(), "时间"); + ModifiesPageFourth(duration.c_str(), "时间"); } } @@ -591,7 +579,7 @@ void IndoorWalkPresenter::ModifiesDistances(float value) g_distancesChar.erase(); value -= IndoorWalkModel::GetInstance()->GetInitialDistances(); value /= CONVERSION_NUM; - string g_distancesChar = to_string(value).substr(0, to_string(value).find(".") + 3); + g_distancesChar = std::to_string(value).substr(0, std::to_string(value).find(".") + 3); if (strcmp(IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop().c_str(), "距离(km)") == 0) { ModifiesPageFirstTop(g_distancesChar.c_str(), "距离(km)"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkView.cpp index 23bd60810..9c7e85fb4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkView.cpp @@ -183,14 +183,14 @@ void IndoorWalkView::ChangeView(int16_t hideView, int16_t showView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::ChangeView %d, %d", hideView, showView); - if (CheckViewParam(hideView, showView) == false) { + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::CheckViewParam failed."); return; } PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) { + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "IndoorWalkView::ChangeView %d %dfailed", showView, hideView); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFifth.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFifth.cpp index 8a5be9cf7..a3da2bbde 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFifth.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFifth.cpp @@ -83,13 +83,12 @@ bool MotionPageFifth::InitPageFifthImageView() bool MotionPageFifth::InitView(void *caller) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MotionPageFifth InitView %p", caller); - bool ret; - ret = InitPageFifthLableView(); - if (ret == false) { + bool ret = InitPageFifthLableView(); + if (!ret) { return false; } ret = InitPageFifthImageView(); - if (ret == false) { + if (!ret) { return false; } return true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFirst.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFirst.cpp index 02dbf591f..c16b941d5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFirst.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFirst.cpp @@ -107,8 +107,8 @@ void MotionPageFirst::SetUnitLableTemplate(UILabel *label) bool MotionPageFirst::InitPageFirstLableTopView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableFirstTop(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstTop(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -139,8 +139,8 @@ bool MotionPageFirst::InitPageFirstLableTopView() bool MotionPageFirst::InitPageFirstLableLeftView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableFirstLeft(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstLeft(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -172,8 +172,8 @@ bool MotionPageFirst::InitPageFirstLableLeftView() bool MotionPageFirst::InitPageFirstLableRightView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableFirstRight(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstRight(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -204,8 +204,8 @@ bool MotionPageFirst::InitPageFirstLableRightView() bool MotionPageFirst::InitPageFirstLableBottomView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableFirstBottom(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFirstBottom(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -357,23 +357,23 @@ bool MotionPageFirst::InitView(void *caller) backGroundFirst->SetSrc(PNG_WALK_BACK_GROUND); Add(backGroundFirst); ret = InitPageFirstLableTopView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageFirstLableLeftView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageFirstLableRightView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageFirstLableBottomView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageFirstImageView(); - if (ret == false) { + if (!ret) { return false; } HideInitPageFirstImageView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFourth.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFourth.cpp index 4c7274096..a43ab8ff6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFourth.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageFourth.cpp @@ -44,8 +44,8 @@ MotionPageFourth *MotionPageFourth::GetInstance() bool MotionPageFourth::InitPageFourthLableView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableFourth(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitFourth(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -153,16 +153,15 @@ bool MotionPageFourth::InitView(void *caller) backGroundFourth->SetSrc(PNG_WALK_BACK_GROUND); Add(backGroundFourth); ret = InitPageFourthLableView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageFourthImageView(); - if (ret == false) { + if (!ret) { return false; } HideInitPageFourthImageView(); SetTouchable(true); return true; - } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageSecond.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageSecond.cpp index 545fb6947..34e136df5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageSecond.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageSecond.cpp @@ -81,8 +81,8 @@ void MotionPageSecond::SetLableTemplate(UILabel *label) bool MotionPageSecond::InitPageSecondLableTopView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableSecondTop(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondTop(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -114,8 +114,8 @@ bool MotionPageSecond::InitPageSecondLableTopView() bool MotionPageSecond::InitPageSecondLableLeftView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableSecondLeft(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondLeft(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -147,8 +147,8 @@ bool MotionPageSecond::InitPageSecondLableLeftView() bool MotionPageSecond::InitPageSecondLableRightView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableSecondRight(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitSecondRight(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -292,24 +292,23 @@ bool MotionPageSecond::InitView(void *caller) backGroundSecond->SetSrc(PNG_WALK_BACK_GROUND); Add(backGroundSecond); ret = InitPageSecondLableTopView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageSecondLableLeftView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageSecondLableRightView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageSecondImageView(); - if (ret == false) { + if (!ret) { return false; } HideInitPageSecondImageView(); SetTouchable(true); return true; - } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageThird.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageThird.cpp index a0898bac4..668d78cd4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageThird.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/MotionPageThird.cpp @@ -71,8 +71,8 @@ void MotionPageThird::SetLableTemplate(UILabel *label) bool MotionPageThird::InitPageThirdLableTopView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableThirdTop(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdTop(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -115,8 +115,8 @@ void MotionPageThird::SetUnitLableTemplate(UILabel *label) bool MotionPageThird::InitPageThirdLableBottomView() { - string lable; - string lableUnit; + std::string lable; + std::string lableUnit; lable = IndoorWalkModel::GetInstance()->GetTextLableThirdBottom(); lableUnit = IndoorWalkModel::GetInstance()->GetTextLableUnitThirdBottom(); if (strcmp(lableUnit.c_str(), "步数(steps)") == 0) { @@ -227,15 +227,15 @@ bool MotionPageThird::InitView(void *caller) backGroundThird->SetSrc(PNG_WALK_BACK_GROUND); Add(backGroundThird); ret = InitPageThirdLableTopView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageThirdLableBottomView(); - if (ret == false) { + if (!ret) { return false; } ret = InitPageThirdImageView(); - if (ret == false) { + if (!ret) { return false; } HideInitPageThirdImageView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/key/include/KeyInputListener.h b/code/sdk/application/wearable/nativeapp/nativeui/key/include/KeyInputListener.h index b9724f9dd..e7ca76f00 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/key/include/KeyInputListener.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/key/include/KeyInputListener.h @@ -25,8 +25,8 @@ private: void OnKeyPress(void); void OnKeyLongPress(const KeyEvent& event); void OnKeyRelease(const KeyEvent& event); - void CallVolumeDipSwitchControl(uint8_t status); - void PlayerVolumeDipSwitchControl(uint8_t model); + void CallVolumeDipSwitchControl(VolumeChangeStatus status); + void PlayerVolumeDipSwitchControl(VolumeChangeStatus status); private: int32 pressFlag{0}; int32 longPressFlag{0}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp index 310fcf3a2..bce8f5d5c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp @@ -19,23 +19,10 @@ #include "MainCallingPresenter.h" namespace OHOS { -static bool IsCallingNotify() -{ - uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if (NotificationManager::GetInstance()->hasNotifyShowing() == true && - (notifyId == TOPIC_EVENT_HFP_INCOMMING || - notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || - notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH)) { - return true; - } else { - return false; - } -} - static bool IsNotifyCallStatus() { uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if (NotificationManager::GetInstance()->hasNotifyShowing() == true && + if (NotificationManager::GetInstance()->HasNotifyShowing() && (notifyId == TOPIC_EVENT_HFP_WATCH_ACTIVE || notifyId == TOPIC_EVENT_HFP_PHONE_TO_WATCH)) { return true; @@ -47,7 +34,7 @@ static bool IsNotifyCallStatus() static void PressAlarmNotify() { uint16_t notifyId = NotificationManager::GetInstance()->GetShowingNotifyId(); - if (NotificationManager::GetInstance()->hasNotifyShowing() == true && notifyId == TOPIC_EVENT_ALARM_RING) { + if (NotificationManager::GetInstance()->HasNotifyShowing() && notifyId == TOPIC_EVENT_ALARM_RING) { AlarmClockModel::GetInstance()->AlarmGetClockNum(); AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); NotificationManager::GetInstance()->StopNotify(); @@ -74,27 +61,27 @@ void KeyInputListener::OnKeyLongPress(const KeyEvent& event) return; } -void KeyInputListener::CallVolumeDipSwitchControl(uint8_t model) +void KeyInputListener::CallVolumeDipSwitchControl(VolumeChangeStatus status) { if (MainCallingPresenter::GetInstance() != nullptr && CallerLogModel::GetInstance()->GetCallStatus()) { - if (CallerLogModel::GetInstance()->GetVolumeScreenStatus() == true) { + if (CallerLogModel::GetInstance()->GetVolumeScreenStatus()) { volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); if (volumeSliderEventListener == nullptr) { return; } - volumeSliderEventListener->ChangeVolume(model); + volumeSliderEventListener->ChangeVolume(status); } else { MainCallingPresenter::GetInstance()->HonrsViewChange(); CallerLogModel::GetInstance()->SetVolumeScreenStatus(true); } } - if (IsNotifyCallStatus() == true) { - if (NotificationManager::GetInstance()->GetVolumeScreenStatus() == true) { + if (IsNotifyCallStatus()) { + if (NotificationManager::GetInstance()->GetVolumeScreenStatus()) { volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); if (volumeSliderEventListener == nullptr) { return; } - volumeSliderEventListener->ChangeVolume(model); + volumeSliderEventListener->ChangeVolume(status); } else { HonrsViewChange(); NotificationManager::GetInstance()->SetVolumeScreenStatus(true); @@ -108,26 +95,28 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event) uint16 keyID = event.GetKeyId(); if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) { // 电源按键 if (longPressFlag == 0 && pressFlag == 1) { // 短按电源键 - if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片 + if (currentViewId == VIEW_MAEKPHONE_SAMPLE || + NotificationManager::GetInstance()->GetWatchCallStatus()) { // 音量卡片 // 音量+ - CallVolumeDipSwitchControl(1); + CallVolumeDipSwitchControl(VOLUMEUP); } else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘 PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_ZOOM); } else { PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 if (!MainViewSample::GetInstance()->IsMainClockPage()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面 MainViewSample::GetInstance()->SwitchToClockPage(); } else { - NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_ZOOM); } } } } else if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC)) { // 功能按键 if (longPressFlag == 0 && pressFlag == 1) { // 短按功能键 - if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片 + if (currentViewId == VIEW_MAEKPHONE_SAMPLE || + NotificationManager::GetInstance()->GetWatchCallStatus()) { // 音量卡片 // 音量- - CallVolumeDipSwitchControl(0); + CallVolumeDipSwitchControl(VOLUMEDOWN); } else { // 切换到用户配置的快捷卡片 } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/AppGroupView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/AppGroupView.h index 88e838133..08529bdb5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/AppGroupView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/AppGroupView.h @@ -20,7 +20,7 @@ public: { SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); } - virtual ~AppGroupView() {} + ~AppGroupView() override {} virtual bool InitView(void *caller)=0; bool initViewStatus{false}; }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h similarity index 86% rename from code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.h rename to code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h index 2cd1305d3..dc737236f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinParser.h @@ -22,11 +22,11 @@ #include "components/ui_abstract_progress.h" namespace OHOS { - class DialBinParser { public: static DialBinParser* GetInstance(void); bool UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group); + bool GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info); protected: int32_t ParseDialHeader(FILE* file); @@ -41,6 +41,7 @@ protected: int32_t ParserDialArcProgress(FILE* fp); int32_t ParserDialVideo(FILE* fp); int32_t ParserDialClick(FILE* fp); + int32_t ParserDialKaleidoscope(FILE* fp); private: DialBinParser(); @@ -48,13 +49,13 @@ private: void* MallocAndReadBuf(FILE* file, uint32_t readSize); bool SetProgressType(FILE* fp, UIAbstractProgress* view, DialProgressType data); - static constexpr uint8_t DIAL_BIN_PARSER_FUNC_NUM = 11; + static constexpr uint8_t DIAL_BIN_PARSER_FUNC_NUM = 12; // 12: func max value int32_t (DialBinParser::*funcArray_[DIAL_BIN_PARSER_FUNC_NUM])(FILE*); DialViewGroup* dialGroup_ = nullptr; std::string file_; - uint32_t dirId_ = 0xfef << 20; + uint32_t dirId_ = 0xfef << 20; // 20: offset uint32_t imageOffset_ = 0; }; } -#endif \ No newline at end of file +#endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinTypes.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinTypes.h similarity index 77% rename from code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinTypes.h rename to code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinTypes.h index aadaf2181..366c1bec6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinTypes.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/DialBinTypes.h @@ -19,6 +19,18 @@ #include "components/ui_canvas_ext.h" namespace OHOS { +static constexpr uint8_t DIAL_NAME_MAX_LEN = 16; +static constexpr uint8_t DIAL_VERSION_MAX_LEN = 16; +static constexpr uint8_t DIAL_DESCRIPTION_MAX_LEN = 128; +static constexpr uint8_t DIAL_DIGITALIMG_IMG_MAX_NUM = 10; + +struct DialPreviewInfo { + char dialName[DIAL_NAME_MAX_LEN]; + char description[DIAL_DESCRIPTION_MAX_LEN]; + uint32_t imgId; + uint32_t offset; +}; + struct DialRect { int16_t x; int16_t y; @@ -27,12 +39,12 @@ struct DialRect { }; struct DialHeader { - char dialName[16]; + char dialName[DIAL_NAME_MAX_LEN]; int16_t width; int16_t height; - char version[16]; + char version[DIAL_VERSION_MAX_LEN]; uint16_t previewImgId; - char description[128]; + char description[DIAL_DESCRIPTION_MAX_LEN]; uint32_t imageOffset; uint8_t freq; uint8_t dialViewCount; @@ -69,12 +81,11 @@ struct DialOptionImg { uint8_t count; }; -constexpr uint8_t DIGITALIMG_IMG_MAX_NUM = 10; struct DialDigitalImg { uint8_t alignType : 4; uint8_t integerLength : 4; uint8_t decimalPrecision; - uint16_t imgIds[DIGITALIMG_IMG_MAX_NUM]; + uint16_t imgIds[DIAL_DIGITALIMG_IMG_MAX_NUM]; int16_t signImgId; int16_t decimalPointImgId; uint16_t space; @@ -144,6 +155,7 @@ struct DialVideo { DialRect rect; uint32_t offset; Color32 colorKey; + uint32_t imgId; }; struct DialClick { @@ -154,5 +166,11 @@ struct DialClick { char bundleName[64]; }; }; + +struct DialKaleidoscope { + uint16_t imgId; + float crownRotateStep; + float animatorRotateStep; +}; } #endif // GRAPHIC_LITE_DIAL_BIN_TYPE_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/HealthModel.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/HealthModel.h index e23ad4610..dac9ce9b3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/HealthModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/HealthModel.h @@ -16,7 +16,7 @@ #ifndef HEALTH_MODEL_H #define HEALTH_MODEL_H -#include "stdio.h" +#include #include "gfx_utils/list.h" #include "los_mux.h" #include "UiServersMsg.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainModel.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainModel.h new file mode 100644 index 000000000..1d82fac85 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainModel.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: MainModel.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef MAIN_MODEL_H +#define MAIN_MODEL_H + +#include +#include "UiConfig.h" + +namespace OHOS { + typedef struct { + CardId id; + const char *cardImg; + } CardInfo; + + typedef struct { + DialId id; + const char *dialName; + const char *dialImg; + uint8_t freq; + } DialInfo; + + typedef struct { + uint8_t dialFlag; + uint8_t dialId; + std::string dialFullName; + } DialSetting; + + class MainModel { + public: + static MainModel &GetInstance(void); + void InitCardSettings(void); + uint8_t GetCardSettingCount(void); + CardId *GetCardSettings(void); + void DeleteCardSetting(uint8_t index); + void AddCardSetting(uint8_t index); + const CardInfo *GetCardInfo(CardId card) const; + const DialInfo *GetDialInfo(DialId dial) const; + void AddDialSetting(const DialSetting &setting); + void InitDialSettings(void); + DialSetting &GetDialSetting(); + bool IsFromSetCardView(void) const; + void SetFromSetCardView(bool isFrom); + void SetFromCardId(uint8_t cardId); + uint8_t GetFromCardId(void); + private: + void InitDialSettingDefault(void); + MainModel(); + MainModel(const MainModel &); + MainModel &operator=(const MainModel &); + virtual ~MainModel(); + + CardId cardSettings[CARD_SETTING_COUNT_MAX] = { MAX_CARD }; + uint8_t cardSettingCount{0}; + DialSetting dialSetting; + bool isFromSetCardView{false}; + uint8_t fromCardId{MAX_CARD}; + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h index 1feb8bcaa..ba4860287 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h @@ -14,16 +14,15 @@ #include "KeyInputListener.h" #include "drag_event.h" #include "MainViewSample.h" +#include "MainModel.h" #include "components/ui_swipe_view.h" #include "components/ui_view.h" -#include "CompassView.h" -#include "CompassPresenter.h" +#include "MainCompassView.h" +#include "MainCompassPresenter.h" #include "PlayersView.h" #include "HeartRateView.h" #include "swipe_effect/zoom_effect.h" -using namespace std; - namespace OHOS { static constexpr const char *MAIN_CLICK_WEATHER = "mainclickweather"; static constexpr const char *MAIN_CLICK_ACTIVITY = "mainclickactivity"; @@ -41,36 +40,35 @@ constexpr uint16_t HORIZONTAL_STATUS = 0; class MainViewSample; class MainPresenterSample : public Presenter, public ModelListenerSample, public UIView::OnClickListener, public UISwipeView::OnSwipeListener, - public UISwipeView, public CompassPresenter { + public UIView::OnLongPressListener, public UISwipeView, public CompassPresenter { public: MainPresenterSample(); - virtual ~MainPresenterSample(); + ~MainPresenterSample() override; static MainPresenterSample *GetInstance(void); void OnStart() override; void OnPause() override; void OnResume() override; void OnStop() override; - virtual void Notify() override; + void Notify() override; bool OnClick(UIView& view, const ClickEvent& event) override; - virtual void OnSwipe(UISwipeView& view) override; + bool OnLongPress(UIView& view, const LongPressEvent& event) override; + void OnSwipe(UISwipeView& view) override; void SetPage(int8_t id); - void SetTaskPeroid(int page); + void SetTaskPeroid(CardId cardId); void setCallback(ZoomEffect* callback) { callback_ = callback; } - void SetDialPath(std::string filePath) - { - filePath_ = filePath; - } - - std::string GetDialPath() - { - return filePath_; - } - + void InitCardSettings(void); + uint8_t GetCardSettingCount(void); + CardId *GetCardSettings(void); + void InitDialSettings(void); + DialSetting& GetDialSetting(); + bool IsFromSetCardView(void) const; + void SetFromSetCardView(bool isFrom); + uint8_t GetFromCardId(void); private: void ProcessDataNotify(void); void SetCircleProgress(void); @@ -82,7 +80,6 @@ private: int64_t playerMusicDuration_{0}; int64_t playerProgressValue_{0}; bool isCompassSensorOpened_{false}; - std::string filePath_; }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h index 7c0e55d26..f09fd1382 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h @@ -21,24 +21,22 @@ #include "ScreenModels.h" #include "ActivityWeekView.h" #include "CompassControlView.h" -#if USE_OFFLINE_DIAL #include "DialViewGroup.h" -#else #include "MainClockView.h" -#endif #include "PlayersView.h" #include "MainPresenterSample.h" #include "HeartRateView.h" #include "components/ui_card_page.h" #include "PullUpDownView.h" #include "components/ui_cross_view.h" +#include "SetCardModel.h" namespace OHOS { class MainPresenterSample; class MainViewSample : public View { public: MainViewSample(); - virtual ~MainViewSample(); + ~MainViewSample() override; static MainViewSample *GetInstance(void); void OnStart() override; void OnSetUpView() override; @@ -51,11 +49,7 @@ public: UICardPage *InitMusicPlayerPage(void); void AnimatorStart(int pageIndex); void AnimatorStop(void); - uint16_t GetHorCurrentPage() const - { - return mainSwipeGroup->GetCurrentPageId(UISwipeView::HORIZONTAL); // 0: horizontal; 1: vertical - } - + CardId GetHorCurrentCard() const; UIView* GetMainViewGroup(void) const { return mainSwipeGroup; @@ -72,7 +66,7 @@ public: SetPage(mainClockView->GetViewIndex()); } } - + void SwitchToCard(uint8_t cardId); bool IsMainClockPage(void); void SetDragFg(bool continFg); bool GetDragFg(void); @@ -82,11 +76,7 @@ private: PullUpDownView *dropDownView{nullptr}; UICardPage *messageView{nullptr}; UILabel *messageLable{nullptr}; -#if USE_OFFLINE_DIAL - DialViewGroup *mainClockView{nullptr}; -#else - MainClockView *mainClockView{nullptr}; -#endif + UICardPage *mainClockView{nullptr}; ActivityWeekView *activityWeekView{nullptr}; PlayersView *playersView{nullptr}; CompassControlView *compassControlView{nullptr}; @@ -100,6 +90,8 @@ private: void VerticalViewInit(void); void VertViewLoad(void); void HorViewLoad(void); + UICardPage *InitWatchOffDial(DialSetting &setting); + UICardPage *InitWatchDial(DialSetting &setting); }; } // namespace OHOS #endif // MAIN_VIEW_SAMPLE_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h index 8463604e8..6444c4fe6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/ModelListenerSample.h @@ -24,6 +24,7 @@ public: ModelListenerSample(); virtual ~ModelListenerSample(); virtual void Notify(void) = 0; + virtual void OnTickEvent(void) {}; void Callback(); }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h index 147a03a32..e511eccee 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h @@ -10,7 +10,7 @@ #include "graphic_types.h" #include "wearable_log.h" -#include "components/ui_card_page.h" +#include "components/ui_card_page.h" #include "components/ui_view_group.h" #include "components/ui_image_view.h" #include "components/ui_label.h" @@ -20,10 +20,10 @@ namespace OHOS { class PullUpDownView : public UICardPage { public: PullUpDownView(); - virtual ~PullUpDownView(); + ~PullUpDownView() override; static PullUpDownView *GetInstance(void); bool InitView(); - void PreLoad(void) override; + void PreLoad(void) override; void UpdateBlueToothStatus(int status); private: UIImageView *dnotDisturb{nullptr}; @@ -40,7 +40,7 @@ private: UIImageView *battery{nullptr}; UILabel *batteryLable{nullptr}; UILabel *dateLable{nullptr}; - bool viewiInitStatus{false}; + bool viewiInitStatus{false}; void InitSubViewImg(void); void InitViewImg(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/UiServersMsg.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/UiServersMsg.h index b8a8b89e0..0a17cf583 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/UiServersMsg.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/UiServersMsg.h @@ -8,7 +8,7 @@ #ifndef UI_SERVERS_MSG_H #define UI_SERVERS_MSG_H -#include +#include #include "ohos_types.h" #include "message.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingPresenter.h index 26cc09892..f18dac441 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingPresenter.h @@ -28,8 +28,8 @@ typedef enum : uint16_t { } VolumeFactor; typedef enum : uint8_t { - VOLUMELOWERS = 0, - VOLUMELEVATED = 1, + VOLUMEDOWN = 0, + VOLUMEUP = 1, VOLUMEDRAG = 2, } VolumeChangeStatus; @@ -42,8 +42,7 @@ public: static VolumeSliderEventListener *GetInstance(); void OnChange(int32_t progress) override; void OnRelease(int32_t progress) override; - void ChangeImage(void); - void ChangeVolume(uint8_t status); + void ChangeVolume(VolumeChangeStatus status); bool OnClick(UIView& view, const ClickEvent& event) override; bool OnDrag(UIView& view, const DragEvent& event) override; void SetPlayerCoefficients(int16_t value); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcLabelView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcLabelView.h index ded3418c1..d3ad91ee2 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcLabelView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcLabelView.h @@ -5,7 +5,7 @@ #ifndef DIAL_ARC_LABEL_VIEW_H #define DIAL_ARC_LABEL_VIEW_H -#include "stdint.h" +#include #include "DialView.h" #include "components/ui_arc_label.h" @@ -13,7 +13,7 @@ namespace OHOS { class DialArcLabelView : public UIArcLabel, public DialView { public: DialArcLabelView(); - virtual ~DialArcLabelView(); + ~DialArcLabelView() override; bool SetText(const char* text); bool SetTextWithWildcard(const char* text); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcProgressView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcProgressView.h index eab02980a..29675223f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcProgressView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialArcProgressView.h @@ -12,7 +12,7 @@ namespace OHOS { class DialArcProgressView : public UICircleProgress, public DialView { public: DialArcProgressView(); - virtual ~DialArcProgressView(); + ~DialArcProgressView() override; void HandleFloatData(float data) override; private: int32_t value_ = -1; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBaseModel.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBaseModel.h index 115495579..ef71b9bb1 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBaseModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBaseModel.h @@ -12,7 +12,6 @@ #include "heap_base.h" #include "OnDialDataUpdateListener.h" -using namespace std; namespace OHOS { class DialBaseModel : public HeapBase { public: @@ -38,7 +37,7 @@ public: /* * * @brief Get dial data of text type */ - virtual bool GetDialTextData(DialDataType& type, string*& out, int16_t& strNum) + virtual bool GetDialTextData(DialDataType& type, std::string*& out, int16_t& strNum) { return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h index b5ea601ca..cc45b4d91 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h @@ -12,7 +12,7 @@ namespace OHOS { class DialBoxProgressView : public UIBoxProgress, public DialView { public: DialBoxProgressView(); - virtual ~DialBoxProgressView(); + ~DialBoxProgressView() override; void HandleFloatData(float data) override; private: int32_t value_ = -1; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialDigitalImgView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialDigitalImgView.h index 7a67038f7..443c325ee 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialDigitalImgView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialDigitalImgView.h @@ -5,7 +5,7 @@ #ifndef DIAL_DIGITAL_IMG_VIEW_H #define DIAL_DIGITAL_IMG_VIEW_H -#include "stdint.h" +#include #include "DialView.h" #include "components/ui_image_view.h" #include "gfx_utils/graphic_math.h" @@ -22,7 +22,7 @@ enum class ImgAlign { class DialDigitalImgView : public UIImageView, public DialView { public: DialDigitalImgView(); - virtual ~DialDigitalImgView(); + ~DialDigitalImgView() override; void HandleFloatData(float data) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialKaleidoscopeView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialKaleidoscopeView.h new file mode 100644 index 000000000..3125ab001 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialKaleidoscopeView.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#ifndef DIAL_KALEIDOSCOPE_VIEW_H +#define DIAL_KALEIDOSCOPE_VIEW_H +#include "components/ui_kaleidoscope_view.h" +namespace OHOS { +using DialKaleidoscopeView = UIKaleidoscopeView; +} +#endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialLabelView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialLabelView.h index 133ae6b88..c5513132a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialLabelView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialLabelView.h @@ -5,7 +5,7 @@ #ifndef DIAL_LABEL_VIEW_H #define DIAL_LABEL_VIEW_H -#include "stdint.h" +#include #include "DialView.h" #include "components/ui_label.h" @@ -13,7 +13,7 @@ namespace OHOS { class DialLabelView : public UILabel, public DialView { public: DialLabelView(); - virtual ~DialLabelView(); + ~DialLabelView() override; bool SetText(const char* text); bool SetTextWithWildcard(const char* text); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelHeartRate.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelHeartRate.h index 9fd090920..481f39459 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelHeartRate.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelHeartRate.h @@ -14,7 +14,7 @@ namespace OHOS { class DialModelHeartRate : public DialBaseModel { public: DialModelHeartRate() {} - virtual ~DialModelHeartRate() {} + ~DialModelHeartRate() override {} static DialModelHeartRate* GetInstance() { static DialModelHeartRate instance; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelPower.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelPower.h index c09fbc8fe..cb6a97ce5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelPower.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelPower.h @@ -14,7 +14,7 @@ namespace OHOS { class DialModelPower : public DialBaseModel { public: DialModelPower() {} - virtual ~DialModelPower() {} + ~DialModelPower() override {} static DialModelPower* GetInstance() { static DialModelPower instance; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelSteps.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelSteps.h index 412007dbf..e1e9930dd 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelSteps.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelSteps.h @@ -14,7 +14,7 @@ namespace OHOS { class DialModelSteps : public DialBaseModel { public: DialModelSteps() {} - virtual ~DialModelSteps() {} + ~DialModelSteps() override {} static DialModelSteps* GetInstance() { static DialModelSteps instance; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelTime.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelTime.h index d813c65b5..7da252b40 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelTime.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialModelTime.h @@ -14,7 +14,7 @@ namespace OHOS { class DialModelTime : public DialBaseModel { public: DialModelTime() {} - virtual ~DialModelTime() {} + ~DialModelTime() override {} static DialModelTime* GetInstance() { static DialModelTime instance; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialOptionImgView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialOptionImgView.h index 837b24410..4fa2fbd65 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialOptionImgView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialOptionImgView.h @@ -5,7 +5,7 @@ #ifndef DIAL_OPTION_IMG_VIEW_H #define DIAL_OPTION_IMG_VIEW_H -#include "stdint.h" +#include #include "DialView.h" #include "components/ui_image_view.h" @@ -14,7 +14,7 @@ namespace OHOS { class DialOptionImgView : public UIImageView, public DialView { public: DialOptionImgView(); - virtual ~DialOptionImgView(); + ~DialOptionImgView() override; void HandleFloatData(float data) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialRotateImgView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialRotateImgView.h index 23d49eb68..e1fff0ed8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialRotateImgView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialRotateImgView.h @@ -5,7 +5,7 @@ #ifndef DIAL_ROTATE_IMG_VIEW_H #define DIAL_ROTATE_IMG_VIEW_H -#include "stdint.h" +#include #include "DialView.h" #include "components/ui_image_view.h" #include "gfx_utils/graphic_math.h" @@ -15,7 +15,7 @@ namespace OHOS { class DialRotateImgView : public UIImageView, public DialView { public: DialRotateImgView(); - virtual ~DialRotateImgView(); + ~DialRotateImgView() override; void HandleFloatData(float data) override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialSequenceImgView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialSequenceImgView.h index ef885b6e0..4800b71b9 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialSequenceImgView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialSequenceImgView.h @@ -12,7 +12,7 @@ namespace OHOS { class DialSequenceImgView : public UIImageAnimatorView { public: DialSequenceImgView(); - virtual ~DialSequenceImgView(); + ~DialSequenceImgView() override; bool SetSequenceRes(const ImageAnimatorInfo* imgSrc, uint8_t imgNum); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialStaticImgView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialStaticImgView.h index a405bd868..e1b48a0a6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialStaticImgView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialStaticImgView.h @@ -11,7 +11,7 @@ namespace OHOS { class DialStaticImgView : public UIImageView { public: DialStaticImgView(); - virtual ~DialStaticImgView(); + ~DialStaticImgView() override; }; } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h index eca3227cc..7d4c1408b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialVideoView.h @@ -5,7 +5,7 @@ #ifndef DIAL_VIDEO_VIEW #define DIAL_VIDEO_VIEW -#include "stdint.h" +#include #include "components/ui_lite_surface_view.h" #include "video_play_wrapper.h" @@ -13,7 +13,7 @@ namespace OHOS { class DialVideoView : public UILiteSurfaceView { public: DialVideoView(); - virtual ~DialVideoView(); + ~DialVideoView() override; bool SetVideoRes(FILE* fp, uint32_t offset); bool StartPlay(); bool ResumePlay(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialView.h index 4f933a000..300f7a0b4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialView.h @@ -5,7 +5,7 @@ #ifndef DIAL_VIEW_H #define DIAL_VIEW_H -#include "stdint.h" +#include #include namespace OHOS { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h index 91c68a824..f6822612d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/DialViewGroup.h @@ -5,11 +5,12 @@ #ifndef DIAL_VIEW_GROUP_H #define DIAL_VIEW_GROUP_H -#include "DialDataBase.h" #include +#include "DialDataBase.h" #include "components/ui_view_group.h" #include "OnDialDataUpdateListener.h" #include "components/ui_card_page.h" +#include "components/ui_kaleidoscope_view.h" #include "gfx_utils/list.h" #include "DialView.h" #include "DialVideoView.h" @@ -18,7 +19,7 @@ namespace OHOS { class DialViewGroup : public UICardPage, public OnDialDataUpdateListener { public: DialViewGroup(); - virtual ~DialViewGroup(); + ~DialViewGroup() override; /** * @brief Set dial resource path. @@ -105,6 +106,11 @@ public: */ void CoverEnd(bool isCovered) override; + /** + * @brief This function is invoked when the function SetHorCurrentPage() is called. + */ + void OnActive(void) override; + private: void ProcessData(DialDataType type, DialView* view); std::unordered_map dataTypeMap_; @@ -116,6 +122,7 @@ private: std::string filePath_; FILE* fp_ = nullptr; DialVideoView* video_ = nullptr; + UIKaleidoscopeView* kaleidoscope_ = nullptr; typedef struct { Rect area; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/ModelDialDataFactory.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/ModelDialDataFactory.h index 602586aa4..33bedbe49 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/ModelDialDataFactory.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/dial/ModelDialDataFactory.h @@ -32,7 +32,7 @@ public: bool RegisterDialDataListener(DialDataType type, OnDialDataUpdateListener* listener); bool UnRegisterDialDataListener(DialDataType type); - bool GetDialTextData(DialDataType& type, string*& out, int16_t& strNum); + bool GetDialTextData(DialDataType& type, std::string*& out, int16_t& strNum); bool GetDialFloatData(DialDataType& type, float& out); bool GetDialFloatData(DialDataType& type, float*& out, int16_t& len); DialBaseModel* GetModuleByType(DialDataType& type); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/HealthModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/HealthModel.cpp index 50bbd9cdf..ad7fb0624 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/HealthModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/HealthModel.cpp @@ -24,8 +24,6 @@ #include #include "thread_adapter.h" -using namespace std; - namespace OHOS { HealthAllData g_healthData; @@ -52,8 +50,8 @@ HealthModel *HealthModel::GetInstance(void) int HealthModel::SaveGlobalHealthToFile(void) { - ofstream outHealthFile; - outHealthFile.open(HEALTH_DATA_PATH, ios::out); + std::ofstream outHealthFile; + outHealthFile.open(HEALTH_DATA_PATH, std::ios::out); if (outHealthFile.is_open() == 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "open HEALTH_DATA_PATH failure!"); outHealthFile.close(); @@ -107,7 +105,7 @@ void HealthModel::PushHealthData(HealthMsg healthMsg) bool HealthModel::FetchedHealthData(HealthMsg *healthMsg) { - if (listHealth.IsEmpty() == true) { + if (listHealth.IsEmpty()) { return false; } else { MUTEX_Lock(g_healthDataMutex); @@ -123,8 +121,8 @@ bool HealthModel::InitHealthData(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HealthModel::InitHealthData start"); (void)memset_s(&g_healthData, sizeof(HealthAllData), 0, sizeof(HealthAllData)); - ifstream inHealthFile; - inHealthFile.open(HEALTH_DATA_PATH, ios::in); + std::ifstream inHealthFile; + inHealthFile.open(HEALTH_DATA_PATH, std::ios::in); if (!inHealthFile.is_open()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "open HEALTH_DATA_PATH failure!"); inHealthFile.close(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainModel.cpp new file mode 100644 index 000000000..7cd3c937d --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainModel.cpp @@ -0,0 +1,222 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: MainModel.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "unistd.h" +#include "MainModel.h" +#include "kv_store.h" +#include "securec.h" +#include "wearable_log.h" + +namespace OHOS { + static const int CARD_SETTING_VALUE_LEN = 32; + static const int DIAL_SETTING_VALUE_LEN = 64; + const CardInfo cardInfoMap[] = { + { HEART_RATE, PNG_SET_CARD_HEART }, + { COMPASS, PNG_SET_CARD_COMPASS }, + { ACTIVITY, PNG_SET_CARD_ACTIVITY }, + { MUSIC_PLAYER, PNG_SET_CARD_PLAYER }, + }; + + const DialInfo dialInfoMap[] = { + { DIAL_CLOCK, "扫秒表盘", PNG_SET_DIAL_CLOCK, DEFAULT_TASK_PERIOD }, + }; + + MainModel::MainModel() {} + + MainModel::~MainModel() {} + + MainModel &MainModel::GetInstance() + { + static MainModel instance; + return instance; + } + + const CardInfo *MainModel::GetCardInfo(CardId card) const + { + for (uint8_t i = 0; i < (sizeof(cardInfoMap) / sizeof(cardInfoMap[0])); i++) { + if (card == cardInfoMap[i].id) { + return &cardInfoMap[i]; + } + } + return nullptr; + } + + const DialInfo *MainModel::GetDialInfo(DialId dialId) const + { + for (uint8_t i = 0; i < (sizeof(dialInfoMap) / sizeof(dialInfoMap[0])); i++) { + if (dialId == dialInfoMap[i].id) { + return &dialInfoMap[i]; + } + } + return nullptr; + } + + void MainModel::InitCardSettings(void) + { + char temp[CARD_SETTING_VALUE_LEN] = { 0 }; + int len; + int index = 0; + + memset_s(cardSettings, CARD_SETTING_COUNT_MAX, 0, CARD_SETTING_COUNT_MAX); + len = UtilsGetValue("card_setting", temp, CARD_SETTING_VALUE_LEN); + if (len >= 0) { + /* 读取用户card配置 */ + char *setBuffer = nullptr; + char *setValue = strtok_s(temp, ",", &setBuffer); + while (setValue != nullptr) { + if (index >= CARD_SETTING_COUNT_MAX) { + break; + } + cardSettings[index++] = (CardId)atoi(setValue); + setValue = strtok_s(nullptr, ",", &setBuffer); + } + cardSettingCount = index; + } else { + /* 使用默认card配置 */ + cardSettings[index++] = WATCH_FACE; + cardSettings[index++] = HEART_RATE; + cardSettings[index++] = COMPASS; + cardSettings[index++] = ACTIVITY; + cardSettings[index++] = MUSIC_PLAYER; + cardSettingCount = index; + } + } + + void MainModel::DeleteCardSetting(uint8_t index) + { + char temp[CARD_SETTING_VALUE_LEN] = { 0 }; + for (uint8_t i = 0; i < cardSettingCount; i++) { + if (i == index + 1) { + uint8_t j = i; + for (; j < cardSettingCount - 1; j++) { + cardSettings[j] = cardSettings[j + 1]; + } + cardSettings[j] = MAX_CARD; + cardSettingCount--; + } + } + + for (uint8_t i = 0; i < cardSettingCount; i++) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "cardSettings[%d] = %d", i, cardSettings[i]); + (void)sprintf_s(temp + strlen(temp), CARD_SETTING_VALUE_LEN, "%d,", cardSettings[i]); + } + (void)UtilsSetValue("card_setting", temp); + } + + void MainModel::AddCardSetting(uint8_t index) + { + char temp[CARD_SETTING_VALUE_LEN] = { 0 }; + if (cardSettingCount >= CARD_SETTING_COUNT_MAX) { + return; + } + for (int i = 0; i < cardSettingCount; i++) { + if (cardSettings[i] == cardInfoMap[index].id) { + return; + } + } + cardSettings[cardSettingCount++] = cardInfoMap[index].id; + for (uint8_t i = 0; i < cardSettingCount; i++) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "cardSettings[%d] = %d", i, cardSettings[i]); + (void)sprintf_s(temp + strlen(temp), CARD_SETTING_VALUE_LEN, "%d,", cardSettings[i]); + } + (void)UtilsSetValue("card_setting", temp); + } + + uint8_t MainModel::GetCardSettingCount(void) + { + return cardSettingCount; + } + + CardId *MainModel::GetCardSettings(void) + { + return cardSettings; + } + + void MainModel::InitDialSettingDefault(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitDialSettingDefault"); + dialSetting.dialFlag = 0; + dialSetting.dialId = DIAL_CLOCK; + dialSetting.dialFullName = ""; + } + + void MainModel::AddDialSetting(const DialSetting &setting) + { + std::string tmp; + tmp += std::to_string(setting.dialFlag); + tmp += ","; + tmp += std::to_string(setting.dialId); + tmp += ","; + tmp += setting.dialFullName; + tmp += ","; + (void)UtilsSetValue("dial_setting", tmp.c_str()); + } + + void MainModel::InitDialSettings(void) + { + char temp[DIAL_SETTING_VALUE_LEN] = { 0 }; + int32_t len = UtilsGetValue("dial_setting", temp, DIAL_SETTING_VALUE_LEN); + if (len >= 0) { + char *setBuffer = nullptr; + char *setValue = strtok_s(temp, ",", &setBuffer); + if (setValue != nullptr) { + dialSetting.dialFlag = atoi(setValue); + } else { + InitDialSettingDefault(); + return; + } + + setValue = strtok_s(nullptr, ",", &setBuffer); + if (setValue != nullptr) { + dialSetting.dialId = atoi(setValue); + } else { + InitDialSettingDefault(); + return; + } + + setValue = strtok_s(nullptr, ",", &setBuffer); + if (setValue != nullptr) { + dialSetting.dialFullName = setValue; + if (!((dialSetting.dialFullName.length() > 0) && + (access(dialSetting.dialFullName.c_str(), F_OK) == 0))) { + InitDialSettingDefault(); + return; + } + } else { + InitDialSettingDefault(); + return; + } + } else { + InitDialSettingDefault(); + } + } + + DialSetting& MainModel::GetDialSetting() + { + return dialSetting; + } + + bool MainModel::IsFromSetCardView(void) const + { + return isFromSetCardView; + } + + void MainModel::SetFromSetCardView(bool isFrom) + { + isFromSetCardView = isFrom; + } + + void MainModel::SetFromCardId(uint8_t cardId) + { + fromCardId = cardId; + } + + uint8_t MainModel::GetFromCardId(void) + { + return fromCardId; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp index e3ad3fdab..8c9f3c229 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -10,7 +10,7 @@ #include "HeartRateView.h" #include "PlayersModel.h" #include "PlayersPresenter.h" -#include "CompassPresenter.h" +#include "MainCompassPresenter.h" #include "CompassModel.h" #include "CompassCalibrationView.h" #include "drag_event.h" @@ -23,23 +23,21 @@ #include "ModelDialDataFactory.h" #include "PresenterTask.h" #include "DialModelTime.h" -#if USE_OFFLINE_DIAL #include "DialViewGroup.h" -#endif #include "ui_service.h" namespace OHOS { -map g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, // 天气界面 - { MAIN_CLICK_ACTIVITY, VIEW_MAIN_ACTIVITY }, // 活动记录界面 - { MAIN_CLICK_MESSAGE, VIEW_MAIN_SAMPLE }, // 消息app - { MAIN_CLICK_HEARTRATE, VIEW_MAIN_SAMPLE }, // 心率界面 - { DROPDOWN_CLICK_ALARM, VIEW_MAIN_ALARM }, // 闹钟app - { DROPDOWN_CLICK_SETTING, VIEW_SETTING } }; // 设置界面 +std::map g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, // 天气界面 + { MAIN_CLICK_ACTIVITY, VIEW_MAIN_ACTIVITY }, // 活动记录界面 + { MAIN_CLICK_MESSAGE, VIEW_MAIN_SAMPLE }, // 消息app + { MAIN_CLICK_HEARTRATE, VIEW_MAIN_SAMPLE }, // 心率界面 + { DROPDOWN_CLICK_ALARM, VIEW_MAIN_ALARM }, // 闹钟app + { DROPDOWN_CLICK_SETTING, VIEW_SETTING } }; // 设置界面 -map g_chanColor = { { DROPDOWN_CLICK_FINDMYPHONE, DROPDOWN_DROPDOWN_FIND_PHONE_B }, - { DROPDOWN_CLICK_ALARM, DROPDOWN_DROPDOWN_ALARM_B }, - { DROPDOWN_CLICK_SETTING, DROPDOWN_DROPDOWN_SETTING_B } }; +std::map g_chanColor = { { DROPDOWN_CLICK_FINDMYPHONE, DROPDOWN_DROPDOWN_FIND_PHONE_B }, + { DROPDOWN_CLICK_ALARM, DROPDOWN_DROPDOWN_ALARM_B }, + { DROPDOWN_CLICK_SETTING, DROPDOWN_DROPDOWN_SETTING_B } }; static MainPresenterSample *g_pMainPresenterSample = nullptr; @@ -97,7 +95,7 @@ bool MainPresenterSample::OnClick(UIView &view, const ClickEvent &event) { UNUSED(event); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StatusButtonClickListener: %s", view.GetViewId()); - string curViewId = view.GetViewId(); + std::string curViewId = view.GetViewId(); UIImageView *imgView = static_cast(&view); if (HealthModel::GetInstance() == nullptr) { @@ -133,6 +131,21 @@ bool MainPresenterSample::OnClick(UIView &view, const ClickEvent &event) return true; } +bool MainPresenterSample::OnLongPress(UIView& view, const LongPressEvent& event) +{ + UNUSED(event); + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainPresenterSample OnLongPress"); + uint8_t cardId = view_->GetHorCurrentCard(); + if (cardId != WATCH_FACE) { + SetCardModel::GetInstance().SetSelectedCard(cardId); + NativeAbility::GetInstance().ChangeSlice(VIEW_SET_CARD); + } else { + NativeAbility::GetInstance().ChangeSlice(VIEW_SET_DIAL); + } + return true; +} + void MainPresenterSample::SetPage(int8_t id) { if (view_ != nullptr) { @@ -140,18 +153,20 @@ void MainPresenterSample::SetPage(int8_t id) } } -void MainPresenterSample::SetTaskPeroid(int page) +void MainPresenterSample::SetTaskPeroid(CardId cardId) { - if (page == COMPASS) { + if (cardId == COMPASS) { PresenterTask::GetInstance()->SetPeriod(DEFAULT_TASK_PERIOD); - } else if (page == WATCH_FACE) { -#if USE_OFFLINE_DIAL - uint32_t time = dynamic_cast(view_->GetViewById(WATCH_FACE))->GetPeriod(); -#else - uint32_t time = DEFAULT_TASK_PERIOD; -#endif + } else if (cardId == WATCH_FACE) { + uint32_t time; + DialSetting &setting = GetDialSetting(); + if (setting.dialFlag) { + time = dynamic_cast(view_->GetViewById(WATCH_FACE))->GetPeriod(); + } else { + time = DEFAULT_TASK_PERIOD; + } PresenterTask::GetInstance()->SetPeriod(time); - } else if (page == MUSIC_PLAYER) { + } else if (cardId == MUSIC_PLAYER) { PresenterTask::GetInstance()->SetPeriod(PLAYER_PERIOD); } else { PresenterTask::GetInstance()->SetPeriod(MAX_PERIOD); @@ -161,10 +176,10 @@ void MainPresenterSample::SetTaskPeroid(int page) void MainPresenterSample::OnSwipe(UISwipeView &view) { UNUSED(view); - int page = view_->GetHorCurrentPage(); + CardId cardId = view_->GetHorCurrentCard(); callback_->OnSwipe(view); - SetTaskPeroid(page); - if (page == COMPASS) { + SetTaskPeroid(cardId); + if (cardId == COMPASS) { if (!isCompassSensorOpened_) { CompassModel::GetInstance()->OpenCompassSensor(); isCompassSensorOpened_ = true; @@ -183,7 +198,7 @@ void MainPresenterSample::ProcessDataNotify(void) HealthMsg healthMsg; uint16_t len; - while ((HealthModel::GetInstance()->FetchedHealthData(&healthMsg) == true)) { + while ((HealthModel::GetInstance()->FetchedHealthData(&healthMsg))) { switch (healthMsg.type) { case BATTERY_LIFE: break; @@ -205,6 +220,12 @@ void MainPresenterSample::SetCircleProgress() } state_ = playersView->GetPlayerButtonState(); if (state_ == UICheckBox::UICheckBoxState::SELECTED) { + int32_t playerState; + PlayersModel::GetInstance()->GetPlayerCtr()->GetPlayerState(playerState); + if (playerState != PLAYER_STARTED) { + playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); + return; + } PlayersModel::GetInstance()->GetPlayerCtr()->GetCurrentTime(playerCurrentTime_); PlayersModel::GetInstance()->GetDuration(playerMusicDuration_); if (playerMusicDuration_ != 0) { @@ -229,18 +250,59 @@ void MainPresenterSample::SetCompassRotate() void MainPresenterSample::Notify(void) { - if (view_->GetHorCurrentPage() == COMPASS) { + CardId cardId = view_->GetHorCurrentCard(); + if (cardId == COMPASS) { SetCompassRotate(); - } else if (view_->GetHorCurrentPage() == MUSIC_PLAYER) { + } else if (cardId == MUSIC_PLAYER) { SetCircleProgress(); - } else if (view_->GetHorCurrentPage() == WATCH_FACE) { -#if USE_OFFLINE_DIAL - DialModelTime::GetInstance()->UpdateTime(); - dynamic_cast(view_->GetViewById(WATCH_FACE))->UpdateViewsByPeriodicUpdateData(); -#else - dynamic_cast(view_->GetViewById(WATCH_FACE))->UpdateTime(); -#endif + } else if (cardId == WATCH_FACE) { + DialSetting &setting = GetDialSetting(); + if (setting.dialFlag) { + DialModelTime::GetInstance()->UpdateTime(); + dynamic_cast(view_->GetViewById(WATCH_FACE))->UpdateViewsByPeriodicUpdateData(); + } else { + dynamic_cast(view_->GetViewById(WATCH_FACE))->UpdateTime(); + } } } +void MainPresenterSample::InitCardSettings(void) +{ + MainModel::GetInstance().InitCardSettings(); +} + +uint8_t MainPresenterSample::GetCardSettingCount(void) +{ + return MainModel::GetInstance().GetCardSettingCount(); +} + +CardId *MainPresenterSample::GetCardSettings(void) +{ + return MainModel::GetInstance().GetCardSettings(); +} + +void MainPresenterSample::InitDialSettings(void) +{ + return MainModel::GetInstance().InitDialSettings(); +} +DialSetting& MainPresenterSample::GetDialSetting() +{ + return MainModel::GetInstance().GetDialSetting(); +} + +bool MainPresenterSample::IsFromSetCardView(void) const +{ + return MainModel::GetInstance().IsFromSetCardView(); +} + +void MainPresenterSample::SetFromSetCardView(bool isFrom) +{ + MainModel::GetInstance().SetFromSetCardView(isFrom); +} + +uint8_t MainPresenterSample::GetFromCardId(void) +{ + return MainModel::GetInstance().GetFromCardId(); +} + } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp index 6f3503cb4..54747cdf9 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -22,7 +22,7 @@ struct MainViewMapper { UICardPage *(MainViewSample::*func)(void); }; -static const MainViewMapper PageMapper[] = { +static const MainViewMapper CardMapper[] = { {WATCH_FACE, &MainViewSample::InitWatchFacePage}, {HEART_RATE, &MainViewSample::InitHeartRatePage}, {COMPASS, &MainViewSample::InitCompassPage}, @@ -92,6 +92,11 @@ MainViewSample::~MainViewSample() compassControlView = nullptr; } + if (callback != nullptr) { + delete callback; + callback = nullptr; + } + g_pMainView = nullptr; } @@ -131,38 +136,56 @@ void MainViewSample::OnStart() mainSwipeGroup->SetLoopState(true); mainSwipeGroup->EnableScreenCap(true); mainSwipeGroup->RegisterSwipeCallback(callback); - SwitchToClockPage(); + if (presenter_->IsFromSetCardView()) { + presenter_->SetFromSetCardView(false); + SwitchToCard(presenter_->GetFromCardId()); + } else { + SwitchToClockPage(); + } SetContainerView(mainSwipeGroup); } bool MainViewSample::HorizontalViewInit(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::HorizontalViewInit"); - UISwipeView::OnSwipeListener *listener = nullptr; - - for (int16_t i = 0; i < MAX_CARD; i++) { - recordCard[i] = (this->*(PageMapper[i].func))(); - if (recordCard[i] == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainViewSample:: recordCard %d error", i); - return false; + presenter_->InitDialSettings(); + presenter_->InitCardSettings(); + uint8_t cardSettingNum = presenter_->GetCardSettingCount(); + CardId *cardSettings = presenter_->GetCardSettings(); + uint8_t cardMapNumber = sizeof(CardMapper) / sizeof(CardMapper[0]); + for (int16_t i = 0; i < cardSettingNum; i++) { + for (uint8_t j = 0; j < cardMapNumber; j++) { + if (cardSettings[i] == CardMapper[j].id) { + recordCard[j] = (this->*(CardMapper[j].func))(); + if (recordCard[j] == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + "MainViewSample:: recordCard %d error", j); + return false; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, + "MainViewSample:: recordCard[%d]:%p", j, recordCard[j]); + break; + } } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample:: recordCard[%d]:%p", i, recordCard[i]); } - - listener = static_cast(MainPresenterSample::GetInstance()); - if (listener == nullptr) { - return false; - } - MainPresenterSample::GetInstance()->setCallback(callback); - mainSwipeGroup->SetOnSwipeListener(listener); + presenter_->setCallback(callback); + mainSwipeGroup->SetOnSwipeListener(presenter_); + mainSwipeGroup->SetOnLongPressListener(presenter_); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::InitPage over"); return true; } void MainViewSample::HorViewLoad(void) { - for (int16_t i = 0; i < MAX_CARD; i++) { - mainSwipeGroup->HorAdd(recordCard[i]); + uint8_t cardSettingNum = presenter_->GetCardSettingCount(); + CardId *cardSettings = presenter_->GetCardSettings(); + for (int16_t i = 0; i < cardSettingNum; i++) { + CardId cardId = cardSettings[i]; + if (recordCard[cardId] != nullptr) { + mainSwipeGroup->HorAdd(recordCard[cardId]); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample:: HorViewLoad cardid = %d ViewIndex = %d", + cardId, recordCard[cardId]->GetViewIndex()); + } } } @@ -239,18 +262,31 @@ void MainViewSample::OnStop() return; } +UICardPage *MainViewSample::InitWatchOffDial(DialSetting &setting) +{ + DialViewGroup *dial = new DialViewGroup(); + dial->SetDial(setting.dialFullName); + return dial; +} + +UICardPage *MainViewSample::InitWatchDial(DialSetting &setting) +{ + switch (setting.dialId) { + case DIAL_CLOCK: + return new MainClockView(); + default: + return nullptr; + } +} + UICardPage *MainViewSample::InitWatchFacePage(void) { -#if USE_OFFLINE_DIAL - mainClockView = new DialViewGroup(); - std::string filePath = dynamic_cast(presenter_)->GetDialPath(); - if (filePath.size() == 0) { - filePath = RES_PATH"dial.bin"; + DialSetting &setting = presenter_->GetDialSetting(); + if (setting.dialFlag) { + mainClockView = InitWatchOffDial(setting); + } else { + mainClockView = InitWatchDial(setting); } - mainClockView->SetDial(filePath); -#else - mainClockView = new MainClockView(); -#endif if (mainClockView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail"); @@ -306,17 +342,37 @@ void MainViewSample::SetPage(int16_t page) } if (presenter_ != nullptr) { - presenter_->SetTaskPeroid(page); + CardId *cardSettings = presenter_->GetCardSettings(); + /* page 与CardId 没有对应关系,需要一次转换 */ + presenter_->SetTaskPeroid(cardSettings[page]); } } bool MainViewSample::IsMainClockPage(void) { - if (mainSwipeGroup->GetCurrentPageId(0) == WATCH_FACE && + if (mainSwipeGroup->GetCurrentPageId(0) == mainClockView->GetViewIndex() && mainSwipeGroup->GetCurrentPageId(1) == 1) { // 0: horizontal; 1: vertical return true; } else { return false; } } + +CardId MainViewSample::GetHorCurrentCard() const +{ + CardId *cardSettings = presenter_->GetCardSettings(); + int pageId = mainSwipeGroup->GetCurrentPageId(UISwipeView::HORIZONTAL); // 0: horizontal; 1: vertical + /* pageId 与CardId 没有对应关系,需要一次转换 */ + return cardSettings[pageId]; +} + +void MainViewSample::SwitchToCard(uint8_t cardId) +{ + if ((cardId < MAX_CARD) && (recordCard[cardId] != nullptr)) { + SetPage(recordCard[cardId]->GetViewIndex()); + } else { + SwitchToClockPage(); + } +} + } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp index bb5f0bf1b..ab4844c3d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/ModelListenerSample.cpp @@ -34,5 +34,6 @@ ModelListenerSample::~ModelListenerSample() void ModelListenerSample::Callback() { Notify(); + OnTickEvent(); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp index 587a35d30..1b1c61930 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PresenterTask.cpp @@ -4,7 +4,8 @@ namespace OHOS { -PresenterTask* PresenterTask::GetInstance() { +PresenterTask* PresenterTask::GetInstance() +{ static PresenterTask PresenterTask; return &PresenterTask; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp index e35841c94..96e362cb8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingPresenter.cpp @@ -16,8 +16,15 @@ #include "bts_avrcp_controller.h" #include "bts_avrcp_target.h" #include "notification_manager.h" +#include "BluetoothHeadsetEvent.h" +#include "bts_avrcp_controller.h" namespace OHOS { + +#ifdef __cplusplus +extern "C" { +#endif + static VolumeSliderEventListener *g_pVolumeSliderEventListener = nullptr; constexpr int16_t SOUND_CHANGE = 10; @@ -46,51 +53,18 @@ bool VolumeSliderEventListener::OnClick(UIView& view, const ClickEvent& event) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnClick OnClick"); if (strcmp(view.GetViewId(), INCREASE_BUTTON) == 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetIncreaseButton OnClick"); - ChangeVolume(VOLUMELEVATED); + ChangeVolume(VOLUMEUP); } else if (strcmp(view.GetViewId(), DECREASE_BUTTON) == 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetDecreaseButton OnClick"); - ChangeVolume(VOLUMELOWERS); + ChangeVolume(VOLUMEDOWN); } else if (strcmp(view.GetViewId(), VOLUME_PROGRESS) == 0) { - ChangeImage(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetDragButton OnClick"); ChangeVolume(VOLUMEDRAG); } return true; } -void VolumeSliderEventListener::ChangeImage() -{ - ImageInfo *image; - VolumeSettingView *volumeSettingView = VolumeSettingView::GetInstance(); - if (volumeSettingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ChangeImage:volumeSettingView new fail"); - return; - } - UISlider *progress = volumeSettingView->GetProgress(); - if (progress == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ChangeImage:progress new fail"); - return; - } - UIButton *decrease = volumeSettingView->GetDecreaseButton(); - if (decrease == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ChangeImage:decrease new fail"); - return; - } - - volumeSettingView->sounding = progress->GetValue(); - if (volumeSettingView->sounding == 0) { - image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); - decrease->SetImageSrc(image, image); - // 刷新UI - decrease->Invalidate(); - } else { - image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_DECREASE_BUTTON, PLAYER_IAMGES); - decrease->SetImageSrc(image, image); - // 刷新UI - decrease->Invalidate(); - } -} - -void VolumeSliderEventListener::ChangeVolume(uint8_t status) +void VolumeSliderEventListener::ChangeVolume(VolumeChangeStatus status) { ImageInfo *image; VolumeSettingView *volumeSettingView = VolumeSettingView::GetInstance(); @@ -110,8 +84,8 @@ void VolumeSliderEventListener::ChangeVolume(uint8_t status) } preSound = volumeSettingView->sounding; - if (status == 1) { - volumeSettingView->sounding = progress->GetValue() + SOUND_CHANGE; + if (status == VOLUMEUP) { + volumeSettingView->sounding = progress->GetValue() + SOUND_CHANGE; if (volumeSettingView->sounding > VOLUME_MAX) { volumeSettingView->sounding = VOLUME_MAX; } @@ -119,39 +93,69 @@ void VolumeSliderEventListener::ChangeVolume(uint8_t status) decrease->SetImageSrc(image, image); // 刷新UI decrease->Invalidate(); - } else if (status == 0) { + progress->SetValue(volumeSettingView->sounding); + } else if (status == VOLUMEDOWN) { volumeSettingView->sounding = progress->GetValue() - SOUND_CHANGE; if (volumeSettingView->sounding < VOLUME_MIN) { volumeSettingView->sounding = VOLUME_MIN; } + if (volumeSettingView->sounding == VOLUME_MIN && + (playerCoefficients == VOLUMEPHONE || playerCoefficients == VOLUMEPHONENOTIFY)) { + // 通话场景音量不能设置为0 + volumeSettingView->sounding = SOUND_CHANGE; + } if ((volumeSettingView->sounding == 0) && (preSound != 0)) { image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); decrease->SetImageSrc(image, image); // 刷新UI decrease->Invalidate(); } + progress->SetValue(volumeSettingView->sounding); + } else if (status == VOLUMEDRAG) { + volumeSettingView->sounding = progress->GetValue(); + if (volumeSettingView->sounding == VOLUME_MIN && + (playerCoefficients == VOLUMEPHONE || playerCoefficients == VOLUMEPHONENOTIFY)) { + // 通话场景音量不能设置为0 + volumeSettingView->sounding = SOUND_CHANGE; + progress->SetValue(volumeSettingView->sounding); + } + if (volumeSettingView->sounding == 0) { + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); + decrease->SetImageSrc(image, image); + // 刷新UI + decrease->Invalidate(); + } else { + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_DECREASE_BUTTON, PLAYER_IAMGES); + decrease->SetImageSrc(image, image); + // 刷新UI + decrease->Invalidate(); + } } - progress->SetValue(volumeSettingView->sounding); + if (playerCoefficients == VOLUMEPLAYERS) { BtAndLocalVolumeSet(volumeSettingView->sounding); } if (playerCoefficients == VOLUMEPHONE || playerCoefficients == VOLUMEPHONENOTIFY) { - unsigned char volumeValue; - volumeValue = (unsigned char) ((double) (volumeSettingView->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换 + unsigned char volumeValue = (unsigned char) ((double) (volumeSettingView->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换 SetSpeakerVolume(volumeValue); } } +extern BtAvrcpTgInf g_avrcp_srv_inf; void VolumeSliderEventListener::BtAndLocalVolumeSet(int16_t sounding) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BtAndLocalVolumeSet %d", sounding); + if (g_avrcp_srv_inf.avrcp_srv_conn_stat == PROFILE_STATE_CONNECTED) { + uint8_t volume = sounding * AVRCP_ABSOLUTE_VOLUME_PERCENTAGE_100 / 100; // 100:本地音量最大值 + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "avrcp volume = %d", volume); + (void)avrcp_ct_set_absolute_volume(&(g_avrcp_srv_inf.bd_addr), volume); // 手表音量设置同步远端BT音量 + } + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "audio volume = %d", sounding); AudioManager::GetInstance().SetVolume(AUDIO_STREAM_MUSIC, sounding); // 本地音量设置 } void VolumeSliderEventListener::OnRelease(int32_t value) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnRelease %d", value); - ChangeImage(); ChangeVolume(VOLUMEDRAG); } @@ -163,7 +167,6 @@ void VolumeSliderEventListener::SetPlayerCoefficients(int16_t value) void VolumeSliderEventListener::OnChange(int32_t value) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnChange %d", value); - ChangeImage(); ChangeVolume(VOLUMEDRAG); } @@ -207,4 +210,7 @@ bool VolumeSliderEventListener::OnDrag(UIView& view, const DragEvent& event) } return true; } +#ifdef __cplusplus +} +#endif } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelSteps.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelSteps.cpp index b21f8cc92..0a9e7ff29 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelSteps.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelSteps.cpp @@ -21,7 +21,7 @@ bool DialModelSteps::GetDialFloatData(DialDataType& type, float& out) void DialModelSteps::UpdateSteps(int16_t steps) { steps_ = static_cast(steps); - if(onChangeListener_ != nullptr) { + if (onChangeListener_ != nullptr) { onChangeListener_->OnDialFloatDataUpdate(DialDataType::DATA_TYPE_STEPS, steps_); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelTime.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelTime.cpp index 20663119b..2af8cd26d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelTime.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialModelTime.cpp @@ -71,7 +71,7 @@ static float ConvertHandSecondValueToAngle(int32_t handValue, uint16_t range) void DialModelTime::UpdateTime() { struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); tblock_ = localtime(&tv.tv_sec); int realMS = tblock_->tm_sec * S_MS_US_TRANS + tv.tv_usec / S_MS_US_TRANS; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp index 7770f1618..c3cbafba4 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialVideoView.cpp @@ -12,7 +12,7 @@ static constexpr int16_t JPEG_HEIGHT_DIVISOR = 2; static constexpr int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128; static constexpr int16_t JPEG_HEIGHT_BYTE_ALIGNMENT = 16; static constexpr int16_t BUFFER_QUEUE_SIZE = 2; -static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 64; +static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 128; #ifdef SUPPORT_AT_OHOSFWK static MediaVideoPlay *g_videoPlay = nullptr; @@ -50,7 +50,6 @@ DialVideoView::~DialVideoView() deregisterNotifyScreenStatus(ScreenStatusNotify); #endif if (videoPlayer_ != nullptr) { - videoPlayer_->StopVideoPlay(); delete videoPlayer_; } } @@ -87,6 +86,7 @@ bool DialVideoView::SetVideoRes(FILE* fp, uint32_t offset) } videoPlayer_ = new MediaVideoPlay(surface, fd, offset_, true); + videoPlayer_->SetSyncExitMode(true); #ifdef SUPPORT_AT_OHOSFWK g_videoPlay = videoPlayer_; registerNotifyScreenStatus(ScreenStatusNotify); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp index 1b022d79b..2eea946de 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp @@ -18,6 +18,10 @@ DialViewGroup::DialViewGroup(void) DialViewGroup::~DialViewGroup(void) { + if (kaleidoscope_ != nullptr) { + kaleidoscope_->ClearFocus(); + kaleidoscope_ = nullptr; + } ClearDial(); } @@ -82,6 +86,11 @@ void DialViewGroup::PreLoad(void) if (video_ != nullptr) { video_->StartPlay(); } + + if (kaleidoscope_ != nullptr) { + kaleidoscope_->RequestFocus(); + kaleidoscope_->StartRotateAnimator(); + } resPreloaded_ = true; } } @@ -115,6 +124,10 @@ void DialViewGroup::AddView(UIView* view, bool isDialVideoView) dialViews_.PushBack(view); Add(view); + if (view->GetViewType() == UI_KALEIDOSCOPE_VIEW) { + kaleidoscope_ = dynamic_cast(view); + } + if (isDialVideoView) { if (video_ != nullptr) { GRAPHIC_LOGE("Already added a video view.\n"); @@ -253,6 +266,14 @@ bool DialViewGroup::OnClickEvent(const ClickEvent& event) void DialViewGroup::ScrollBegin(bool isActive) { + if (kaleidoscope_ != nullptr) { + if (isActive) { + kaleidoscope_->ClearFocus(); + kaleidoscope_->StopRotateAnimator(); + } + return; + } + if (video_ == nullptr) { return; } @@ -263,6 +284,14 @@ void DialViewGroup::ScrollBegin(bool isActive) void DialViewGroup::ScrollEnd(bool isActive) { + if (kaleidoscope_ != nullptr) { + if (isActive) { + kaleidoscope_->StartRotateAnimator(); + kaleidoscope_->RequestFocus(); + } + return; + } + if (video_ == nullptr) { return; } @@ -273,11 +302,24 @@ void DialViewGroup::ScrollEnd(bool isActive) } else if (video_->IsStopped()) { video_->StartPlay(); } + } else { + if (video_->IsPaused() || video_->IsPlayed()) { + video_->StopPlay(); + } + ClearCache(); } } void DialViewGroup::CoverBegin(bool isCovered) { + if (kaleidoscope_ != nullptr) { + if (!isCovered) { + kaleidoscope_->StopRotateAnimator(); + kaleidoscope_->ClearFocus(); + } + return; + } + if (video_ == nullptr) { return; } @@ -289,6 +331,13 @@ void DialViewGroup::CoverBegin(bool isCovered) void DialViewGroup::CoverEnd(bool isCovered) { + if (kaleidoscope_ != nullptr) { + if (!isCovered) { + kaleidoscope_->RequestFocus(); + kaleidoscope_->StartRotateAnimator(); + } + return; + } if (video_ == nullptr) { return; } @@ -300,4 +349,18 @@ void DialViewGroup::CoverEnd(bool isCovered) } } } + +void DialViewGroup::OnActive(void) +{ + if (video_ != nullptr) { + if (video_->IsPaused()) { + video_->ResumePlay(); + } else if (video_->IsStopped()) { + video_->StartPlay(); + } + } else if (kaleidoscope_ != nullptr) { + kaleidoscope_->RequestFocus(); + kaleidoscope_->StartRotateAnimator(); + } +} } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/ModelDialDataFactory.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/ModelDialDataFactory.cpp index 9d02e691d..d17de5b31 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/ModelDialDataFactory.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/ModelDialDataFactory.cpp @@ -7,7 +7,7 @@ #include "ModelDialDataFactory.h" namespace OHOS { -bool ModelDialDataFactory::GetDialTextData(DialDataType& type, string*& out, int16_t& strNum) +bool ModelDialDataFactory::GetDialTextData(DialDataType& type, std::string*& out, int16_t& strNum) { DialBaseModel* model = GetModuleByType(type); if (model == nullptr) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp index 3316e9661..b2978d168 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/dial/parser/DialBinParser.cpp @@ -29,6 +29,7 @@ #include "DialBoxProgressView.h" #include "DialArcProgressView.h" #include "DialArcLabelView.h" +#include "DialKaleidoscopeView.h" namespace OHOS { DialBinParser::DialBinParser() @@ -44,6 +45,7 @@ DialBinParser::DialBinParser() funcArray_[8] = &DialBinParser::ParserDialArcProgress; // 8: index funcArray_[9] = &DialBinParser::ParserDialVideo; // 9: index funcArray_[10] = &DialBinParser::ParserDialClick; // 10: index + funcArray_[11] = &DialBinParser::ParserDialKaleidoscope; // 11: index } DialBinParser::~DialBinParser() @@ -76,6 +78,39 @@ DialBinParser* DialBinParser::GetInstance(void) return &instance; } +bool DialBinParser::GetDialPreviewInfo(FILE* fp, DialPreviewInfo* info) +{ + if (fp == nullptr || info == nullptr) { + GRAPHIC_LOGE("Get dial preview fail, param error!\n"); + return false; + } + + DialHeader* dialHeader = static_cast(MallocAndReadBuf(fp, sizeof(DialHeader))); + if (dialHeader == nullptr) { + GRAPHIC_LOGE("[%s: %d]malloc or read fail!\n", __FUNCTION__, __LINE__); + return false; + } + + if (memcpy_s(info->dialName, DIAL_NAME_MAX_LEN, dialHeader->dialName, DIAL_NAME_MAX_LEN) != EOK) { + GRAPHIC_LOGE("[%s: %d]memcpy_s dial name fail!\n", __FUNCTION__, __LINE__); + free(dialHeader); + return false; + } + + if (memcpy_s(info->description, DIAL_DESCRIPTION_MAX_LEN, + dialHeader->description, DIAL_DESCRIPTION_MAX_LEN) != EOK) { + GRAPHIC_LOGE("[%s: %d]memcpy_s dial description fail!\n", __FUNCTION__, __LINE__); + free(dialHeader); + return false; + } + + info->imgId = dialHeader->previewImgId | dirId_; + info->offset = dialHeader->imageOffset; + + free(dialHeader); + return true; +} + bool DialBinParser::UpdateDial(const std::string& file, FILE* fp, DialViewGroup* group) { if (fp == nullptr) { @@ -340,8 +375,8 @@ int32_t DialBinParser::ParserDialDigitalImg(FILE* fp) fseek(fp, curReadPt, SEEK_SET); } - ImageInfo* numInfoArray[DIGITALIMG_IMG_MAX_NUM] = {}; - for (uint16_t i = 0; i < DIGITALIMG_IMG_MAX_NUM; i++) { + ImageInfo* numInfoArray[DIAL_DIGITALIMG_IMG_MAX_NUM] = {}; + for (uint16_t i = 0; i < DIAL_DIGITALIMG_IMG_MAX_NUM; i++) { resId = data->imgIds[i] | dirId_; curReadPt = ftell(fp); numInfoArray[i] = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, @@ -355,7 +390,7 @@ int32_t DialBinParser::ParserDialDigitalImg(FILE* fp) fseek(fp, curReadPt, SEEK_SET); } view->SetParent(dialGroup_); - view->SetNumRes(const_cast(numInfoArray), DIGITALIMG_IMG_MAX_NUM); + view->SetNumRes(const_cast(numInfoArray), DIAL_DIGITALIMG_IMG_MAX_NUM); dialGroup_->AddView(static_cast(data->bindData), view, data->isPeriod); UIFree(data); @@ -444,7 +479,11 @@ bool DialBinParser::SetProgressType(FILE* fp, UIAbstractProgress* view, DialProg fseek(fp, curReadPt, SEEK_SET); view->SetImage(foregroundInfo, nullptr); } else if (data.type == 1) { - view->SetForegroundStyle(STYLE_BACKGROUND_COLOR, data.color.full); + if (view->GetViewType() == UI_BOX_PROGRESS) { + view->SetForegroundStyle(STYLE_BACKGROUND_COLOR, data.color.full); + } else if (view->GetViewType() == UI_CIRCLE_PROGRESS) { + view->SetForegroundStyle(STYLE_LINE_COLOR, data.color.full); + } } else if (data.type == 2) { // 2: gradient ColorStop* stopArray = static_cast(MallocAndReadBuf(fp, (sizeof(ColorStop) * data.stopCount))); if (stopArray == nullptr) { @@ -539,6 +578,17 @@ int32_t DialBinParser::ParserDialVideo(FILE* fp) view->SetPosition(data->rect.x, data->rect.y, data->rect.w, data->rect.h); view->SetSurfaceColorkey(data->colorKey); view->SetVideoRes(fp, data->offset); + uint32_t resId = data->imgId | dirId_; + uint32_t curReadPt = ftell(fp); + ImageInfo* imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, + file_, fp, false, imageOffset_); + if (imgInfo == nullptr) { + GRAPHIC_LOGE("[%s: %d]load img fail! file: %s resId: %x\n", + __FUNCTION__, __LINE__, file_.c_str(), resId); + return false; + } + fseek(fp, curReadPt, SEEK_SET); + view->SetPreview(imgInfo); dialGroup_->AddView(view, true); UIFree(data); return 0; @@ -567,4 +617,38 @@ int32_t DialBinParser::ParserDialClick(FILE* fp) return 0; } -} \ No newline at end of file + +int32_t DialBinParser::ParserDialKaleidoscope(FILE* fp) +{ + if (fp == nullptr) { + GRAPHIC_LOGE("Parser dial option image fail, file is nullptr!\n"); + return -1; + } + + DialKaleidoscope* data = static_cast(MallocAndReadBuf(fp, sizeof(DialKaleidoscope))); + if (data == nullptr) { + GRAPHIC_LOGE("[%s: %d]malloc or read fail!\n", __FUNCTION__, __LINE__); + return -1; + } + + DialKaleidoscopeView* view = new DialKaleidoscopeView(); + uint32_t resId = data->imgId | dirId_; + uint32_t curReadPt = ftell(fp); + ImageInfo* imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, + file_, fp, false, imageOffset_); + if (imgInfo == nullptr) { + GRAPHIC_LOGE("[%s: %d]load img fail! file: %s resId: %x\n", + __FUNCTION__, __LINE__, file_.c_str(), resId); + return false; + } + fseek(fp, curReadPt, SEEK_SET); + + view->SetSrc(imgInfo); + view->SetRotateEventFactor(data->crownRotateStep); // 0.2: rotate event factor + view->SetRotateAnimatorValue(data->animatorRotateStep); // 0.1: rotate animator value + dialGroup_->AddView(view); + + UIFree(data); + return 0; +} +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/include/MainCallingPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/makephone/include/MainCallingPresenter.h index 761f2320a..3b7b8c542 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/include/MainCallingPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/include/MainCallingPresenter.h @@ -19,7 +19,7 @@ class MainCallingView; class MainCallingPresenter : public Presenter, public UIView::OnClickListener { public: MainCallingPresenter(); - virtual ~MainCallingPresenter(); + ~MainCallingPresenter() override; void OnStart() override; void OnPause() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallerDisplayView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallerDisplayView.cpp index 5de273b53..2426ea21e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallerDisplayView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallerDisplayView.cpp @@ -139,17 +139,17 @@ UIViewGroup *CallerDisplayView::CreateUIViewGroup() group->SetPosition(MATH_ZERO, MATH_ZERO); group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value - if (InitImageViewDisplay() == false) { + if (!InitImageViewDisplay()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitImageViewDisplay error"); return nullptr; } - if (InitAddOnclickevent() == false) { + if (!InitAddOnclickevent()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitAddOnclickevent error"); return nullptr; } - if (InitUILabelDisplay() == false) { + if (!InitUILabelDisplay()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerDisplayView::InitUILabelDisplay error"); return nullptr; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallingView.cpp index eb85ee0df..2c19d7599 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/CallingView.cpp @@ -164,7 +164,7 @@ bool CallingView::InitUILabelDisplay() VIEW_DISTANCE_TO_LEFT_SIDE, TITLE_LABEL_DEFAULT_HEIGHT); callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); callDuration->SetAlign(TEXT_ALIGNMENT_CENTER); - callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration()); + callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_TIME_FONT_SIZE); callDuration->SetTextColor(Color::White()); group->Add(callDuration); @@ -195,17 +195,17 @@ UIViewGroup *CallingView::CreateUIViewGroup() group->SetPosition(MATH_ZERO, MATH_ZERO); group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value - if (InitImageViewDisplay() == false) { + if (!InitImageViewDisplay()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitImageViewDisplay error"); return nullptr; } - if (InitAddOnclickevent() == false) { + if (!InitAddOnclickevent()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitAddOnclickevent error"); return nullptr; } - if (InitUILabelDisplay() == false) { + if (!InitUILabelDisplay()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error"); return nullptr; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/DialingScreenView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/DialingScreenView.cpp index 7efc14eb1..99808b2e9 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/DialingScreenView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/DialingScreenView.cpp @@ -124,7 +124,7 @@ UIViewGroup *DialingScreenView::CreateUIViewGroup() group->SetPosition(MATH_ZERO, MATH_ZERO); group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value - if (InitUILabelDisplay() == false) { + if (!InitUILabelDisplay()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialingScreenView::InitImageViewDisplay error"); return nullptr; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp index 7b80e99fa..93f2560c3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp @@ -76,7 +76,7 @@ void MainCallingPresenter::HonrsViewChange() WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::volumeSetting nullptr err"); return; } - if (volumeSetting->SetUpVolume() == false) { + if (!volumeSetting->SetUpVolume()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::volumeSetting SetUpVolume fail"); return; } @@ -96,7 +96,7 @@ void MainCallingPresenter::HonrsViewChange() volumeSliderEventListener->SetPlayerCoefficients(VOLUMEPHONE); // 进度条系数 - if (InitPointerValue() == false) { + if (!InitPointerValue()) { return; } @@ -112,7 +112,7 @@ void MainCallingPresenter::HonrsViewChange() bool MainCallingPresenter::CallingViewDisplay() { - if (InitPointerValue() == false) { + if (!InitPointerValue()) { return false; } view_->GetScreenGroup()->SetVisible(false); @@ -174,7 +174,7 @@ bool MainCallingPresenter::HintsHandupClick() } CallerLogModel::GetInstance()->SetWaitingStatus(false); CallerLogModel::GetInstance()->SetCallStatus(true); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TRANSITION_INVALID, PRIORITY_ONE); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, TransitionType::TRANSITION_INVALID, PRIORITY_ONE); return true; } @@ -182,7 +182,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) { UNUSED(event); - if (InitPointerValue() == false) { + if (!InitPointerValue()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::InitPointerValue error"); return false; } @@ -216,7 +216,7 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::honrs show"); HonrsViewChange(); } else if (strcmp(view.GetViewId(), "hintsHandup") == 0) { - if (HintsHandupClick() == false) { + if (!HintsHandupClick()) { return false; } } else if (strcmp(view.GetViewId(), "answer") == 0) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingView.cpp index 3e2497d14..df06f8429 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/MainCallingView.cpp @@ -121,7 +121,7 @@ void MainCallingView::OnStart() View::OnStart(); BaseView::RootView(Color::Black().full); - if (InitPointerValue() == false) { + if (!InitPointerValue()) { return; } @@ -132,15 +132,15 @@ void MainCallingView::OnStart() waitingGroup->SetVisible(false); callingGroup->SetVisible(false); - if (CallerLogModel::GetInstance()->GetCallStatus() == true) { + if (CallerLogModel::GetInstance()->GetCallStatus()) { displayGroup->SetVisible(false); callingGroup->SetVisible(true); screenGroup->SetVisible(false); - } else if (CallerLogModel::GetInstance()->GetWaitingStatus() == true) { + } else if (CallerLogModel::GetInstance()->GetWaitingStatus()) { screenGroup->SetVisible(false); displayGroup->SetVisible(false); waitingGroup->SetVisible(true); - } else if (CallerLogModel::GetInstance()->GetPhoneStatus() == true) { + } else if (CallerLogModel::GetInstance()->GetPhoneStatus()) { displayGroup->SetVisible(false); } else { screenGroup->SetVisible(false); @@ -153,7 +153,7 @@ void MainCallingView::OnSetUpView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingView::~OnSetUpView"); View::OnSetUpView(); - if (CallerLogModel::GetInstance()->GetMulitplePhoneStatus() == true) { + if (CallerLogModel::GetInstance()->GetMulitplePhoneStatus()) { MulitplePhoneTextReplaces(); CallerLogModel::GetInstance()->SetMulitplePhoneStatus(false); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp index 5b1e446d5..e27e55dbc 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp @@ -50,10 +50,10 @@ UIViewGroup *WaitingHintsView::CreateUIViewGroup() group->SetPosition(MATH_ZERO, MATH_ZERO); group->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); // 454 : value - if (InitImageViewDisplay() == false) { + if (!InitImageViewDisplay()) { return nullptr; } - if (InitUILabelDisplay() == false) { + if (!InitUILabelDisplay()) { return nullptr; } return group; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h index 194e59a4b..74b194508 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/MainVocassistView.h @@ -17,7 +17,7 @@ class VocassistPresenter; class MainVocassistView : public View { public: MainVocassistView(); - virtual ~MainVocassistView(); + ~MainVocassistView() override; void OnStart() override; void OnSetUpView() override; void OnTearDownView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h index e22acc3fb..8ec962153 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/include/VocassistView.h @@ -106,7 +106,7 @@ namespace OHOS { class VoiceAssistance : public AppGroupView { public: VoiceAssistance(); - virtual ~VoiceAssistance(); + ~VoiceAssistance() override; static VoiceAssistance *GetInstance(); bool InitView(void *caller) override; // 初始化所有控件 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp index 000fd86e3..00ffa938d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp @@ -35,7 +35,7 @@ static const char g_voiceWordName[SMART_VOICE_INVALID_CMD_ID + 1][CMD_LENGTH] = namespace OHOS { static void RecognVoiceEvent(const SmartVoiceCmdParam data) { - SmartVoiceCmdParam *param = NULL; + SmartVoiceCmdParam *param = nullptr; param = (SmartVoiceCmdParam *)&data; if (param->cmdId < SMART_VOICE_WAKEUP_CMD || param->cmdId > SMART_VOICE_INVALID_CMD_ID) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Get cmdid failed, funct callback finish!!"); @@ -54,11 +54,11 @@ static void RecognVoiceEvent(const SmartVoiceCmdParam data) } } else if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_OFFLINEVOICE) { // 已经进入语音助手 if (VoiceAssistance::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is NULL, funct callback finish!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is nullptr, funct callback finish!!"); return; } if (VocassistModel::GetInstance()->GetToggleFlag() == ALREADY_OPEN_VOCASSIST_IMAGE && - VocassistModel::GetInstance()->GetHasOneCmd() == false) { + (!VocassistModel::GetInstance()->GetHasOneCmd())) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CurSliceId equals VIEW_OFFLINEVOICE"); VoiceAssistance::GetInstance()->SetCmdContext(g_voiceWordName[param->cmdId]); VoiceAssistance::GetInstance()->SwitchMedium(CREATE_CMD_LABEL); @@ -73,7 +73,7 @@ static void RecognVoiceEvent(const SmartVoiceCmdParam data) void VoiceFunction(SmartVoiceEventType type, td_void *data, td_s32 size) { int dataSize = sizeof(SmartVoiceCmdParam); - if (data == NULL || dataSize != size) { + if (data == nullptr || dataSize != size) { return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp index 98b97129d..5cd75bf95 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp @@ -61,7 +61,6 @@ void VocassistPresenter::VocAssistDeal(int flag) VocassistModel::GetInstance()->SetExitStatus(CONTINUTE_EXIT_MODE1); VoiceAssistance::GetInstance()->DelayDisplayTime(DELAY_SIX_SECONDS); // 开启定时器,太长时间未操作退出语音助手 - } void VocassistPresenter::OnAnimatorStop(UIView& view) // 播放结束监听 @@ -89,7 +88,7 @@ bool VocassistPresenter::OnClick(UIView& view, const ClickEvent& event) // 语 { UNUSED(event); if (VoiceAssistance::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is NULL!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is nullptr!!"); return false; } if (strcmp(view.GetViewId(), VOCPHOTO_ID) == 0) { @@ -137,7 +136,6 @@ void VocassistPresenter::OnResume(void) {} void VocassistPresenter::OnStop(void) { Presenter::OnStop(); - SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, NULL, 0); - + SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, nullptr, 0); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp index f67c649ba..98705f63c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp @@ -36,7 +36,7 @@ static constexpr uint16_t WORD_LENGTH = 60; static constexpr int16_t ERROR_RETVAL = -1; namespace OHOS { -static osTimerId_t g_closeVocassistHandle = NULL; +static osTimerId_t g_closeVocassistHandle = nullptr; static VoiceAssistance *g_pVoiceAssistance = nullptr; enum { @@ -98,12 +98,12 @@ VoiceAssistance::~VoiceAssistance() RemoveAll(); g_pVoiceAssistance = nullptr; // 切换为其它slice时将定时器删除 - if (g_closeVocassistHandle != NULL) { + if (g_closeVocassistHandle != nullptr) { osStatus_t statusRet = osTimerDelete(g_closeVocassistHandle); if (statusRet != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Delete timer failed!!"); } - g_closeVocassistHandle = NULL; + g_closeVocassistHandle = nullptr; } delete voicePhoto; @@ -144,12 +144,12 @@ void VoiceAssistance::InitImageAnimatorSource(void) void VoiceAssistance::DetermineCause(const int *eventRet) // 根据能否执行用户指令做出回复 { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VoiceAssistView] Enter DetermineCause"); - if (eventRet == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "EventRet is NULL!!"); + if (eventRet == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "EventRet is nullptr!!"); return; } if (VoiceAssistance::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is NULL!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is nullptr!!"); return; } int temp = *eventRet; @@ -171,7 +171,7 @@ void VoiceAssistance::InitVocassist(void) voicePhoto->SetSizeFixed(true); if (VoiceAssistance::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is NULL!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is nullptr!!"); return; } VoiceAssistance::GetInstance()->SwitchMedium(WAVE_VIEW); @@ -191,7 +191,7 @@ void VoiceAssistance::InitVocassist(void) void VoiceAssistance::SwitchMedium(uint16_t targetView) { if (GraphicService::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GraphicService instance is NULL!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GraphicService instance is nullptr!!"); return; } GraphicService::GetInstance()->PostGraphicEvent(std::bind(&VoiceAssistance::VocSwitchApp, this, targetView)); @@ -211,7 +211,7 @@ void VoiceAssistance::VocSwitchApp(uint16_t targetView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VoiceAssistView] Start Operation!!"); if (VoiceAssistance::GetInstance() == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is NULL!!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VoiceAssistance instance is nullptr!!"); return; } viewFunct func = FindIndex(targetView); @@ -232,7 +232,7 @@ int VoiceAssistance::ChangeViewToPlayer() // 播放音乐 { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VoiceAssistView] Enter ChangeViewToPlayer"); - if(!PlayersModel::GetInstance()->HasPlayerPlayed()) { // 播放过了就不用再初始化 + if (!PlayersModel::GetInstance()->HasPlayerPlayed()) { // 播放过了就不用再初始化 PlayersListGroup::GetInstance()->SetUpListCase(); PlayersModel::GetInstance()->PlayerInit(); } @@ -578,13 +578,13 @@ void VoiceAssistance::CloseVocassist() static void DeleteTimeTick() { - if (g_closeVocassistHandle != NULL) { + if (g_closeVocassistHandle != nullptr) { osStatus_t ret = osTimerDelete(g_closeVocassistHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Delete timer failed!!"); return; } - g_closeVocassistHandle = NULL; + g_closeVocassistHandle = nullptr; } } @@ -653,20 +653,20 @@ void VoiceAssistance::DelayDisplayTime(int32_t waitSec) } int quitStatus = VocassistModel::GetInstance()->GetExitStatus(); // 删除定时器,打断退出语音助手的操作 - if (g_closeVocassistHandle != NULL && (quitStatus == CONTINUTE_EXIT_MODE1 || + if (g_closeVocassistHandle != nullptr && (quitStatus == CONTINUTE_EXIT_MODE1 || quitStatus == CONTINUTE_EXIT_MODE2)) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Interrupt Timer!!"); osStatus_t statusRet = osTimerDelete(g_closeVocassistHandle); if (statusRet != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Delete timer failed!!"); } - g_closeVocassistHandle = NULL; + g_closeVocassistHandle = nullptr; VocassistModel::GetInstance()->SetExitStatus(INTERRUPT_EXIT); } // 创建新的定时器 - g_closeVocassistHandle = osTimerNew((osTimerFunc_t)DelayTimeCallback, osTimerOnce, NULL, NULL); - if (g_closeVocassistHandle == NULL) { + g_closeVocassistHandle = osTimerNew((osTimerFunc_t)DelayTimeCallback, osTimerOnce, nullptr, nullptr); + if (g_closeVocassistHandle == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "New timer failed !!"); return; } @@ -674,13 +674,13 @@ void VoiceAssistance::DelayDisplayTime(int32_t waitSec) osStatus_t statusRet = osTimerStart(g_closeVocassistHandle, tick); if (statusRet != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Start timer failed !!"); - if (g_closeVocassistHandle != NULL) { + if (g_closeVocassistHandle != nullptr) { statusRet = osTimerDelete(g_closeVocassistHandle); if (statusRet != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Delete timer failed !!"); return; } - g_closeVocassistHandle = NULL; + g_closeVocassistHandle = nullptr; } return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneAudio.h b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneAudio.h index 1666ee0c8..fd0b6c957 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneAudio.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneAudio.h @@ -7,8 +7,7 @@ #ifndef PHONE_AUDIO_H #define PHONE_AUDIO_H -#include -#include "stdbool.h" +#include #include "audio_base_type.h" #include "ohos_types.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h index 2cfce573f..27a14857e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h @@ -7,7 +7,6 @@ #ifndef PHONE_SERVICE_H #define PHONE_SERVICE_H -#include "stdbool.h" #include "bts_br_gap.h" #include "bts_hfp_hf.h" #include "ohos_types.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp index 2d32b2b6a..8b695c89a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp @@ -85,7 +85,7 @@ bool PhoneAudioSetSpeakerMute(bool isMute) return true; } - if (isMute == true) { + if (isMute) { ret = g_amInstance.Mute(AUDIO_STREAM_VOICE_CALL_BT_SCO); } else { ret = g_amInstance.UnMute(AUDIO_STREAM_VOICE_CALL_BT_SCO); @@ -166,7 +166,7 @@ int32 PhoneAudioManagerSetDeviceConnState(AudioDeviceType deviceType, AudioDevic } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[%s] line:%d success, deviceType = 0x%x connectState = %d", - __FUNCTION__, __LINE__, deviceType, connectState); + __FUNCTION__, __LINE__, deviceType, connectState); return AUDIO_SUCCESS; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp index 3fadd3445..f3641a545 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp @@ -7,12 +7,12 @@ #include "PhoneService.h" #include "PhoneAudio.h" #include "securec.h" -#include -#include -#include +#include +#include +#include #include "audio_base_type.h" #include "audio_manager.h" -#include "time.h" +#include #include "wearable_log.h" #include "unistd.h" #include "dirent.h" @@ -76,7 +76,7 @@ static void PhoneServiceScreenCtr(bool turnOnFlag) int32_t timeout = -1; SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); } else { - SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, NULL, 0); + SendMsgToUIService(SCREEN_TURN_OFF_TO_UI, 0, nullptr, 0); } } @@ -92,7 +92,7 @@ uint32 GetCallCodec(void) int RegisterCallChangedCb(PhoneServiceCb *phoneServiceFun) { - if (phoneServiceFun == NULL) { + if (phoneServiceFun == nullptr) { return OHOS_FAILURE; } @@ -124,18 +124,17 @@ int GetCurrCallState(void) // 初始化媒体 static void AudioInit(void) { - int ret; - ret = PhoneAudioManagerInit(); + int32_t ret = PhoneAudioManagerInit(); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioInit] [PhoneAudioManagerInit] failed!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioInit] failed!"); } } // 释放音频焦点 static void AudioDeactInterrupt(AudioStreamType type) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDeactInterrupt] start type: 0x%x, g_audioState: 0x%x", - type, g_audioState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDeactInterrupt] start type:0x%x, audioState:0x%x", + type, g_audioState); if ((type == AUDIO_STREAM_VOICE_CALL_BT_SCO && g_audioState >= AUDIO_ACT_INTERRUPT_BT_SCO) || (type == AUDIO_STREAM_RING && g_audioState == AUDIO_ACT_INTERRUPT_WATCH_RING)) { @@ -148,12 +147,12 @@ static void AudioActInterrupt(AudioStreamType type) { int ret = OHOS_SUCCESS; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] start type: 0x%x, g_audioState: 0x%x", - type, g_audioState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] start type:0x%x, audioState:0x%x", + type, g_audioState); if (type != AUDIO_STREAM_VOICE_CALL_BT_SCO && type != AUDIO_STREAM_RING) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] failed! type: 0x%x, g_audioState: 0x%x", - type, g_audioState); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] failed! type:0x%x, audioState:0x%x", + type, g_audioState); return; } @@ -176,8 +175,8 @@ static void AudioActInterrupt(AudioStreamType type) } if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] failed! type: 0x%x, g_audioState: 0x%x", - type, g_audioState); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioActInterrupt] failed! type:0x%x, audioState:0x%x", + type, g_audioState); } MUTEX_Unlock(g_audioMutex); @@ -188,8 +187,8 @@ static void AudioConnectScoDevInit(void) { int ret; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] start g_scoFlag: 0x%x, g_audioState: 0x%x", - g_scoFlag, g_audioState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] start scoFlag:0x%x, audioState:0x%x", + g_scoFlag, g_audioState); if (g_scoFlag != HFP_SCO_STATE_CONNECTED || g_audioState < AUDIO_ACT_INTERRUPT_BT_SCO) { return; } @@ -200,8 +199,7 @@ static void AudioConnectScoDevInit(void) // 配置媒体连接SCO设配状态(下行),只有在SCO连接后才能设置 ret = PhoneAudioManagerSetDeviceConnState(IN_BLUETOOTH_SCO, AUDIO_DEVICE_CONNECTED); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] [PhoneAudioManagerSetDeviceConnState] \ - IN_BLUETOOTH_SCO failed! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] sco in ret:%d", ret); MUTEX_Unlock(g_audioMutex); return; } else { @@ -213,8 +211,7 @@ static void AudioConnectScoDevInit(void) // 配置媒体连接SCO设配状态(上行),只有在SCO连接后才能设置 ret = PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_SCO, AUDIO_DEVICE_CONNECTED); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] [PhoneAudioManagerSetDeviceConnState] \ - OUT_BLUETOOTH_SCO failed! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] sco out ret:%d", ret); MUTEX_Unlock(g_audioMutex); return; } else { @@ -234,8 +231,8 @@ static void AudioConnectScoDevInit(void) g_audioState = AUDIO_STREAM_INIT; } } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] end g_audioState: %d, g_hdlUpSco: %d, g_hdlDnSco: %d", - g_audioState, g_hdlUpSco, g_hdlDnSco); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioConnectScoDevInit] end audioState:%d, hdlUpSco:%d, hdlDnSco:%d", + g_audioState, g_hdlUpSco, g_hdlDnSco); MUTEX_Unlock(g_audioMutex); return; @@ -247,7 +244,7 @@ static void AudioUpStart(void) int ret = OHOS_SUCCESS; uint32 micShmId = 0; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] start g_scoFlag: %d, g_audioState: %d", g_scoFlag, g_audioState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] start scoFlag:%d, audioState:%d", g_scoFlag, g_audioState); if (g_scoFlag != HFP_SCO_STATE_CONNECTED || g_audioState < AUDIO_STREAM_INIT) { return; @@ -259,15 +256,15 @@ static void AudioUpStart(void) g_hdlUpMic = PhoneAudioStreamInInit(AUDIO_UP_LINK); } - if (g_audioState < AUDIO_STREAM_START_SCO) { + if (g_audioState < AUDIO_STREAM_START_SCO) { ret = PhoneAudioStreamInStart(g_hdlDnSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] [AudioStreamInStart] [dn_sco] error! ret: %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] dn_sco ret:%d", ret); } ret |= PhoneAudioStreamOutStart(g_hdlUpSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] [AudioStreamOutStart] [up_sco] error ret: %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] up_sco ret:%d", ret); } if (ret == OHOS_SUCCESS) { g_audioState = AUDIO_STREAM_START_SCO; @@ -276,24 +273,24 @@ static void AudioUpStart(void) ret |= PhoneAudioStreamInStart(g_hdlUpMic); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] [PhoneAudioStreamInStart] [up_mic] error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] up_mic ret:%d", ret); } ret |= PhoneAudioStreamInGetChannelId(g_hdlUpMic, &micShmId); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] [AudioStreamInGetChannelId] [up_mic] error ret: %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] up_mic shm ret:%d", ret); } ret |= PhoneAudioStreamOutAttachFrontend(g_hdlUpSco, micShmId); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] [AudioStreamOutAttachFrontend] [up_sco] error ret:%d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] up_sco attach ret:%d", ret); } if (ret == OHOS_SUCCESS) { g_audioState = AUDIO_STREAM_START_UP; } } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] end g_audioState:%d, g_hdlUpMic:%d, g_hdlUpSco:%d, micShmId:0x%x", + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUpStart] end audioState:%d, hdlUpMic:%d, hdlUpSco:%d, micShmId:0x%x", g_audioState, g_hdlUpMic, g_hdlUpSco, micShmId); MUTEX_Unlock(g_audioMutex); return; @@ -305,7 +302,7 @@ static void AudioDnStart(void) int ret = OHOS_SUCCESS; uint32 spkShmId = 0; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] start g_scoFlag: %d, g_audioState: %d", g_scoFlag, g_audioState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] start scoFlag:%d, audioState:%d", g_scoFlag, g_audioState); if (g_scoFlag != HFP_SCO_STATE_CONNECTED || g_audioState < AUDIO_STREAM_INIT) { return; @@ -320,12 +317,12 @@ static void AudioDnStart(void) if (g_audioState < AUDIO_STREAM_START_SCO) { ret = PhoneAudioStreamOutStart(g_hdlUpSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] [AudioStreamOutStart] [up_sco] error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] up_sco ret:%d", ret); } ret |= PhoneAudioStreamInStart(g_hdlDnSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] [AudioStreamInStart] [dn_sco] error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] dn_sco ret:%d", ret); } if (ret == OHOS_SUCCESS) { @@ -335,24 +332,24 @@ static void AudioDnStart(void) ret |= PhoneAudioStreamOutStart(g_hdlDnSpk); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] [PhoneAudioStreamOutStart] [dn_spk] error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] dn_spk ret:%d", ret); } ret |= PhoneAudioStreamOutGetChannelId(g_hdlDnSpk, &spkShmId); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] [AudioStreamOutGetChannelId] [dn_spk] error ret: %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] dn_spk shm ret:%d", ret); } ret |= PhoneAudioStreamInAttachBackend(g_hdlDnSco, spkShmId); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] [AudioStreamInAttachBackend] [dn_sco] error ret: %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] dn_sco attach ret:%d", ret); } if (ret == OHOS_SUCCESS) { g_audioState = AUDIO_STREAM_START_DN; } } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] end g_audioState:%d, g_hdlDnSpk:%d, g_hdlDnSco:%d, spkShmId: 0x%x", + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDnStart] end audioState:%d, hdlDnSpk:%d, hdlDnSco:%d, spkShmId:0x%x", g_audioState, g_hdlDnSpk, g_hdlDnSco, spkShmId); MUTEX_Unlock(g_audioMutex); @@ -385,8 +382,6 @@ static void PostGraphicEvent(void (*fun)(void)) // 蓝牙通话下行 static void AudioDn(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDn] start g_audioState: %d", g_audioState); - // 申请蓝牙通话音频焦点 AudioActInterrupt(AUDIO_STREAM_VOICE_CALL_BT_SCO); @@ -397,16 +392,14 @@ static void AudioDn(void) AudioDnStart(); if (g_audioState == AUDIO_STREAM_START_DN) { // 同步音量 - PostGraphicEvent(SyncVolume); + SyncVolume(); } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioDn] end g_audioState: %d", g_audioState); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[AudioDn] audioState:%d", g_audioState); } // 蓝牙通话上行 static void AudioUp(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUp] start g_audioState: %d", g_audioState); - // 申请蓝牙通话音频焦点 AudioActInterrupt(AUDIO_STREAM_VOICE_CALL_BT_SCO); @@ -415,8 +408,18 @@ static void AudioUp(void) // 建立音频上行通路 AudioUpStart(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioUp] end g_audioState: %d", g_audioState); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[AudioUp] audioState:%d", g_audioState); +} + +static void AudioSetup(void) +{ + if (g_audioState < AUDIO_STREAM_START_DN) { + AudioDn(); + } + if (g_audioState != AUDIO_STREAM_START_UP) { + AudioUp(); + } } static void AudioUpRelease(void) @@ -426,35 +429,34 @@ static void AudioUpRelease(void) if (g_hdlUpSco != INVALID_PHONE_SERVICE_VALUE) { ret = PhoneAudioStreamOutStop(g_hdlUpSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [OutStop] g_hdlUpSco error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [OutStop] hdlUpSco ret:%d", ret); } ret = PhoneAudioStreamOutDeinit(g_hdlUpSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [OutDeinit] g_hdlUpSco error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [OutDeinit] hdlUpSco ret:%d", ret); } } if (g_hdlUpMic != INVALID_PHONE_SERVICE_VALUE) { ret = PhoneAudioStreamInStop(g_hdlUpMic); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [InStop] g_hdlUpMic error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [InStop] hdlUpMic ret:%d", ret); } ret = PhoneAudioStreamInDeinit(g_hdlUpMic); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [InDeinit] g_hdlUpMic error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [InDeinit] hdlUpMic ret:%d", ret); } } if (g_audioState >= AUDIO_CONN_OUT_BT_SCO) { ret = PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_SCO, AUDIO_DEVICE_DISCONNECTED); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] OUT_BLUETOOTH_SCO error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] sco out ret:%d", ret); } } g_hdlUpSco = INVALID_PHONE_SERVICE_VALUE; g_hdlUpMic = INVALID_PHONE_SERVICE_VALUE; - } static void AudioDnRelease(void) @@ -464,29 +466,29 @@ static void AudioDnRelease(void) if (g_hdlDnSco != INVALID_PHONE_SERVICE_VALUE) { ret = PhoneAudioStreamInStop(g_hdlDnSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [InStop] g_hdlDnSco error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [InStop] hdlDnSco ret:%d", ret); } ret = PhoneAudioStreamInDeinit(g_hdlDnSco); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [InDeinit] g_hdlDnSco error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioUpRelease] [InDeinit] hdlDnSco ret:%d", ret); } } if (g_hdlDnSpk != INVALID_PHONE_SERVICE_VALUE) { ret = PhoneAudioStreamOutStop(g_hdlDnSpk); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [OutStop] g_hdlDnSpk error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [OutStop] hdlDnSpk ret:%d", ret); } ret = PhoneAudioStreamOutDeinit(g_hdlDnSpk); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [OutDeinit] g_hdlDnSpk error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] [OutDeinit] hdlDnSpk ret:%d", ret); } } if (g_audioState >= AUDIO_CONN_IN_BT_SCO) { ret = PhoneAudioManagerSetDeviceConnState(IN_BLUETOOTH_SCO, AUDIO_DEVICE_DISCONNECTED); if (ret != OHOS_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] IN_BLUETOOTH_SCO error! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioDnRelease] sco in ret:%d", ret); } } @@ -511,7 +513,7 @@ void AudioRelease(void) AudioDeactInterrupt(AUDIO_STREAM_RING); // 适配某些机型不触发SCO g_audioState = AUDIO_UNKNOW; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AudioRelease] end g_audioState: %d,", g_audioState); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[AudioRelease] audioState:%d,", g_audioState); MUTEX_Unlock(g_audioMutex); } @@ -568,10 +570,7 @@ static void BtDisconnectedPro(void) PhoneServiceErrorCallback(ERROR_BT, PROFILE_STATE_DISCONNECTED); CallListInit(); - // 释放媒体资源 - PostGraphicEvent(AudioRelease); - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BtDisconnectedPro callState: %d", g_currCallState); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BtDisconnectedPro callState:%d", g_currCallState); if (g_currCallState == HFP_HF_CALL_STATE_INCOMING) { /* 处理呼入阶段,取消手表配对 */ hfp_hf_calls_info_t call = {0}; @@ -586,15 +585,9 @@ static void BtDisconnectedPro(void) // 蓝牙状态连接 static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t state) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] state = 0x%X bdAddr: ", state); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] state = 0x%X bdAddr: ", state); CatBdAddr(bdAddr); - if (state == PROFILE_STATE_CONNECTED) { - SendMsgToUIService(BT_CONNECTED_TO_UI, 0, NULL, 0); - } else if (state == PROFILE_STATE_DISCONNECTED) { - SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, NULL, 0); - } - switch (state) { case PROFILE_STATE_CONNECTING: // 蓝牙正在连接 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connecting"); @@ -602,6 +595,7 @@ static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t st case PROFILE_STATE_CONNECTED: // 蓝牙连接成功 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connected"); BtConnectedPro(bdAddr); + SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); break; case PROFILE_STATE_DISCONNECTING: // 蓝牙连接断连 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT disconnecting"); @@ -609,6 +603,7 @@ static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t st case PROFILE_STATE_DISCONNECTED: // 蓝牙断开连接 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT disconnected"); BtDisconnectedPro(); + SendMsgToUIService(BT_DISCONNECTED_TO_UI, 0, nullptr, 0); break; default: break; @@ -625,7 +620,7 @@ uint32 GetBtConnectStatus(void) // SCO连接处理 static void ScoConnectPro(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] g_currCallNum = %d, g_scoFlag = %d", g_currCallNum, g_scoFlag); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] CallNum:%d, ScoFlag:%d", g_currCallNum, g_scoFlag); // 通知sco建立连接(或通话转移:手机 -> 手表) ScoStatusCb(HFP_SCO_STATE_CONNECTED); if (g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_CONNECTED) { @@ -633,24 +628,15 @@ static void ScoConnectPro(void) hfp_hf_calls_info_t call = {0}; HfpIncomingEventPublish(TOPIC_EVENT_HFP_PHONE_TO_WATCH, call); } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] g_audioState: %d ", g_audioState); - - if (g_audioState < AUDIO_STREAM_START_DN) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] post AudioDn"); - PostGraphicEvent(AudioDn); - } - - if (g_audioState != AUDIO_STREAM_START_UP) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] post AudioUp"); - PostGraphicEvent(AudioUp); - } - + + PostGraphicEvent(AudioSetup); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ScoConnectPro] audioState:%d", g_audioState); } // SCO断连处理 static void ScoDisconnectPro(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoDisconnectPro] start g_currCallState = %d", g_currCallState); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ScoDisconnectPro] start CallState:%d", g_currCallState); ScoStatusCb(HFP_SCO_STATE_DISCONNECTED); if (g_currCallState == HFP_HF_CALL_STATE_ACTIVE && g_scoFlag == HFP_SCO_STATE_DISCONNECTED) { @@ -666,7 +652,7 @@ static void ScoDisconnectPro(void) static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t state) { g_scoFlag = state; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] state = %d, g_scoFlag = %d, g_currCallNum = %d", state, + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[ScoStateChanged] hfpState:%d, ScoFlag:%d, CallNum:%d", state, g_scoFlag, g_currCallNum); switch (state) { @@ -702,9 +688,9 @@ static void ScoStateChanged(const bd_addr_t *bdAddr, hfp_sco_connect_state_t sta static void CallLogCreatDir(void) { - DIR *dir = NULL; + DIR *dir = nullptr; dir = opendir(CALL_LOG_DIR); - if (dir == NULL) { + if (dir == nullptr) { mkdir(CALL_LOG_DIR, S_IREAD | S_IWRITE); } else { closedir(dir); @@ -717,8 +703,8 @@ static int GetCallLogFileSize(void) { int len = 0; FILE *fp = fopen(CALL_LOG_PATH, "rb"); - if (fp == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLogFileSize] fopen CALL_LOG_PATH error"); + if (fp == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLogFileSize] fopen %s failed", CALL_LOG_PATH); return OHOS_FAILURE; } @@ -727,25 +713,25 @@ static int GetCallLogFileSize(void) fseek(fp, 0, SEEK_SET); fclose(fp); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallLogFileSize] len = %d", len); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallLogFileSize] len:%d", len); return len; } // 添加通话进通话记录文件 static void AddToCallLog(CallLogInfo *info) { - FILE *fp = NULL; + FILE *fp = nullptr; size_t ret; fp = fopen(CALL_LOG_PATH, "ab"); - if (fp == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fopen failed!"); + if (fp == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fopen %s failed!", CALL_LOG_PATH); return; } ret = fwrite(info, sizeof(CallLogInfo), 1, fp); if (ret != 1) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fwrite failed! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fwrite failed! ret:%d", ret); } fclose(fp); @@ -754,13 +740,12 @@ static void AddToCallLog(CallLogInfo *info) static int CopyPhoneLogToTmpLog(void) { - FILE *fp = NULL; - FILE *ftp = NULL; - CallLogInfo *info = NULL; + FILE *fp = nullptr; + FILE *ftp = nullptr; + CallLogInfo *info = nullptr; int retLen; int fileSize = GetCallLogFileSize(); - if (fileSize == OHOS_FAILURE || fileSize == 0) { return fileSize; } @@ -770,30 +755,30 @@ static int CopyPhoneLogToTmpLog(void) return ClearCallLogFile(); // 只有一条记录,清空通话记录 } - fp = fopen(CALL_LOG_PATH,"rb"); - if (fp == NULL) { + fp = fopen(CALL_LOG_PATH, "rb"); + if (fp == nullptr) { return OHOS_FAILURE; } ftp = fopen(CALL_TMP_LOG_PATH, "wb+"); - if (ftp == NULL) { + if (ftp == nullptr) { fclose(fp); return OHOS_FAILURE; } info = (CallLogInfo *)malloc(fileSize); - if (info == NULL) { + if (info == nullptr) { fclose(fp); fclose(ftp); return OHOS_FAILURE; } (void)memset_s(info, fileSize, 0, fileSize); - if(fread(info, fileSize, 1, fp) != 1) { + if (fread(info, fileSize, 1, fp) != 1) { retLen = OHOS_FAILURE; goto END; } - if(fwrite((info + 1), retLen, 1, ftp) != 1) { + if (fwrite((info + 1), retLen, 1, ftp) != 1) { retLen = OHOS_FAILURE; goto END; } @@ -802,16 +787,16 @@ END: fclose(fp); fclose(ftp); free(info); - info = NULL; + info = nullptr; return retLen; } // 删除第一条通话记录 int RemoveFirstCallLog(void) { - FILE *fp = NULL; - FILE *ftp = NULL; - CallLogInfo *info = NULL; + FILE *fp = nullptr; + FILE *ftp = nullptr; + CallLogInfo *info = nullptr; int ret = OHOS_SUCCESS; int fileSize = CopyPhoneLogToTmpLog(); @@ -819,29 +804,29 @@ int RemoveFirstCallLog(void) return fileSize; } - fp = fopen(CALL_LOG_PATH,"wb+"); - if (fp == NULL) { + fp = fopen(CALL_LOG_PATH, "wb+"); + if (fp == nullptr) { return OHOS_FAILURE; } ftp = fopen(CALL_TMP_LOG_PATH, "rb"); - if (ftp == NULL) { + if (ftp == nullptr) { fclose(fp); return OHOS_FAILURE; } info = (CallLogInfo *)malloc(fileSize); - if (info == NULL) { + if (info == nullptr) { fclose(fp); fclose(ftp); return OHOS_FAILURE; } (void)memset_s(info, fileSize, 0, fileSize); - if(fread(info, fileSize, 1, ftp) != 1) { + if (fread(info, fileSize, 1, ftp) != 1) { ret = OHOS_FAILURE; goto END; } - if(fwrite(info, fileSize, 1, fp) != 1) { + if (fwrite(info, fileSize, 1, fp) != 1) { ret = OHOS_FAILURE; goto END; } @@ -850,33 +835,31 @@ END: fclose(fp); fclose(ftp); free(info); - info = NULL; + info = nullptr; return ret; } // 添加通话记录 static void AddToCallLogPro(PhoneCallInfo *callInfo) { - int ret, num, fileSize; - CallLogInfo info; - - if (callInfo == NULL) { + if (callInfo == nullptr) { return; } - fileSize = GetCallLogFileSize(); - num = fileSize / sizeof(CallLogInfo); + int fileSize = GetCallLogFileSize(); + int num = fileSize / sizeof(CallLogInfo); if (num >= CALL_LOG_MAX_NUM) { - ret = RemoveFirstCallLog(); + int ret = RemoveFirstCallLog(); if (ret == OHOS_FAILURE) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLogPro] RemoveFirstCallLog error"); return; } } + CallLogInfo info; (void)memset_s(info.name, NAME_SIZE, '\0', NAME_SIZE); (void)memset_s(info.tel, MAX_PHONE_NUM, '\0', MAX_PHONE_NUM); - ret = memcpy_s(info.name, NAME_SIZE, callInfo->name, callInfo->nameLen); + int ret = memcpy_s(info.name, NAME_SIZE, callInfo->name, callInfo->nameLen); if (ret != EOK) { info.nameLen = 0; } else { @@ -893,7 +876,7 @@ static void AddToCallLogPro(PhoneCallInfo *callInfo) info.creationTime = callInfo->creationTime; if (callInfo->lastStatus == HFP_HF_CALL_STATE_ACTIVE || callInfo->lastStatus == HFP_HF_CALL_STATE_HELD || callInfo->lastStatus == HFP_HF_CALL_STATE_RESPONSE_HELD) { - info.callDurTime = time(NULL) - callInfo->activeTime; + info.callDurTime = time(nullptr) - callInfo->activeTime; } else { info.callDurTime = 0; } @@ -912,40 +895,36 @@ static void AddToCallLogPro(PhoneCallInfo *callInfo) // 获取通话记录 int GetCallLog(CallLogInfo **info, int *num) { - FILE *fp = NULL; - int ret, fileSize, number; - CallLogInfo *callInfo = NULL; - - fp = fopen(CALL_LOG_PATH, "rb"); - if (fp == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fopen CALL_LOG_PATH failed!"); + FILE *fp = fopen(CALL_LOG_PATH, "rb"); + if (fp == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddToCallLog] fopen %s failed!", CALL_LOG_PATH); return OHOS_FAILURE; } - fileSize = GetCallLogFileSize(); + int fileSize = GetCallLogFileSize(); if (fileSize == 0) { - *info = NULL; + *info = nullptr; *num = 0; fclose(fp); return OHOS_SUCCESS; } - number = fileSize / sizeof(CallLogInfo); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallLog] fileSize = %d, number = %d", fileSize, number); - callInfo = (CallLogInfo *)malloc(fileSize); - if (callInfo == NULL) { + int number = fileSize / sizeof(CallLogInfo); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallLog] fileSize:%d, number:%d", fileSize, number); + CallLogInfo *callInfo = (CallLogInfo *)malloc(fileSize); + if (callInfo == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLog] malloc callInfo fail!"); - *info = NULL; + *info = nullptr; *num = 0; fclose(fp); return OHOS_FAILURE; } (void)memset_s(callInfo, fileSize, 0, fileSize); - ret = fread(callInfo, sizeof(CallLogInfo), number, fp); + int ret = fread(callInfo, sizeof(CallLogInfo), number, fp); if (ret != number) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLog] fread fp fail ret = %d", ret); - *info = NULL; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[GetCallLog] fread fp fail ret:%d", ret); + *info = nullptr; *num = 0; fclose(fp); return OHOS_FAILURE; @@ -961,8 +940,8 @@ int GetCallLog(CallLogInfo **info, int *num) int ClearCallLogFile(void) { FILE *fp = fopen(CALL_LOG_PATH, "wb"); - if (fp == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ClearCallLogFile] fopen CALL_LOG_PATH failed!"); + if (fp == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ClearCallLogFile] fopen %s failed!", CALL_LOG_PATH); return OHOS_FAILURE; } @@ -974,11 +953,11 @@ int ClearCallLogFile(void) static PhoneCallInfo *FindCallInfoInCallList(const unsigned char *number, unsigned char numberLen) { int i; - const char *str1 = NULL; - const char *str2 = NULL; + const char *str1 = nullptr; + const char *str2 = nullptr; if (g_currCallNum == 0) { - return NULL; + return nullptr; } for (i = 0; i < MULTI_CALL_MAX_NUME; i++) { @@ -994,7 +973,7 @@ static PhoneCallInfo *FindCallInfoInCallList(const unsigned char *number, unsign } } - return NULL; + return nullptr; } static void CatPhoneNumber(char *number, unsigned char len) @@ -1012,26 +991,23 @@ static void CatPhoneNumber(char *number, unsigned char len) static void AddCurrCallToCallList(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; - int tmp, ret; - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AddCurrCallToCallList] start, call->state = %d", call->state); - if (call == NULL || g_currCallNum >= MULTI_CALL_MAX_NUME || + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AddCurrCallToCallList] state:%d", call->state); + if (call == nullptr || g_currCallNum >= MULTI_CALL_MAX_NUME || (call->state != HFP_HF_CALL_STATE_ACTIVE && call->state != HFP_HF_CALL_STATE_HELD && call->state != HFP_HF_CALL_STATE_ALERTING)) { return; } g_currCallNum++; - tmp = g_currCallNum - 1; - phoneCall = &g_callList[tmp]; + int32_t tmp = g_currCallNum - 1; + PhoneCallInfo *phoneCall = &g_callList[tmp]; if (call->state == HFP_HF_CALL_STATE_ACTIVE) { // 正在通话 phoneCall->operate = OPERATE_PHONE_ACTIVE; - phoneCall->activeTime = time(NULL); + phoneCall->activeTime = time(nullptr); } else if (call->state == HFP_HF_CALL_STATE_HELD) { // 挂起 phoneCall->operate = OPERATE_PHONE_HOLD; - phoneCall->activeTime = time(NULL); + phoneCall->activeTime = time(nullptr); } else if (call->state == HFP_HF_CALL_STATE_ALERTING) { // 呼出,对方响铃 phoneCall->operate = OPERATE_ALERTING; } @@ -1039,11 +1015,11 @@ static void AddCurrCallToCallList(const hfp_hf_calls_info_t *call) // 使用通讯录接口获取当前电话对应的备注人名(通讯录待开发) phoneCall->lastStatus = call->state; - phoneCall->creationTime = time(NULL); + phoneCall->creationTime = time(nullptr); - ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); + int32_t ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddCurrCallToCallList] memcpy_s tel fail, ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AddCurrCallToCallList] copy tel ret:%d", ret); CatPhoneNumber(call->number, call->number_len); } phoneCall->telLen = call->number_len; @@ -1057,26 +1033,23 @@ static void AddCurrCallToCallList(const hfp_hf_calls_info_t *call) // 通话状态变化--呼出,正在拨号处理 static void CallChangeDialPro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; - int tmp, ret; - - if (call == NULL) { + if (call == nullptr) { return; } - g_currCallNum++; - tmp = g_currCallNum - 1; - phoneCall = &g_callList[tmp]; + g_currCallNum++; + int32_t tmp = g_currCallNum - 1; + PhoneCallInfo *phoneCall = &g_callList[tmp]; // 使用通讯录接口获取当前电话对应的备注人名(通讯录待开发) phoneCall->operate = OPERATE_DIALING; phoneCall->lastStatus = call->state; - phoneCall->creationTime = time(NULL); + phoneCall->creationTime = time(nullptr); - ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); + int32_t ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CallChangeDialPro] memcpy_s tel fail, ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CallChangeDialPro] copy tel ret:%d", ret); CatPhoneNumber(call->number, call->number_len); } phoneCall->telLen = call->number_len; @@ -1090,15 +1063,15 @@ static void CallChangeDialPro(const hfp_hf_calls_info_t *call) // 通话状态变化--呼出,对方响铃 static void CallChangeAlertPro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; + PhoneCallInfo *phoneCall = nullptr; - if (call == NULL) { + if (call == nullptr) { return; } phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); - if (phoneCall == NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeAlertPro] FindCallInfoInCallList Alert no this call"); + if (phoneCall == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeAlertPro] Alert no this call"); AddCurrCallToCallList(call); return; } @@ -1115,22 +1088,22 @@ void HfpIncomingEventPublish(uint16 topic, hfp_hf_calls_info_t callsInfo) { int32 ret; uint32 size = sizeof(hfp_hf_calls_info_t); - Request *request = NULL; - BroadcastApi *broadcastApi = NULL; - IUnknown *api = NULL; + Request *request = nullptr; + BroadcastApi *broadcastApi = nullptr; + IUnknown *api = nullptr; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HfpIncomingEventPublish topic=%u!!", topic); /* alloc request */ request = SAMGR_AllocRequestMsg(0, PLATFORM_CORE, BROADCAST_SVR_ID, size); - if (request == NULL) { + if (request == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SAMGR_AllocRequestMsg failed"); return; } request->msgId = topic; ret = memcpy_s(request->data, size, (const void *)&callsInfo, size); if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HfpIncomingEventPublish memcpy_s rateDataTmp fail! ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HfpIncomingEventPublish memcpy_s rateDataTmp fail! ret:%d", ret); return; } request->len = size; @@ -1138,13 +1111,13 @@ void HfpIncomingEventPublish(uint16 topic, hfp_hf_calls_info_t callsInfo) /* public request */ api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetFeatureApi failed"); SAMGR_FreeRequestMsg(request); return; } ret = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (ret != 0 || broadcastApi == NULL) { + if (ret != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "QueryInterface failed"); SAMGR_FreeRequestMsg(request); return; @@ -1159,20 +1132,17 @@ void HfpIncomingEventPublish(uint16 topic, hfp_hf_calls_info_t callsInfo) // 通话状态变化--呼入处理 static void CallChangeIncomePro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; - int tmp, ret; - - if (call == NULL || g_currCallNum >= MULTI_CALL_MAX_NUME || + if (call == nullptr || g_currCallNum >= MULTI_CALL_MAX_NUME || (call->state != HFP_HF_CALL_STATE_INCOMING && call->state != HFP_HF_CALL_STATE_WAITING)) { return; } - phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); - if (phoneCall != NULL) { + PhoneCallInfo *phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); + if (phoneCall != nullptr) { // 通话状态由呼入等待转换成呼入情况 } else { g_currCallNum++; - tmp = g_currCallNum - 1; + int32_t tmp = g_currCallNum - 1; phoneCall = &g_callList[tmp]; } @@ -1184,11 +1154,11 @@ static void CallChangeIncomePro(const hfp_hf_calls_info_t *call) phoneCall->operate = OPERATE_WAITING; } phoneCall->lastStatus = call->state; - phoneCall->creationTime = time(NULL); + phoneCall->creationTime = time(nullptr); - ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); + int32_t ret = memcpy_s(phoneCall->tel, MAX_PHONE_NUM, call->number, call->number_len); if (ret != EOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CallChangeIncomePro] memcpy_s tel fail, ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[CallChangeIncomePro] copy tel ret:%d", ret); CatPhoneNumber(call->number, call->number_len); } phoneCall->telLen = call->number_len; @@ -1204,22 +1174,22 @@ static void CallChangeIncomePro(const hfp_hf_calls_info_t *call) // 通话状态变化--接听流程处理 static void CallChangeActivePro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; + PhoneCallInfo *phoneCall = nullptr; - if (call == NULL) { + if (call == nullptr) { return; } phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); - if (phoneCall == NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeActivePro] FindCallInfoInCallList Active no this call"); + if (phoneCall == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeActivePro] Active no this call"); AddCurrCallToCallList(call); return; } - if (phoneCall->lastStatus == HFP_HF_CALL_STATE_HELD && IsCompleteCallFlow() == true) { // 挂起状态切换到接听状态 + if (phoneCall->lastStatus == HFP_HF_CALL_STATE_HELD && IsCompleteCallFlow()) { // 挂起状态切换到接听状态 phoneCall->operate = OPERATE_WATCH_ACTIVE; - } else if (phoneCall->lastStatus == HFP_HF_CALL_STATE_HELD && IsCompleteCallFlow() == false) { + } else if (phoneCall->lastStatus == HFP_HF_CALL_STATE_HELD && (!IsCompleteCallFlow())) { phoneCall->operate = OPERATE_PHONE_ACTIVE; } else if (phoneCall->operate == OPERATE_WATCH_ACTIVE) { // 手表接听 // 不做操作 @@ -1237,7 +1207,7 @@ static void CallChangeActivePro(const hfp_hf_calls_info_t *call) if (phoneCall->activeTime == 0 && (phoneCall->lastStatus == HFP_HF_CALL_STATE_DIALING || phoneCall->lastStatus == HFP_HF_CALL_STATE_ALERTING || phoneCall->lastStatus == HFP_HF_CALL_STATE_INCOMING || phoneCall->lastStatus == HFP_HF_CALL_STATE_WAITING)) { - phoneCall->activeTime = time(NULL); + phoneCall->activeTime = time(nullptr); } phoneCall->lastStatus = call->state; @@ -1245,7 +1215,7 @@ static void CallChangeActivePro(const hfp_hf_calls_info_t *call) if (phoneCall->operate == OPERATE_PHONE_ACTIVE) { // 发布电话接听事件,手表关闭来电通知 HfpIncomingEventPublish(TOPIC_EVENT_HFP_PHONE_ACTIVE, phoneCall->unitCalls); - } else if (phoneCall->operate == OPERATE_WATCH_ACTIVE) { + } else if (phoneCall->operate == OPERATE_WATCH_ACTIVE && g_scoFlag == HFP_SCO_STATE_CONNECTED) { // 发布手表接听事件,通知切换接听界面 HfpIncomingEventPublish(TOPIC_EVENT_HFP_WATCH_ACTIVE, phoneCall->unitCalls); } @@ -1256,18 +1226,18 @@ static void CallChangeActivePro(const hfp_hf_calls_info_t *call) // 通话状态变化--拒接/结束流程处理 static void CallChangeFinishPro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; + PhoneCallInfo *phoneCall = nullptr; PhoneCallInfo tmp; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] start g_scoFlag = %d, g_currCallNum = %d", + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] start scoFlag:%d, CallNum:%d", g_scoFlag, g_currCallNum); - if (call == NULL || g_currCallNum == 0) { + if (call == nullptr || g_currCallNum == 0) { return; } phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); - if (phoneCall == NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] FindCallInfoInCallList Finish no this call"); + if (phoneCall == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] Finish no this call"); return; } if (g_finishOperate == OPERATE_WATCH_FINISH) { @@ -1295,22 +1265,22 @@ static void CallChangeFinishPro(const hfp_hf_calls_info_t *call) // 通知手表通话结束 CallChangedCb(&tmp); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] end g_scoFlag = %d, g_currCallNum = %d", - g_scoFlag, g_currCallNum); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] end scoFlag:%d, CallNum:%d", + g_scoFlag, g_currCallNum); } // 通话状态变化--挂起通话(当前只有手机挂起触发(并且手表不需感知),手表不支持挂起触发,对方挂起不感知) static void CallChangeHeldPro(const hfp_hf_calls_info_t *call) { - PhoneCallInfo *phoneCall = NULL; + PhoneCallInfo *phoneCall = nullptr; - if (call == NULL) { + if (call == nullptr) { return; } phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); - if (phoneCall == NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeHeldPro] FindCallInfoInCallList Held no this call"); + if (phoneCall == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeHeldPro] Held no this call"); AddCurrCallToCallList(call); return; } @@ -1318,7 +1288,7 @@ static void CallChangeHeldPro(const hfp_hf_calls_info_t *call) // 手机挂起通话 phoneCall->operate = OPERATE_PHONE_HOLD; if (phoneCall->lastStatus == HFP_HF_CALL_STATE_INCOMING || phoneCall->lastStatus == HFP_HF_CALL_STATE_WAITING) { - phoneCall->activeTime = time(NULL); + phoneCall->activeTime = time(nullptr); } phoneCall->lastStatus = call->state; (void)memcpy_s(&phoneCall->unitCalls, sizeof(hfp_hf_calls_info_t), call, sizeof(hfp_hf_calls_info_t)); @@ -1330,20 +1300,15 @@ static void CallChangeHeldPro(const hfp_hf_calls_info_t *call) static void PlayWatchRing(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayWatchRing] start"); - // 申请手表铃声焦点 - // AudioActInterrupt(AUDIO_STREAM_RING); - // 播放手表铃声(播放方案待定) } static void CallAudioHandle(const hfp_hf_calls_info_t *call) { int state = call->state; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallAudioHandle] start g_audioState: %d", g_audioState); - if (state == HFP_HF_CALL_STATE_INCOMING || state == HFP_HF_CALL_STATE_DIALING || state == HFP_HF_CALL_STATE_ALERTING) { // 电话呼入,支持播放手机铃声 - if (call->in_band_ring == true) { + if (call->in_band_ring) { // 播放手机端铃声 PostGraphicEvent(AudioDn); } else { @@ -1355,27 +1320,18 @@ static void CallAudioHandle(const hfp_hf_calls_info_t *call) } else if (state == HFP_HF_CALL_STATE_FINISHED) { return; } else if (g_scoFlag == HFP_SCO_STATE_CONNECTED) { - if (g_audioState < AUDIO_STREAM_START_DN) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallAudioHandle] post AudioDn"); - PostGraphicEvent(AudioDn); - } - if (g_audioState != AUDIO_STREAM_START_UP) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallAudioHandle] post AudioUp"); - PostGraphicEvent(AudioUp); - } + PostGraphicEvent(AudioSetup); } - - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallAudioHandle] end g_audioState: %d", g_audioState); } static void CatCallStateChangedInfo(const bd_addr_t *bdAddr, const hfp_hf_calls_info_t *call) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "***************************CallStateChanged***************************"); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "g_scoFlag = %d, g_currCallNum = %d, bdAddr: ", g_scoFlag, g_currCallNum); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "scoFlag:%d, CallNum:%d, bdAddr: ", g_scoFlag, g_currCallNum); CatBdAddr(bdAddr); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "id = %d, state = %d", call->id, call->state); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "id:%d, state:%d", call->id, call->state); CatPhoneNumber(call->number, call->number_len); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "multi_party = %d, outgoing = %d, in_band_ring = %d, creation_time = %ld", + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "multi_party:%d, outgoing:%d, in_band_ring:%d, creation_time:%ld", call->multi_party, call->outgoing, call->in_band_ring, call->creation_time); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "***********************************************************************"); } @@ -1402,7 +1358,7 @@ bool IsCompleteCallFlow(void) static void CallStateChanged(const bd_addr_t *bdAddr, const hfp_hf_calls_info_t *call) { CopyBdAddr(bdAddr); - if (call == NULL || g_btConnState != PROFILE_STATE_CONNECTED) { + if (call == nullptr || g_btConnState != PROFILE_STATE_CONNECTED) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "call is null or BT disconnected connStatus: 0x%X", g_btConnState); return; } @@ -1411,7 +1367,7 @@ static void CallStateChanged(const bd_addr_t *bdAddr, const hfp_hf_calls_info_t CatCallStateChangedInfo(bdAddr, call); CallAudioHandle(call); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "CallStateChanged state = %d", call->state); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "CallStateChanged state:%d", call->state); switch (call->state) { case HFP_HF_CALL_STATE_ACTIVE: // 正在通话 CallChangeActivePro(call); @@ -1453,37 +1409,31 @@ static void CallStateChanged(const bd_addr_t *bdAddr, const hfp_hf_calls_info_t } if (g_currCallNum == 0) { - PostGraphicEvent(AudioRelease); g_completeCallFlag = false; } } -static int g_hfpVolumeType; -static unsigned char g_hfpVolume; - -static void BtHfpVolumeChanged(void) +static void BtHfpVolumeChanged(int volumeType, unsigned char hfpVolume) { - int maxVolume, minVolume, tmp; - bool ret; - // mic - if (g_hfpVolumeType == HFP_VOLUME_MIC) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BtHfpVolumeChanged] g_hfpVolumeType = %d, g_hfpVolume = %d ", - g_hfpVolumeType, g_hfpVolume); + if (volumeType == HFP_VOLUME_MIC) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeChanged Type:%d, hfpVolume:%d", + volumeType, hfpVolume); } // speak - if (g_hfpVolumeType == HFP_VOLUME_SPEAKER) { - minVolume = PhoneAudioGetMinVolume(); - maxVolume = PhoneAudioGetMaxVolume(); - tmp = g_hfpVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 - - ret = PhoneAudioSetVolume(tmp); - if (ret != true) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BtHfpVolumeChanged] g_hfpVolumeType: %d, ret: %d", g_hfpVolumeType, ret); + if (volumeType == HFP_VOLUME_SPEAKER) { + int32_t minVolume = PhoneAudioGetMinVolume(); + int32_t maxVolume = PhoneAudioGetMaxVolume(); + int32_t volume = hfpVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 + volume = (volume == 0) ? ((maxVolume - minVolume) / CALL_VOLUME_MAX) : volume; + bool ret = PhoneAudioSetVolume(volume); + if (!ret) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeChanged Type:%d, ret:%d", + volumeType, ret); } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BtHfpVolumeChanged] g_hfpVolumeType: %d, minVolume: %d, maxVolume: %d tmp: %d\ - ret: %d ", g_hfpVolumeType, minVolume, maxVolume, tmp, ret); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VolumeChanged Type:%d, min:%d, max:%d volume:%d ret:%d", + volumeType, minVolume, maxVolume, volume, ret); } } @@ -1491,17 +1441,15 @@ static void BtHfpVolumeChanged(void) static void VolumeChanged(const bd_addr_t *bdAddr, hfp_volume_type_t type, unsigned char volume) { UNUSED(bdAddr); - g_hfpVolumeType = type; - g_hfpVolume = volume; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VolumeChanged] type = %d volume = %d", type, volume); - PostGraphicEvent(BtHfpVolumeChanged); // 解决SdkMsgThread爆栈问题 + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VolumeChanged] type:%d volume:%d", type, volume); + GraphicService::GetInstance()->PostGraphicEvent(std::bind(BtHfpVolumeChanged, type, volume)); } // 拨号失败回调 static void DialErrorCode(const bd_addr_t *bdAddr, int code) { UNUSED(bdAddr); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[DialErrorCode] code = %d", code); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[DialErrorCode] code:%d", code); PhoneServiceErrorCallback(ERROR_DIAL, code); } @@ -1509,28 +1457,28 @@ static void HfpBatteryChanged(const bd_addr_t *bdAddr, int batteryLevel) { UNUSED(bdAddr); UNUSED(batteryLevel); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpBatteryChanged] batteryLevel: %d", batteryLevel); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpBatteryChanged] batteryLevel:%d", batteryLevel); } static void HfpSignalStrengthChanged(const bd_addr_t *bdAddr, int signalStrength) { UNUSED(bdAddr); UNUSED(signalStrength); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpSignalStrengthChanged] signalStrength: %d", signalStrength); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpSignalStrengthChanged] signalStrength:%d", signalStrength); } static void HfpRegistStatusChanged(const bd_addr_t *bdAddr, int status) { UNUSED(bdAddr); UNUSED(status); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpRegistStatusChanged] status: %d", status); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpRegistStatusChanged] status:%d", status); } static void HfpRoamingStatusChanged(const bd_addr_t *bdAddr, int status) { UNUSED(bdAddr); UNUSED(status); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpRoamingStatusChanged] status: %d", status); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpRoamingStatusChanged] status:%d", status); } static void HfpOperatorSelection(const bd_addr_t *bdAddr, unsigned char *name, unsigned int len) @@ -1538,7 +1486,7 @@ static void HfpOperatorSelection(const bd_addr_t *bdAddr, unsigned char *name, u UNUSED(bdAddr); UNUSED(name); UNUSED(len); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpOperatorSelection] name: %s, len: %d", name, len); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpOperatorSelection] name: %s, len:%d", name, len); } static void HfpSubscriberNumber(const bd_addr_t *bdAddr, unsigned char *number, unsigned int len) @@ -1546,21 +1494,21 @@ static void HfpSubscriberNumber(const bd_addr_t *bdAddr, unsigned char *number, UNUSED(bdAddr); UNUSED(number); UNUSED(len); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpSubscriberNumber] number: %s, len: %d", number, len); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[HfpSubscriberNumber] number: %s, len:%d", number, len); } static void VoiceRecogStatusChanged(const bd_addr_t *bdAddr, int status) { UNUSED(bdAddr); UNUSED(status); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VoiceRecogStatusChanged] status: %d", status); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[VoiceRecogStatusChanged] status:%d", status); } static void InbandRingtoneChanged(const bd_addr_t *bdAddr, int status) { UNUSED(bdAddr); UNUSED(status); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[InbandRingtoneChanged] status: %d", status); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[InbandRingtoneChanged] status:%d", status); } static void CodecChanged(const bd_addr_t *bdAddr, int codec) @@ -1571,7 +1519,7 @@ static void CodecChanged(const bd_addr_t *bdAddr, int codec) } else if (codec == HFP_HF_CODEC_ID_MSBC) { g_call_codec = mSBC; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CodecChanged] codec: %d, call_codec: %d", codec, g_call_codec); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CodecChanged] codec:%d, call_codec:%d", codec, g_call_codec); } @@ -1598,7 +1546,7 @@ static void RegisterHfpHfCallbacks(void) ret = hfp_hf_register_callbacks(&callbacks); if (ret != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[RegisterHfpHfCallbacks] ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[RegisterHfpHfCallbacks] ret:%d", ret); } } @@ -1622,7 +1570,7 @@ void PhoneServiceInit(void) int DialCall(unsigned char *number, unsigned char len) { int ret; - unsigned char *tel = NULL; + unsigned char *tel = nullptr; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[DialCall] start"); if (g_btConnState != PROFILE_STATE_CONNECTED) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] BT connStatus: 0x%X", g_btConnState); @@ -1630,13 +1578,13 @@ int DialCall(unsigned char *number, unsigned char len) } // 有通话时,不允许拨出电话 - if (g_currCallNum > 0 || len > MAX_PHONE_NUM || number == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] g_currCallNum = %d", g_currCallNum); + if (g_currCallNum > 0 || len > MAX_PHONE_NUM || number == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] g_currCallNum:%d", g_currCallNum); return OHOS_FAILURE; } tel = (unsigned char *)malloc(len + 1); - if (tel == NULL) { + if (tel == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] malloc tel error"); return OHOS_FAILURE; } @@ -1644,7 +1592,7 @@ int DialCall(unsigned char *number, unsigned char len) *(tel + len) = '\0'; ret = hfp_hf_start_dial(&g_bdAddr, tel, len); if (ret != ERRCODE_BT_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] hfp_hf_start_dial error ret %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DialCall] hfp_hf_start_dial ret %d", ret); free(tel); return OHOS_FAILURE; } @@ -1657,8 +1605,8 @@ int DialCall(unsigned char *number, unsigned char len) int AcceptIncomingCall(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] start"); - int ret, i; - PhoneCallInfo *phoneCall = NULL; + int32_t ret; + PhoneCallInfo *phoneCall = nullptr; PhoneCallInfo *tmp = g_callList; if (g_btConnState != PROFILE_STATE_CONNECTED) { @@ -1666,7 +1614,7 @@ int AcceptIncomingCall(void) return OHOS_FAILURE; } - for (i = 0; i < MULTI_CALL_MAX_NUME; i++) { + for (int32_t i = 0; i < MULTI_CALL_MAX_NUME; i++) { if (tmp->lastStatus == HFP_HF_CALL_STATE_INCOMING || tmp->lastStatus == HFP_HF_CALL_STATE_WAITING) { phoneCall = tmp; break; @@ -1674,7 +1622,7 @@ int AcceptIncomingCall(void) tmp++; } - if (phoneCall == NULL) { + if (phoneCall == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] no incoming"); return OHOS_FAILURE; } @@ -1687,7 +1635,7 @@ int AcceptIncomingCall(void) ret = hfp_hf_accept_incoming_call(&g_bdAddr, HFP_HF_ACCEPT_CALL_ACTION_NONE); // 无人通话,有人呼入,接听呼入电话 } if (ret != ERRCODE_BT_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] hfp_hf_accept_incoming_call error ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] ret:%d", ret); phoneCall->operate = OPERATE_NO_OPE; return OHOS_FAILURE; } @@ -1699,8 +1647,7 @@ int AcceptIncomingCall(void) int RejectIncomingCall(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[RejectIncomingCall] start"); - int ret, i; - PhoneCallInfo *phoneCall = NULL; + PhoneCallInfo *phoneCall = nullptr; PhoneCallInfo *tmp = g_callList; if (g_btConnState != PROFILE_STATE_CONNECTED) { @@ -1708,21 +1655,21 @@ int RejectIncomingCall(void) return OHOS_FAILURE; } - for (i = 0; i < MULTI_CALL_MAX_NUME; i++) { + for (int32_t i = 0; i < MULTI_CALL_MAX_NUME; i++) { if (tmp->lastStatus == HFP_HF_CALL_STATE_INCOMING || tmp->lastStatus == HFP_HF_CALL_STATE_WAITING) { phoneCall = tmp; } tmp++; } - if (phoneCall == NULL) { + if (phoneCall == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] no incoming"); return OHOS_SUCCESS; } - ret = hfp_hf_reject_incoming_call(&g_bdAddr); + int32_t ret = hfp_hf_reject_incoming_call(&g_bdAddr); if (ret != ERRCODE_BT_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[RejectIncomingCall] hfp_hf_reject_incoming_call error ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[RejectIncomingCall] ret:%d", ret); return OHOS_FAILURE; } g_finishOperate = OPERATE_WATCH_REJECT; @@ -1733,19 +1680,17 @@ int RejectIncomingCall(void) // 手表结束通话 int FinishCall(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[FinishCall] start"); - if (g_btConnState != PROFILE_STATE_CONNECTED) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[FinishCall] BT connStatus: 0x%X", g_btConnState); return OHOS_FAILURE; } int ret = hfp_hf_finish_call(&g_bdAddr); if (ret != ERRCODE_BT_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[FinishCall] hfp_hf_finish_call error ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[FinishCall] ret:%d", ret); return OHOS_FAILURE; } g_finishOperate = OPERATE_WATCH_FINISH; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[FinishCall] success!"); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "FinishCall"); return OHOS_SUCCESS; } @@ -1765,11 +1710,10 @@ int GetCurrCallNum(void) */ int GetCallInfoInCallList(PhoneCallInfo callList[], int listNum, int *retNum) { - int i, len; PhoneCallInfo *tmp = g_callList; PhoneCallInfo *tmp2 = callList; - if (callList == NULL || listNum < MULTI_CALL_MAX_NUME) { + if (callList == nullptr || listNum < MULTI_CALL_MAX_NUME) { *retNum = 0; return OHOS_FAILURE; } @@ -1779,8 +1723,8 @@ int GetCallInfoInCallList(PhoneCallInfo callList[], int listNum, int *retNum) return OHOS_SUCCESS; } - len = sizeof(PhoneCallInfo); - for (i = 0; i < MULTI_CALL_MAX_NUME; i++) { + int32_t len = sizeof(PhoneCallInfo); + for (int32_t i = 0; i < MULTI_CALL_MAX_NUME; i++) { if (tmp->lastStatus == HFP_HF_CALL_STATE_FINISHED) { tmp++; } else { @@ -1794,71 +1738,46 @@ int GetCallInfoInCallList(PhoneCallInfo callList[], int listNum, int *retNum) return OHOS_SUCCESS; } -static unsigned char g_changeSpkVolume; - -static void GetCallCurrVolumeEvent(void) -{ - int volume; - int minVolume; - int maxVolume; - unsigned char tmp; - - volume = PhoneAudioGetVolume(); - minVolume = PhoneAudioGetMinVolume(); - maxVolume = PhoneAudioGetMaxVolume(); - tmp = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 - - if (volume != 0 && tmp == 0) { - tmp = 1; - } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallCurrVolumeEvent] volume = %d, minVolume = %d, maxVolume = %d, tmp = %d", - volume, minVolume, maxVolume, tmp); - g_changeSpkVolume = tmp; -} - // 获取当前通话音量大小 (0 - 15) +// hfp音量范围 0-15, media 音量范围 0-100 unsigned char GetCallCurrVolume(void) { - GetCallCurrVolumeEvent(); - return g_changeSpkVolume; + int32_t volume = PhoneAudioGetVolume(); + int32_t minVolume = PhoneAudioGetMinVolume(); + int32_t maxVolume = PhoneAudioGetMaxVolume(); + unsigned char hfpVolume = (unsigned char)((volume * CALL_VOLUME_MAX) / (maxVolume - minVolume)); // 转换 + + if (volume != 0 && hfpVolume == 0) { + hfpVolume = 1; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[GetCallCurrVolume] volume:%d, minVolume:%d, maxVolume:%d, hfpVolume:%d", + volume, minVolume, maxVolume, hfpVolume); + return hfpVolume; } -static void SetSpeakerVolumeEvent(void) +void SetSpeakerVolume(unsigned char hfpVolume) { - int ret, minVolume, maxVolume, tmp; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] start, hfpVolume:%d", hfpVolume); + int32_t minVolume = PhoneAudioGetMinVolume(); + int32_t maxVolume = PhoneAudioGetMaxVolume(); + int32_t volume = hfpVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] minVolume:%d, maxVolume:%d, volume:%d", + minVolume, maxVolume, volume); - minVolume = PhoneAudioGetMinVolume(); - maxVolume = PhoneAudioGetMaxVolume(); - tmp = g_changeSpkVolume * (maxVolume - minVolume) / CALL_VOLUME_MAX; // 转换 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolumeEvent] minVolume = %d, maxVolume = %d, tmp = %d", - minVolume, maxVolume, tmp); - - ret = PhoneAudioSetVolume(tmp); - if (ret != true) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolumeEvent] PhoneAudioSetVolume ret = %d", ret); + int32_t ret = PhoneAudioSetVolume(volume); + if (!ret) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] PhoneAudioSetVolume ret:%d", ret); return; } - ret = hfp_hf_set_volume(&g_bdAddr, HFP_VOLUME_SPEAKER, g_changeSpkVolume); + ret = hfp_hf_set_volume(&g_bdAddr, HFP_VOLUME_SPEAKER, hfpVolume); if (ret != ERRCODE_BT_SUCCESS) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolumeEvent] hfp_hf_set_volume fail ret = %d, g_changeSpkVolume = %d", - ret, g_changeSpkVolume); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] set_volume ret:%d, hfpVolume:%d", + ret, hfpVolume); return; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolumeEvent] success!"); -} - -// 设置手表通话Speaker音量:0 - 15 -void SetSpeakerVolume(unsigned char volume) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] start, volume = %d", volume); - if (volume > CALL_VOLUME_MAX) { - g_changeSpkVolume = CALL_VOLUME_MAX; - } else { - g_changeSpkVolume = volume; - } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[SetSpeakerVolume] success!"); - SetSpeakerVolumeEvent(); return; } @@ -1897,7 +1816,7 @@ int TransCallToWatch(void) } else { ret = hfp_hf_connect_sco(&g_bdAddr); if (ret != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TransCallToWatch] ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TransCallToWatch] ret:%d", ret); } return ret; } @@ -1920,7 +1839,7 @@ int TransCallToMobilePhone(void) } else { ret = hfp_hf_disconnect_sco(&g_bdAddr); if (ret != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TransCallToMobilePhone] ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TransCallToMobilePhone] ret:%d", ret); } return ret; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h index 724c7394d..61e90947c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersModel.h @@ -8,7 +8,7 @@ #ifndef PLAYERS_MODEL_H #define PLAYERS_MODEL_H -#include "stdio.h" +#include #include "gfx_utils/list.h" #include "UiServersMsg.h" #include "player.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h index 7446839c5..f955b7142 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h @@ -108,8 +108,7 @@ private: void SoundButtonOnClick(); void PlayerModelButtonOnClick(); void OptionsButtonOnClick(); - VolumeSettingView *volumeSetting{nullptr}; - UIViewGroup *volumeSettingView{nullptr}; + VolumeSettingView *volumeSettingView{nullptr}; }; // 播放器回调 @@ -159,7 +158,7 @@ class PlayerOnDragListener : public UIView::OnDragListener { public: PlayerOnDragListener(); ~PlayerOnDragListener(); - virtual bool OnDragEnd(UIView& view, const DragEvent& event) override; + bool OnDragEnd(UIView& view, const DragEvent& event) override; bool OnDrag(UIView& view, const DragEvent& event) override; static PlayerOnDragListener *GetInstance(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h index 6be9d5a5c..5ad0ba1ec 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h @@ -35,7 +35,7 @@ class PlayersCaseListAdapter; class PlayersView : public UICardPage { public: PlayersView(); - virtual ~PlayersView(); + ~PlayersView() override; static PlayersView *GetInstance(void); bool InitView(void); void PreLoad(void) override; @@ -101,7 +101,7 @@ private: JumpView *jumpView{nullptr}; PlayersPresenter *playersPresenter{nullptr}; PlayerOnDragListener *playerOnDragListener{nullptr}; - uint8_t state = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; + uint8_t state_ = UICheckBox::UICheckBoxState::MAX_STATUS_NUM; UIView::OnClickListener *playerlistener{nullptr}; UIView::OnClickListener *soundlistener{nullptr}; UIView::OnClickListener *nextlistener{nullptr}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/BluetoothView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/BluetoothView.cpp index b6534909a..dfae52888 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/BluetoothView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/BluetoothView.cpp @@ -43,13 +43,12 @@ BluetoothView::BluetoothView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothView::BluetoothView"); g_bluetoothView = this; - } BluetoothView::~BluetoothView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothView::~BluetoothView"); - group->RemoveAll(); + group->RemoveAll(); UIView::OnClickListener *click = watchButton->GetOnClickListener(); if (click != nullptr) { delete click; @@ -116,7 +115,7 @@ UIRadioButton *BluetoothView::GetPhoneButton(void) // Button OnClick class BluetoothOnClickListener : public UIView::OnClickListener { public: - BluetoothOnClickListener(UIView* view) : view_(view){} + explicit BluetoothOnClickListener(UIView* view) : view_(view) {} ~BluetoothOnClickListener() {} bool OnClick(UIView& view, const ClickEvent& event) override diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersCaseListAdapter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersCaseListAdapter.cpp index a6547efa4..b9e550257 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersCaseListAdapter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersCaseListAdapter.cpp @@ -65,8 +65,7 @@ bool BtnOnClickListListener::OnClick(UIView& view, const ClickEvent& event) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "uri: %s.", PlayersModel::GetInstance()->GetPlayerUri().c_str()); std::string strSongName = sliceId_; std::string pureName = strSongName.substr(0, strSongName.rfind(".")); - const char *songName = pureName.c_str(); - playersView->TitleSetText(songName); + playersView->TitleSetText(pureName.c_str()); playersView->SetPlayerListGroupStatus(false); // 刷新UI RootView::GetInstance()->Invalidate(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp index fbcd64fd8..4e4462847 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersModel.cpp @@ -33,7 +33,7 @@ PlayersModel::~PlayersModel() bool PlayersModel::FetchedPlayersCallBack(PlayersMsg *playersMsg) { - if (listPlayers.IsEmpty() == true) { + if (listPlayers.IsEmpty()) { return false; } else { MUTEX_Lock(g_mutex); @@ -140,7 +140,7 @@ bool PlayersModel::GetAudioInitStatus(void) void PlayersModel::AudioInit(void) { - if (audioInitStatus == true) { + if (audioInitStatus) { return; } AudioManager& amIntance = AudioManager::GetInstance(); @@ -195,7 +195,7 @@ void PlayersModel::PlaySwitching(void) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlaySwitching playerModel1 %d!!!", GetPlayerModel()); int32_t ret; PlayersMsg playersMsg; - if (FetchedPlayersCallBack(&playersMsg) == true) { + if (FetchedPlayersCallBack(&playersMsg)) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FetchedPlayersCallBack true"); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Stop to play"); switch (playersMsg.playerModel) { @@ -239,7 +239,6 @@ int PlayersModel::PlayerInit(void) } std::string strSongName = sliceId; std::string pureName = strSongName.substr(0, strSongName.rfind(".")); - const char *songName = pureName.c_str(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayerInit, url: %s ", sliceId); std::string strSrcMusic(APP_MUSIC_PATH); std::string tempStr("/"); @@ -251,7 +250,7 @@ int PlayersModel::PlayerInit(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayerInit playersPresenter GetInstance fail"); return OHOS_FAILURE; } - playersPresenter->SetTitleSetText(songName); + playersPresenter->SetTitleSetText(pureName.c_str()); playersPresenter->SetPlaybackProgress(circleProgress); playersPresenter->SetPlayerState(playButtonState); return 0; @@ -274,10 +273,9 @@ void PlayersModel::NextSong(int16_t index) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "uri: %s.", GetPlayerUri().c_str()); std::string strSongName = sliceId; std::string pureName = strSongName.substr(0, strSongName.rfind(".")); - const char *songName = pureName.c_str(); PlayersPresenter *playersPresenter = PlayersPresenter::GetInstance(); if (playersPresenter != nullptr) { - playersPresenter->SetTitleSetText(songName); + playersPresenter->SetTitleSetText(pureName.c_str()); playersPresenter->SetPlaybackProgress(0); // 0:进度0% } int32_t ret; @@ -358,7 +356,7 @@ void PlayersModel::RandomPlayout() { int16_t random; int16_t indexMax; - srand((unsigned)time(NULL)); + srand((unsigned)time(nullptr)); List &playersCaseList = PlayersListGroup::GetInstance()->GetCase(); indexMax = playersCaseList.Size() - 1; random = (rand() % (indexMax + 1)); @@ -687,7 +685,6 @@ void PlayersModel::ConnectBtAndLocalPlay(int32_t connCtState, int32_t connTgStat WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PlayersModel::ConnBtAndLocalPlay] BTPlayerStat err, ret:%d", ret); } PlayersModel::GetInstance()->SetBTMusicPlay(playNotification); - } } else { if (playerState == PlayerStates::PLAYER_PAUSED) { @@ -700,7 +697,6 @@ void PlayersModel::ConnectBtAndLocalPlay(int32_t connCtState, int32_t connTgStat } } } - } // 蓝牙连接和本地音乐的暂停 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp index cdafd264c..cd2d0f4a3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "PlayersPresenter.h" #include "wearable_log.h" #include "common/image_cache_manager.h" @@ -219,7 +219,6 @@ bool JumpView::ChangeBluetoothDeviceListView(int16_t hideView, int16_t thisView) } deviceList->RefreshList(); } - BluetoothDeviceListView *bluetoothDeviceListView = BluetoothDeviceListView::GetInstance(); if (bluetoothDeviceListView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick bluetoothDeviceListView new fail"); return false; @@ -249,14 +248,13 @@ bool JumpView::ChangeBluetoothReconnectView(int16_t hideView, int16_t thisView) RootView::GetInstance()->Add(container[thisView]); } BluetoothModel::GetInstance()->SetTagDisconnectView(true); - BluetoothReconnectView::GetInstance()->RefreshBluetoothNameLabel(); + bluetoothReconnectView->RefreshBluetoothNameLabel(); bluetoothReconnectView->BtReconnectStart(); return true; } void JumpView::ResetEarListView(int16_t hideView) { - BluetoothEarListView *bluetoothEarListView = BluetoothEarListView::GetInstance(); if (bluetoothEarListView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::ResetEarListView bluetoothEarListView == nullptr"); return; @@ -313,7 +311,6 @@ bool JumpView::ChangeTipsConnFailMessageView(int16_t hideView, int16_t thisView) container[thisView] = group; RootView::GetInstance()->Add(container[thisView]); } - BluetoothReconnectView *bluetoothReconnectView = BluetoothReconnectView::GetInstance(); if (bluetoothReconnectView == nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GapAclStateChangedCallback bluetoothReconnectView == nullptr"); } else { @@ -374,14 +371,14 @@ bool JumpView::CheckViewParam(int16_t hideView, int16_t showView) void JumpView::ChangeView(int16_t hideView, int16_t showView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "JumpView:: ChangeView %d", hideView); - if (CheckViewParam(hideView, showView) == false) { + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "JumpView::ChangeView check param err %d %d.", hideView, showView); return; } PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) { + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "JumpView::ChangeView %d %d failed", showView, hideView); return; } @@ -456,8 +453,8 @@ int PlayersListGroup::GetAllFiles(List *playersCaseList) // 打开目录 DIR *dirp = opendir(APP_MUSIC_PATH); // 遍历文件 - if (dirp != NULL) { - while ((direntp = readdir(dirp)) != NULL) { + if (dirp != nullptr) { + while ((direntp = readdir(dirp)) != nullptr) { ret = memcpy_s(playerCaseInfo.sliceId, DEC_NUM_256, direntp->d_name, DEC_NUM_256); if (ret != OHOS_SUCCESS) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "memcpy_s err %d.", ret); @@ -536,23 +533,24 @@ void ButtonOnClickListener::SoundButtonOnClick() return; } if (volumeSettingView == nullptr) { - volumeSetting = new VolumeSettingView(); - if (volumeSetting == nullptr) { + volumeSettingView = new VolumeSettingView(); + if (volumeSettingView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "volumeSetting nullptr err"); return; } - if (volumeSetting->SetUpVolume() == false) { + if (!volumeSettingView->SetUpVolume()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "volumeSetting SetUpVolume fail"); return; } - volumeSetting->GetProgress()->SetValue(AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC)); - if (AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC) == 0) { - ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); - volumeSetting->GetDecreaseButton()->SetImageSrc(image, image); - } - volumeSettingView = volumeSetting; RootView::GetInstance()->Add(volumeSettingView); } + int32_t volume = AudioManager::GetInstance().GetVolume(AUDIO_STREAM_MUSIC); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "current volume = %d", volume); + volumeSettingView->GetProgress()->SetValue(volume); + if (volume == 0) { + ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); + volumeSettingView->GetDecreaseButton()->SetImageSrc(image, image); + } VolumeSliderEventListener *volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); if (volumeSliderEventListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundButtonOnClick volumeSliderEventListener nullptr err"); @@ -822,7 +820,7 @@ static void Resume(void) PlayersView *playersView = PlayersView::GetInstance(); player->GetPlayerState(state); - if (state == PLAYER_PAUSED && PlayerIntrptListener->IsPaused() == true) { + if (state == PLAYER_PAUSED && PlayerIntrptListener->IsPaused()) { ret = player->Play(); if (ret == 0) { if (playersView == nullptr) { @@ -847,8 +845,6 @@ void PlayerInterruptListener::ResumePlayer(void) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling"); return; // 通话界面,禁止音乐恢复播放 } - AudioRelease(); // 适配某些机型不触发SCO - PlayerPostGraphicEvent(Resume); } @@ -908,7 +904,7 @@ void PlayerOnDragListener::OnDragChangView(const DragEvent& event, int16_t hideV { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnDragChangeView=%d showView=%d", hideView, showView); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { - if (isStopScan == true) { + if (isStopScan) { BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance(); if (bluetoothEarPhoneView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bluetoothEarPhoneView GetInstance fail"); @@ -952,7 +948,7 @@ void PlayerOnDragListener::OnDragChangBluetoothView(const DragEvent& event) void PlayerOnDragListener::DropEarPhoneView(const DragEvent& event) { bool ret = BluetoothModel::GetInstance()->IsTagReturnToDeviceListView(); - if (ret == true) { + if (ret) { OnDragChangView(event, JumpView::BluetoothJumpViewNum::BLUETOOTHEARPHONEVIEW, JumpView::BluetoothJumpViewNum::BLUETOOTHDEVICELISTVIEW, true); } else { @@ -967,8 +963,8 @@ void PlayerOnDragListener::DropEarListView(const DragEvent& event) if (ret) { BluetoothCaseInfo *caseInfo = BluetoothModel::GetInstance()->GetTempMacValue(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayerOnDragListener::DropEarListView Addr: %02x%02x%02x%02x%02x%02x", - caseInfo->addr[5], caseInfo->addr[4], caseInfo->addr[3], /* mac下标 0 1 2 3 4 5 */ - caseInfo->addr[2], caseInfo->addr[1], caseInfo->addr[0]); /* mac下标 0 1 2 3 4 5 */ + caseInfo->addr[5], caseInfo->addr[4], caseInfo->addr[3], /* mac下标 0 1 2 3 4 5 */ + caseInfo->addr[2], caseInfo->addr[1], caseInfo->addr[0]); /* mac下标 0 1 2 3 4 5 */ errcode_t retVal = gap_disconnect_remote_device((const bd_addr_t *)caseInfo->addr); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayerOnDragListener::DropEarListView gap_disconnect_remote_device retVal = %d", retVal); } @@ -1028,13 +1024,13 @@ void PlayerOnDragListener::CorrespondingJump(const DragEvent& event, int16_t hid WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainBluetoothView::DropView bluetoothModel == nullptr"); return; } - if (bluetoothModel->GetTagReconnectJump() == true) { + if (bluetoothModel->GetTagReconnectJump()) { OnDragChangView(event, hideView, JumpView::BluetoothJumpViewNum::BLUETOOTHEOPTIONSVIEW, false); } else { std::list &bluetoothScanList = BluetoothModel::GetInstance()->GetCase(); bool ret = bluetoothScanList.empty(); - if (ret != true) { + if (!ret) { OnDragChangView(event, hideView, JumpView::BluetoothJumpViewNum::BLUETOOTHEARLISTVIEW, false); } else { @@ -1093,8 +1089,8 @@ void PlayersPresenter::OnClickCancelConnedRequestButton(void) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CancelConnedRequestButton OnClick"); BluetoothCaseInfo *caseInfo = BluetoothModel::GetInstance()->GetTempMacValue(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ClickCancelConnedRequestButton Addr: %02x%02x%02x%02x%02x%02x", - caseInfo->addr[5], caseInfo->addr[4], caseInfo->addr[3], /* mac下标 0 1 2 3 4 5 */ - caseInfo->addr[2], caseInfo->addr[1], caseInfo->addr[0]); /* mac下标 0 1 2 3 4 5 */ + caseInfo->addr[5], caseInfo->addr[4], caseInfo->addr[3], /* mac下标 0 1 2 3 4 5 */ + caseInfo->addr[2], caseInfo->addr[1], caseInfo->addr[0]); /* mac下标 0 1 2 3 4 5 */ errcode_t retVal = gap_disconnect_remote_device((const bd_addr_t *)caseInfo->addr); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnClickCancelConnedRequestButton DisconnectRemoteDevice retVal = %d", retVal); @@ -1176,14 +1172,14 @@ void PlayersPresenter::OnClickButtonOptionOne(void) return; } BluetoothModel::GetInstance()->SetBtStatus(); - if (BluetoothModel::GetInstance()->GetAclConnected() == true) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersPresenter::OnClickButtonOptionOne GetAclConnected() == true"); + if (BluetoothModel::GetInstance()->GetAclConnected()) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersPresenter::OnClickButtonOptionOne GetAclConnected()"); BluetoothModel::GetInstance()->SetTagConnectNew(false); bluetoothOptionsView->SetBtDisconnect(); jumpView->ChangeView(JumpView::BluetoothJumpViewNum::BLUETOOTHEOPTIONSVIEW, JumpView::BluetoothJumpViewNum::BLUETOOTHDEVICELISTVIEW); } else { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersPresenter::OnClickButtonOptionOne GetAclConnected() ==false"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersPresenter::OnClickButtonOptionOne GetAclConnected() fail"); BluetoothModel::GetInstance()->SetTagReconnectJump(true); // 重连动画 jumpView->ChangeView(JumpView::BluetoothJumpViewNum::BLUETOOTHEOPTIONSVIEW, @@ -1191,8 +1187,8 @@ void PlayersPresenter::OnClickButtonOptionOne(void) // 判断是否正在连接 bd_addr_t *lastAddr = BluetoothModel::GetInstance()->GetLastConnedAddr(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothPresenter::ClickOptionsOneButton lastAddr: %02x%02x%02x%02x%02x%02x", - lastAddr->addr[5], lastAddr->addr[4], lastAddr->addr[3], /* mac下标 0 1 2 3 4 5 */ - lastAddr->addr[2], lastAddr->addr[1], lastAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */ + lastAddr->addr[5], lastAddr->addr[4], lastAddr->addr[3], /* mac下标 0 1 2 3 4 5 */ + lastAddr->addr[2], lastAddr->addr[1], lastAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */ if (bt_is_acl_connected(lastAddr)) { BluetoothModel::GetInstance()->SetTagConnectNew(true); bluetoothOptionsView->SetBtDisconnect(); @@ -1224,7 +1220,7 @@ void PlayersPresenter::OnClickSetting(void) // 设备列表 List &bluetoothCaseList = BluetoothModel::GetInstance()->GetConnedDevicesCase(); bool ret = bluetoothCaseList.IsEmpty(); - if (ret != true) { + if (!ret) { jumpView->ChangeView(JumpView::BluetoothJumpViewNum::BLUETOOTHEVIEW, JumpView::BluetoothJumpViewNum::BLUETOOTHDEVICELISTVIEW); } else { @@ -1347,7 +1343,7 @@ void PlayersPresenter::SetPlayerState(bool value) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPlayerState playersView GetInstance fail"); return; } - if (value != false) { + if (value) { playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::SELECTED); PlayersModel::GetInstance()->SetPlayButtonState(false); } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp index e64666b3e..c5bbc47ea 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp @@ -4,7 +4,7 @@ * Author: * Create: 2021-07-26 */ -#include +#include #include #include "common/image_cache_manager.h" #include "ui_resource_image.h" @@ -32,9 +32,9 @@ PlayersView::PlayersView() PlayersView::~PlayersView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersView::~PlayersView"); - if (viewiInitStatus == true) { - state = GetPlayerButtonState(); - if (state == UICheckBox::UICheckBoxState::SELECTED) { + if (viewiInitStatus) { + state_ = GetPlayerButtonState(); + if (state_ == UICheckBox::UICheckBoxState::SELECTED) { PlayersModel::GetInstance()->SetPlayButtonState(true); } RemoveAll(); @@ -80,7 +80,6 @@ void PlayersView::TitleSetText(const char *text) titleLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); titleLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER); - } void PlayersView::PlayerModelButtonSetSrc(uint32_t playMode) @@ -157,7 +156,7 @@ UICheckBox::UICheckBoxState PlayersView::GetPlayerButtonState(void) void PlayersView::SetPlayerButtonState(UICheckBox::UICheckBoxState state) { if (playerButton == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayersView::SetPlayerButtonState playerButton NULL"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayersView::SetPlayerButtonState playerButton nullptr"); return; } return playerButton->SetState(state); @@ -171,7 +170,7 @@ UIList *PlayersView::GetPlayerList(void) void PlayersView::SetPlayerListGroupStatus(bool status) { if (listGroup == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersView listGroup is NULL"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlayersView listGroup is nullptr"); return; } UIView *vew = MainViewSample::GetInstance()->GetMainViewGroup(); @@ -301,7 +300,7 @@ int PlayersView::ShowUpCheckBoxButton() soundButton->SetTouchable(true); soundButton->SetPosition(178, 316, 95, 76); // 178:x 316:y 95:width 76:height soundButton->SetOnClickListener(soundlistener); - if (LoadPlayerImage(soundButton, PLAYER_SOUND_IMAGE) == false) { + if (!LoadPlayerImage(soundButton, PLAYER_SOUND_IMAGE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playerModelButton LoadPlayerImage fail"); return false; } @@ -344,7 +343,7 @@ int PlayersView::ShowUpButton() playerModelButton->SetTouchable(true); playerModelButton->SetPosition(pointBtn.x, pointBtn.y, 95, 76); // 95:width 76:height playerModelButton->SetOnClickListener(modellistener); - if (ShowUpPlayerMode() == false) { + if (!ShowUpPlayerMode()) { return OHOS_FAILURE; } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "playerModel %d", PlayersModel::GetInstance()->GetPlayerModel()); @@ -356,22 +355,22 @@ int PlayersView::ShowUpButton() bool PlayersView::ShowUpPlayerMode() { if (PlayersModel::GetInstance()->GetPlayerModel() == LOOP) { - if (LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_LOOP) == false) { + if (!LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_LOOP)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "load PLAYER_PLAYERSMODEL_LOOP fail"); return false; } } else if (PlayersModel::GetInstance()->GetPlayerModel() == SEQUENCE) { - if (LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_SEQUENCE) == false) { + if (!LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_SEQUENCE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "load PLAYERSMODEL_SEQUENCE fail"); return false; } } else if (PlayersModel::GetInstance()->GetPlayerModel() == REPEATS) { - if (LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_REPEATS) == false) { + if (!LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_REPEATS)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "load PLAYERSMODEL_REPEATS fail"); return false; } } else if (PlayersModel::GetInstance()->GetPlayerModel() == RANDOM) { - if (LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_RANDOM) == false) { + if (!LoadPlayerImage(playerModelButton, PLAYER_PLAYERSMODEL_RANDOM)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "load PLAYERSMODEL_RANDOM fail"); return false; } @@ -381,8 +380,7 @@ bool PlayersView::ShowUpPlayerMode() int PlayersView::ShowUpButtonView() { - int ret; - ret = ShowUpCheckBoxButton(); + int32_t ret = ShowUpCheckBoxButton(); if (ret == OHOS_FAILURE) { return OHOS_FAILURE; } @@ -510,7 +508,7 @@ bool PlayersView::InitBackGround(void) } } backGround->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - if (LoadPlayerImage(backGround, PLAYER_BACK_GROUND) == false) { + if (!LoadPlayerImage(backGround, PLAYER_BACK_GROUND)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "backGround LoadPlayerImage fail"); return false; } @@ -563,7 +561,7 @@ bool PlayersView::InitView(void) int ret; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " PlayersView InitView"); - if (InitBackGround() == false) { + if (!InitBackGround()) { return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/include/RebootModel.h b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/include/RebootModel.h index 223c3f36e..f3313ad86 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/include/RebootModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/include/RebootModel.h @@ -16,7 +16,6 @@ enum RebootModelView : uint8_t { SHUTDOWNDEVICE, }; -using namespace std; class RebootModel { public: ~RebootModel(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootDeviceView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootDeviceView.cpp index a98af032b..dba1ce021 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootDeviceView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootDeviceView.cpp @@ -87,7 +87,7 @@ UIViewGroup *RebootDeviceView::InitShowUpView(void) group->SetHeight(VERTICAL_RESOLUTION); } ret = ShowUpRebootDeviceView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(rebootDeviceLabel); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp index 029b718b6..7dcdf3238 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp @@ -54,11 +54,9 @@ bool RebootPresenter::OnClick(UIView& view, const ClickEvent& event) } else if (strcmp(view.GetViewId(), REBOOTDEVICE_BUTTON) == 0) { // 重启 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick"); - //GetPMSDefaultInterface()->RebootDevice(NULL, NULL); } else if (strcmp(view.GetViewId(), SHUTDOWNDEVICE_BUTTON) == 0) { // 关机 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SHUTDOWNDEVICE_BUTTON OnClick"); - //GetPMSDefaultInterface()->ShutDownDevice(NULL, NULL); } return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootView.cpp index 1718954c0..b8462fe34 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootView.cpp @@ -176,14 +176,14 @@ UIViewGroup *RebootView::InitShowUpView(void) group->SetHeight(VERTICAL_RESOLUTION); } ret = ShowUpRebootView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(rebootLabel); group->Add(rebootButton); ret = ShowUpShutdownView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(shutdownLabel); @@ -204,12 +204,12 @@ bool RebootView::ChangeRebootView(int16_t hideView, int16_t thisView) { UNUSED(hideView); // init view - UIViewGroup *group = InitShowUpView(); - if (group == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + UIViewGroup *viewGroup = InitShowUpView(); + if (viewGroup == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); return true; } @@ -225,12 +225,12 @@ bool RebootView::ChangeRebootDeviceView(int16_t hideView, int16_t thisView) return false; } // init view - UIViewGroup *group = rebootDeviceView->InitShowUpView(); - if (group == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + UIViewGroup *viewGroup = rebootDeviceView->InitShowUpView(); + if (viewGroup == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); } return true; @@ -247,12 +247,12 @@ bool RebootView::ChangeShutdownDeviceView(int16_t hideView, int16_t thisView) return false; } // init view - UIViewGroup *group = shutdownDeviceView->InitShowUpView(); - if (group == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + UIViewGroup *viewGroup = shutdownDeviceView->InitShowUpView(); + if (viewGroup == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); } return true; @@ -277,14 +277,14 @@ void RebootView::ChangeView(int16_t hideView, int16_t showView) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::ChangeView %d, %d", hideView, showView); - if (CheckViewParam(hideView, showView) == false) { + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootView::CheckViewParam failed."); return; } PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) { + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootView::ChangeView %d %dfailed", showView, hideView); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/ShutdownDeviceView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/ShutdownDeviceView.cpp index 74ce3a6a9..e3d74ec18 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/ShutdownDeviceView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/ShutdownDeviceView.cpp @@ -88,7 +88,7 @@ UIViewGroup *ShutdownDeviceView::InitShowUpView(void) } ret = ShowUpShutdownDeviceView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(shutdownDeviceLabel); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rtcservice/src/RtcService.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rtcservice/src/RtcService.cpp index 4178ba76a..8e13b59db 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/rtcservice/src/RtcService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rtcservice/src/RtcService.cpp @@ -4,8 +4,8 @@ * Create: 2021-09-22 */ -#include -#include +#include +#include #include "memory_adapter.h" #include "ohos_init.h" #include "samgr_lite.h" @@ -37,7 +37,7 @@ static RtcService g_rtcService = { .MessageHandle = ServiceMessageHandle, .GetTaskConfig = GetServiceTaskConfig, .subscirber = { - .identity = NULL, + .identity = nullptr, .args = &g_rtcService, .Notify = Notify, }, @@ -96,18 +96,18 @@ static TaskConfig GetServiceTaskConfig(Service *service) static void SubscribeTopic(Topic topic) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Rtc Subscribe Topic=%u!!", topic); - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SubscribeTopic GetFeatureApi %s %s failed!!", - BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); + BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SubscribeTopic QueryInterface %s %s failed!!", - BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); + BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); return; } @@ -119,18 +119,18 @@ static void SubscribeTopic(Topic topic) void UnsubscribeTopic(Topic topic) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Rtc Unsubscribe Topic=%u!!", topic); - BroadcastApi *broadcastApi = NULL; + BroadcastApi *broadcastApi = nullptr; IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); - if (api == NULL) { + if (api == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UnsubscribeTopic GetFeatureApi %s %s failed!!", - BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); + BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); return; } int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi); - if (result != 0 || broadcastApi == NULL) { + if (result != 0 || broadcastApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UnsubscribeTopic QueryInterface %s %s failed!!", - BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); + BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME); return; } @@ -144,7 +144,7 @@ static void Notify(void *args, const Topic topic, Request* req) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Rtc Notify:"); AlarmClockQueueMsg eventMsg; - if (req == NULL || args == NULL) { + if (req == nullptr || args == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Notify para invalid!!"); return; } @@ -155,7 +155,7 @@ static void Notify(void *args, const Topic topic, Request* req) eventMsg.eventType = EVENT_ALARM_RING; AlmmgrAlarmClockEventProcess(&eventMsg); } else if (topic == TOPIC_EVENT_NEXTDAY_UPDATE) { - UpdataListAndFirstAlarmToday(); + UpdataListAndFirstAlarmToday(); } else if (topic == TOPIC_EVENT_UTCTIME_UPDATE) { UpdataListAndFirstAlarmToday(); } else { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/include/ui_screennotify.h b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/include/ui_screennotify.h index 6b673ba8a..4d202759a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/include/ui_screennotify.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/include/ui_screennotify.h @@ -44,9 +44,3 @@ uint32_t get_back_to_home_interval(void); #endif #endif // OHOS_UI_SCREENNOTIFY_H - - - - - - diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index da2ae2a46..d9658eb29 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -1,5 +1,5 @@ #include -#include "stdio.h" +#include #include "ability_state.h" #include "cmsis_os2.h" #include "common_def.h" @@ -58,17 +58,23 @@ static void ChangeToHomeView(void) void notify_screen_on_event(void) { - for (auto callback : g_callback) { - callback(SCREEN_STATUS_ON); - } - GraphicService::GetInstance()->PostGraphicEvent(ChangeToHomeView); + GraphicService::GetInstance()->PostGraphicEvent( + [&] { + for (auto callback : g_callback) { + callback(SCREEN_STATUS_ON); + } + ChangeToHomeView(); + }); } void notify_screen_off_event(void) { - for (auto callback : g_callback) { - callback(SCREEN_STATUS_OFF); - } + GraphicService::GetInstance()->PostGraphicEvent( + [&] { + for (auto callback : g_callback) { + callback(SCREEN_STATUS_OFF); + } + }); } void set_back_to_home_interval(uint32_t time_sec) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h index 78bab7b61..ffa8c36d0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h @@ -12,41 +12,16 @@ #include "ui_image_view.h" namespace OHOS { -typedef enum { - WATCH_FACE = 0, - HEART_RATE, - COMPASS, - ACTIVITY, - MUSIC_PLAYER, - MAX_CARD, -} CardId; - - -struct CardInfo { - int16_t cardId; -}; - class ScreenModels { public: ScreenModels(); ~ScreenModels(); static ScreenModels *GetInstance(void); - // card funtion - bool SetUpListCase(void); - bool SaveCardConfig(void); - bool InitCardConfig(void); - void SetCardConfigDefault(void); - int16_t GetCardPage(uint16_t page); - bool CardInsertFirst(int32_t card); - bool CardDelete(int32_t card); - int16_t GetMaxCard(void); - int16_t GetLastCardPage(void); bool LoadAppImages(std::string file, UIImageView *view, uint32_t resId); void PreLoadAppimages(void); + void InitKvStorage(void); private: void LoadAppMultiImages(std::string file, uint32_t startId, uint32_t lastId); - List *listMainView{nullptr}; // record main view pages - int16_t maxPage = MAX_CARD; }; } #endif diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp index 082bfc43d..6f37eb835 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp @@ -8,9 +8,11 @@ #include "wearable_log.h" #include "iostream" #include -#include "stdio.h" +#include #include #include +#include "kvstore_env.h" +#include "kv_store.h" #include "ScreenModels.h" #include "common/image_cache_manager.h" #include "UiConfig.h" @@ -32,115 +34,10 @@ ScreenModels *ScreenModels::GetInstance(void) return &screenModel; } -bool ScreenModels::SetUpListCase(void) +void ScreenModels::InitKvStorage(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetUpListCase"); - listMainView = new List(); - if (listMainView == nullptr) { - return false; - } - listMainView->Clear(); - return true; -} - -bool ScreenModels::InitCardConfig(void) -{ - if (SetUpListCase() == false) { - return false; - } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig1"); - int32_t fd = open(CARD_CONFIG_PATH, O_RDWR, S_IRWXU); - ListNode *node; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig2"); - struct CardInfo cardInfoData; - if (fd < 0) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig open fail"); - fd = open(CARD_CONFIG_PATH, O_RDWR | O_CREAT, S_IRWXU); - if (fd < 0) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig open fail 2"); - return false; - } - SetCardConfigDefault(); - node = listMainView->Begin(); - for (int32_t i = 0; i < maxPage; i++) { - cardInfoData = node->data_; - node = node->next_; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Init write cardInfoData.i:%d ", cardInfoData.cardId); - if (write(fd, &cardInfoData, sizeof(CardInfo)) != sizeof(CardInfo)) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Init SaveGlobalHealthToFile fail"); - } - } - close(fd); - return true; - } else { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig3"); - for (int32_t i = 0; i < maxPage; i++) { - if (read(fd, &cardInfoData, sizeof(CardInfo)) != sizeof(CardInfo)) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Init Read GlobalHealthToFile fail"); - } - listMainView->PushBack(cardInfoData); - } - close(fd); - return true; - } - return false; -} - -bool ScreenModels::SaveCardConfig(void) -{ - int32_t fd = open(CARD_CONFIG_PATH, O_RDWR | O_CREAT, S_IRWXU); - if (fd < 0) { - close(fd); - return false; - } else { - if (write(fd, &listMainView, listMainView->Size()) != listMainView->Size()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SaveGlobalHealthToFile fail"); - } - close(fd); - return true; - } -} - -void ScreenModels::SetCardConfigDefault(void) -{ - int16_t i; - struct CardInfo cardInfoData; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardConfigDefault"); - for (i = 0; i < MAX_CARD; i++) { - cardInfoData.cardId = i; - listMainView->PushBack(cardInfoData); - } -} - -int16_t ScreenModels::GetCardPage(uint16_t page) -{ - ListNode *node = listMainView->Begin(); - for (uint8_t i = 0; i < page; i++) { - if (node->next_ != NULL) { - node = node->next_; - } else { - return -1; - } - } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetCardPage cardId:%d", node->data_.cardId); - return node->data_.cardId; -} - -int16_t ScreenModels::GetLastCardPage(void) -{ - ListNode *node = listMainView->Begin(); - for (uint8_t i = 0; i < MAX_CARD; i++) { - if (node->next_ == NULL) { - node = node->next_; - } - } - return node->data_.cardId; -} - -int16_t ScreenModels::GetMaxCard(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetMaxCard maxPage:%d", maxPage); - return maxPage; + int ret = UtilsSetEnv("/user"); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "UtilsSetEnv /user ret = %d", ret); } void ScreenModels::LoadAppMultiImages(std::string file, uint32_t startId, uint32_t lastId) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardAdapter.h new file mode 100644 index 000000000..75b9ba8d0 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardAdapter.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardAdapter.h + * Author: + * Create: 2021-09-18 + */ + +#ifndef SET_CARD_ADAPTER_H +#define SET_CARD_ADAPTER_H + +#include +#include +#include "components/ui_list.h" +#include "components/ui_label.h" +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/abstract_adapter.h" +#include "UiConfig.h" +#include "wearable_log.h" +#include "SetCardItem.h" + +namespace OHOS { +class SetCardAdapter : public AbstractAdapter { +public: + explicit SetCardAdapter(); + ~SetCardAdapter() override; + + uint16 GetCount(void) override; + + UIView *GetView(UIView *inView, int16 index) override; + + void AddListItem(const CardInfo &item); + + void SetItemClickListener(UIView::OnClickListener *itemClickListener) + { + itemClickListener_ = itemClickListener; + } + + void ClearItem(void); + +private: + std::list listData_; + UIView::OnClickListener *itemClickListener_; +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardDeleteView.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardDeleteView.h new file mode 100644 index 000000000..6abfe4ee1 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardDeleteView.h @@ -0,0 +1,26 @@ +/** + * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. + * Description: + * Author: + * Create: + */ + +#ifndef SET_CARD_DELETE_VIEW_H +#define SET_CARD_DELETE_VIEW_H + +#include "components/ui_label_button.h" +#include "SetCardPresenter.h" + +namespace OHOS { +class SetCardDeleteView : public UIViewGroup { +public: + SetCardDeleteView(SetCardPresenter *presenter); + ~SetCardDeleteView() override; + bool InitView(); +private: + SetCardPresenter *presenter_; + UILabelButton confirmBtn; + UILabelButton cancelBtn; +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardItem.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardItem.h new file mode 100644 index 000000000..3926d9357 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardItem.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardItem.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_CARD_ITEM_H +#define SET_CARD_ITEM_H + +#include +#include +#include "components/ui_view.h" +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "MainModel.h" +#include "UiConfig.h" + +namespace OHOS { + +class SetCardItem : public UIViewGroup { +public: + SetCardItem(); + ~SetCardItem() override; + void SetItemInfo(const CardInfo &cardInfo); + void SetOnClickListener(OnClickListener *onClickListener); +private: + void SetUpChild(); + UIImageView cardImg_; + CardInfo cardInfo_; +}; + +} + +#endif // SET_CARD_ITEM_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardModel.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardModel.h new file mode 100644 index 000000000..43ed70b26 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardModel.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardModel.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_CARD_MODEL_H +#define SET_CARD_MODEL_H + +#include +#include +#include "AppViewIDs.h" +#include "UiConfig.h" +#include "SetCardPresenter.h" +#include "SetCardItem.h" + +namespace OHOS { + class SetCardModel { + public: + static SetCardModel &GetInstance(void); + uint8_t *GetCardShowList(void); + uint8_t GetCardShowCount(void) const; + void InitCardShowList(void); + void SetSelectedCardIndex(uint8_t cardIndex); + uint8_t GetSelectedCardIndex(void) const; + void DeleteCardSetting(void); + void SetSelectedCard(uint8_t cardId); + uint8_t GetSelectedCard(void); + private: + SetCardModel(); + SetCardModel(const SetCardModel &); + SetCardModel &operator=(const SetCardModel &); + virtual ~SetCardModel(); + + uint8_t cardShowList[CARD_SETTING_COUNT_MAX] = { 0 }; + uint8_t cardShowCount{0}; + uint8_t selectedCardIndex{0}; + uint8_t selectedCardId{MAX_CARD}; + }; +} + +#endif // SET_CARD_MODEL_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardNoCardView.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardNoCardView.h new file mode 100644 index 000000000..dc8ee1226 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardNoCardView.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. + * Description: + * Author: + * Create: + */ + +#ifndef SET_CARD_NO_CARD_VIEW_H +#define SET_CARD_NO_CARD_VIEW_H + +#include "components/ui_image_view.h" +#include "components/ui_label.h" +#include "components/ui_label_button.h" +#include "SetCardPresenter.h" + +namespace OHOS { +class SetCardNoCardView : public UIViewGroup { +public: + SetCardNoCardView(SetCardPresenter *presenter); + ~SetCardNoCardView() override; + bool InitView(); +private: + SetCardPresenter *presenter_; + UILabelButton addBtn; +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardPresenter.h new file mode 100644 index 000000000..c4080fab2 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardPresenter.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardPresenter.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_CARD_PRESENTER_H +#define SET_CARD_PRESENTER_H + +#include "Presenter.h" +#include "components/ui_list.h" +#include "components/ui_view.h" +#include "KeyInputListener.h" +#include "ModelListenerSample.h" + +namespace OHOS { + +static const char *SET_CARD_ADD = "setcardadd"; +static const char *SET_CARD_DEL = "setcarddel"; +static const char *SET_CARD_DEL_CONFIRM = "setcarddelconfirm"; +static const char *SET_CARD_DEL_CANCEL = "setcarddelcancel"; +static const char *SET_CARD_IMG = "setcardimg"; + +const uint16_t MISS_SET_CARD_OPERATION_TIME = 3000; + +class SetCardView; +class SetCardModel; +class SetCardPresenter : public Presenter, + public UIView::OnClickListener, public ModelListenerSample, + public ListScrollListener { +public: + SetCardPresenter(); + ~SetCardPresenter() override; + + void OnStart() override; + void OnResume() override; + void OnStop() override; + bool OnClick(UIView &view, const ClickEvent &event) override; + void OnScrollStart(int16_t index, UIView *view) override; + void OnScrollEnd(int16_t index, UIView *view) override; + void OnItemSelected(int16_t index, UIView* view) override; + void OnTickEvent() override; + void Notify() override {} + void InitCardShowList(void); + uint8_t *GetCardShowList(void); + uint8_t GetCardShowCount(void) const; + void SetSelectedCard(uint8_t cardId); + uint8_t GetSelectedCard(void); + void SetSelectedCardIndex(uint8_t cardIndex); +private: + void GoToMainView(void); + void ResetTickTimer(void); + KeyInputListener *keyActListenr{nullptr}; + SetCardModel *model{nullptr}; + uint64_t startTime{0}; +}; +} + +#endif // SET_CARD_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardView.h b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardView.h new file mode 100644 index 000000000..52f87c8c0 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/include/SetCardView.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardView.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_CARD_VIEW_H +#define SET_CARD_VIEW_H + +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +#include "window/window.h" +#include "BaseView.h" +#include "ChangeSliceListener.h" +#include "UiConfig.h" +#include "SetCardAdapter.h" +#include "SetCardModel.h" +#include "SetCardDeleteView.h" +#include "SetCardNoCardView.h" + +namespace OHOS { +class SetCardPresenter; + +class SetCardView : public View { +public: + SetCardView(); + ~SetCardView() override; + + static SetCardView *GetInstance() + { + static SetCardView instance; + return &instance; + } + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + void ShowDeleteView(bool show); + void ShowAddView(bool show); + void RefreshCardList(void); + void SaveSelectCardIndex(void); +private: + void SetUpListInfo(void); + void SetUpListView(void); + void SetUpDeleteView(void); + void SetUpAddView(void); + void ShowCardListView(bool show); + UIImageView addImg_; + UIList contentList_; + UIImageView delImg_; + + SetCardDeleteView *deleteView_{nullptr}; + SetCardNoCardView *noCardView_{nullptr}; + SetCardAdapter *setCardAdapter_{nullptr}; + uint32_t scrollIndex_{0}; +}; +} +#endif // SET_CARD_VIEW_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardAdapter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardAdapter.cpp new file mode 100644 index 000000000..badbc10dc --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardAdapter.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardAdapter.cpp + * Author: + * Create: 2021-09-18 + */ + +#include "SetCardAdapter.h" + +namespace OHOS { +SetCardAdapter::SetCardAdapter() {} + +SetCardAdapter::~SetCardAdapter() +{ + listData_.clear(); +} + +uint16 SetCardAdapter::GetCount(void) +{ + return listData_.size(); +} + +void SetCardAdapter::ClearItem(void) +{ + listData_.clear(); +} + +UIView *SetCardAdapter::GetView(UIView *inView, int16 index) +{ + if (index >= (int16)listData_.size() || index < 0) { + return nullptr; + } + + std::list::iterator it = listData_.begin(); + for (int i = 0; i < index; i++) { + it++; + } + + SetCardItem *item = nullptr; + if (inView == nullptr) { + item = new SetCardItem(); + if (item == nullptr) { + return nullptr; + } + } else { + item = static_cast(inView); + } + + item->SetItemInfo(*it); + item->SetViewIndex(index); + item->SetOnClickListener(itemClickListener_); + return item; +} + +void SetCardAdapter::AddListItem(const CardInfo &item) +{ + listData_.push_back(item); +} +} // namespace OHOS diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardDeleteView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardDeleteView.cpp new file mode 100644 index 000000000..d957515c8 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardDeleteView.cpp @@ -0,0 +1,53 @@ +/** + * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. + * Description. + * Author: + * Create: + */ + +#include "UiConfig.h" +#include +#include "cmsis_os.h" +#include "SetCardDeleteView.h" + +namespace OHOS { + +SetCardDeleteView::SetCardDeleteView(SetCardPresenter *presenter) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardDeleteView::SetCardDeleteView"); + presenter_ = presenter; + SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + InitView(); + Add(&confirmBtn); + Add(&cancelBtn); +} + +SetCardDeleteView::~SetCardDeleteView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardDeleteView::~SetCardDeleteView"); + Remove(&confirmBtn); + Remove(&cancelBtn); +} + +bool SetCardDeleteView::InitView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardDeleteView::InitView"); + confirmBtn.SetPosition(184, 118); + confirmBtn.Resize(86, 50); + confirmBtn.SetViewId(SET_CARD_DEL_CONFIRM); + confirmBtn.SetText("删除"); + confirmBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + confirmBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + confirmBtn.SetOnClickListener(presenter_); + + cancelBtn.SetPosition(186, 231); + cancelBtn.Resize(82, 50); + cancelBtn.SetViewId(SET_CARD_DEL_CANCEL); + cancelBtn.SetText("取消"); + cancelBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + cancelBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + cancelBtn.SetOnClickListener(presenter_); + return true; +} +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardItem.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardItem.cpp new file mode 100644 index 000000000..4bdd7ba98 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardItem.cpp @@ -0,0 +1,39 @@ +#include "SetCardItem.h" +#include "SetCardPresenter.h" +#include "wearable_log.h" + +namespace OHOS { + SetCardItem::SetCardItem() + { + SetPosition(0, 0, 454, 280); + SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + SetUpChild(); + Add(&cardImg_); + } + + SetCardItem::~SetCardItem() + { + Remove(&cardImg_); + } + + void SetCardItem::SetUpChild() + { + cardImg_.SetPosition(87, 0); + cardImg_.Resize(280, 280); + cardImg_.SetResizeMode(UIImageView::FILL); + cardImg_.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + } + + void SetCardItem::SetItemInfo(const CardInfo &cardInfo) + { + cardInfo_ = cardInfo; + cardImg_.SetSrc(cardInfo.cardImg); + cardImg_.SetViewId(SET_CARD_IMG); + } + + void SetCardItem::SetOnClickListener(OnClickListener *onClickListener) + { + cardImg_.SetOnClickListener(onClickListener); + cardImg_.SetTouchable(true); + } +}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardModel.cpp new file mode 100644 index 000000000..32ca2b547 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardModel.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardModel.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "SetCardModel.h" +#include "MainModel.h" +#include "kv_store.h" +#include "securec.h" + +namespace OHOS { + SetCardModel::SetCardModel() {} + + SetCardModel::~SetCardModel() {} + + SetCardModel &SetCardModel::GetInstance() + { + static SetCardModel instance; + return instance; + } + + void SetCardModel::InitCardShowList(void) + { + MainModel::GetInstance().InitCardSettings(); + uint8_t cardCount = MainModel::GetInstance().GetCardSettingCount(); + CardId *cardSettings = MainModel::GetInstance().GetCardSettings(); + cardShowCount = 0; + for (uint8_t i = 0; i < cardCount; i++) { + if (cardSettings[i] == WATCH_FACE) { + continue; + } + cardShowList[cardShowCount++] = cardSettings[i]; + } + } + + uint8_t *SetCardModel::GetCardShowList(void) + { + return cardShowList; + } + + uint8_t SetCardModel::GetCardShowCount(void) const + { + return cardShowCount; + } + + void SetCardModel::SetSelectedCardIndex(uint8_t cardIndex) + { + selectedCardIndex = cardIndex; + } + + uint8_t SetCardModel::GetSelectedCardIndex(void) const + { + return selectedCardIndex; + } + + void SetCardModel::DeleteCardSetting(void) + { + MainModel::GetInstance().DeleteCardSetting(selectedCardIndex); + } + + void SetCardModel::SetSelectedCard(uint8_t cardId) + { + selectedCardId = cardId; + } + + uint8_t SetCardModel::GetSelectedCard(void) + { + return selectedCardId; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardNoCardView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardNoCardView.cpp new file mode 100644 index 000000000..15cb462b6 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardNoCardView.cpp @@ -0,0 +1,43 @@ +/** + * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. + * Description. + * Author: + * Create: + */ + +#include "UiConfig.h" +#include +#include "cmsis_os.h" +#include "SetCardNoCardView.h" + +namespace OHOS { + +SetCardNoCardView::SetCardNoCardView(SetCardPresenter *presenter) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardNoCardView::SetCardNoCardView"); + presenter_ = presenter; + SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + InitView(); + Add(&addBtn); +} + +SetCardNoCardView::~SetCardNoCardView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardNoCardView::~SetCardNoCardView"); + Remove(&addBtn); +} + +bool SetCardNoCardView::InitView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardNoCardView::InitView"); + addBtn.SetPosition(184, 118); + addBtn.Resize(86, 50); + addBtn.SetViewId(SET_CARD_ADD); + addBtn.SetText("添加"); + addBtn.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + addBtn.SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + addBtn.SetOnClickListener(presenter_); + return true; +} +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp new file mode 100644 index 000000000..cefddd031 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardPresenter.cpp @@ -0,0 +1,157 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardPresenter.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "SetCardView.h" +#include "SetCardModel.h" +#include "SetCardPresenter.h" + +namespace OHOS { + SetCardPresenter::SetCardPresenter() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SetCardPresenter"); + model = &SetCardModel::GetInstance(); + ResetTickTimer(); + } + + SetCardPresenter::~SetCardPresenter() + { + if (keyActListenr != nullptr) { + delete keyActListenr; + keyActListenr = nullptr; + } + } + + void SetCardPresenter::OnStart() + { + Presenter::OnStart(); + if (keyActListenr == nullptr) { + keyActListenr = new KeyInputListener(); + if (keyActListenr != nullptr) { + RootView::GetInstance()->SetOnKeyActListener(keyActListenr); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnStart: new KeyInputListener fail"); + } + } + } + + void SetCardPresenter::OnResume(void) + { + } + + void SetCardPresenter::OnStop(void) + { + RootView::GetInstance()->ClearOnKeyActListener(); + } + + bool SetCardPresenter::OnClick(UIView &view, const ClickEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::OnClick"); + if (strcmp(view.GetViewId(), SET_CARD_ADD) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SET_CARD_ADD"); + NativeAbility::GetInstance().ChangeSlice(VIEW_ADD_CARD); + } else if (strcmp(view.GetViewId(), SET_CARD_DEL) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SET_CARD_DEL"); + view_->SaveSelectCardIndex(); + view_->ShowDeleteView(true); + } else if (strcmp(view.GetViewId(), SET_CARD_DEL_CONFIRM) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SET_CARD_DEL_CONFIRM"); + model->DeleteCardSetting(); + view_->ShowDeleteView(false); + view_->RefreshCardList(); + } else if (strcmp(view.GetViewId(), SET_CARD_DEL_CANCEL) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SET_CARD_DEL_CANCEL"); + view_->ShowDeleteView(false); + } else if (strcmp(view.GetViewId(), SET_CARD_IMG) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SET_CARD_IMG"); + GoToMainView(); + } + ResetTickTimer(); + return true; + } + + void SetCardPresenter::OnScrollStart(int16_t index, UIView *view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::OnScrollStart index = %d", index); + return; + } + + void SetCardPresenter::OnScrollEnd(int16_t index, UIView *view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::OnScrollEnd index = %d", index); + if (view == nullptr) { + return; + } + SetSelectedCardIndex(index); + ResetTickTimer(); + } + + void SetCardPresenter::OnItemSelected(int16_t index, UIView* view) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::OnItemSelected index = %d", index); + if (view == nullptr) { + return; + } + } + void SetCardPresenter::InitCardShowList(void) + { + model->InitCardShowList(); + } + + uint8_t *SetCardPresenter::GetCardShowList(void) + { + return model->GetCardShowList(); + } + + uint8_t SetCardPresenter::GetCardShowCount(void) const + { + return model->GetCardShowCount(); + } + + void SetCardPresenter::SetSelectedCard(uint8_t cardId) + { + model->SetSelectedCard(cardId); + } + + uint8_t SetCardPresenter::GetSelectedCard(void) + { + return model->GetSelectedCard(); + } + + void SetCardPresenter::SetSelectedCardIndex(uint8_t cardIndex) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::SetSelectedCardIndex %d", cardIndex); + model->SetSelectedCardIndex(cardIndex); + } + + void SetCardPresenter::GoToMainView(void) + { + uint8_t *cardSettings = model->GetCardShowList(); + uint8_t selectIndex = model->GetSelectedCardIndex(); + if (selectIndex < model->GetCardShowCount()) { + const CardInfo *info = MainModel::GetInstance().GetCardInfo(static_cast(cardSettings[selectIndex])); + if (info != nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardPresenter::GoToMainView %d", info->id); + MainModel::GetInstance().SetFromSetCardView(true); + MainModel::GetInstance().SetFromCardId(info->id); + } + } + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + } + + void SetCardPresenter::OnTickEvent() + { + uint64_t current_time = osKernelGetTick2ms(); + if ((startTime != 0) && (current_time - startTime > MISS_SET_CARD_OPERATION_TIME)) { + GoToMainView(); + } + } + + void SetCardPresenter::ResetTickTimer(void) + { + startTime = osKernelGetTick2ms(); + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardView.cpp new file mode 100644 index 000000000..0efb39e47 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_card/src/SetCardView.cpp @@ -0,0 +1,216 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetCardView.cpp + * Author: + * Create: 2021-11-23 + */ + +#include +#include "SetCardView.h" +#include "SetCardPresenter.h" + +namespace OHOS { +SetCardView::SetCardView():contentList_(UIList::HORIZONTAL) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::SetCardView"); +} + +SetCardView::~SetCardView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::~SetCardView"); + if (deleteView_ != nullptr) { + delete deleteView_; + deleteView_ = nullptr; + } + + if (noCardView_ != nullptr) { + delete noCardView_; + noCardView_ = nullptr; + } + + if (setCardAdapter_ != nullptr) { + delete setCardAdapter_; + setCardAdapter_ = nullptr; + } +} + +void SetCardView::OnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::OnStart"); + View::OnStart(); + SetContainerView(new UIViewGroup()); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + setCardAdapter_ = new SetCardAdapter(); + setCardAdapter_->SetItemClickListener(presenter_); + SetUpListInfo(); + SetUpListView(); + SetUpDeleteView(); + SetUpAddView(); +} + +void SetCardView::OnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::OnSetUpView"); + View::OnSetUpView(); + ShowDeleteView(false); + if (setCardAdapter_->GetCount() == 0) { + ShowAddView(true); + } +} + +void SetCardView::OnTearDownView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::OnTearDownView"); + View::OnTearDownView(); +} + +void SetCardView::OnStop() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::OnStop"); + View::OnStop(); + RootView::GetInstance()->ClearOnKeyActListener(); + if (container_ != nullptr) { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } +} + +void SetCardView::SetUpListInfo(void) +{ + presenter_->InitCardShowList(); + uint8_t num = presenter_->GetCardShowCount(); + uint8_t *cardSettings = presenter_->GetCardShowList(); + uint8_t selectCardId = presenter_->GetSelectedCard(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetUpListInfo::selectCardId = %u", selectCardId); + setCardAdapter_->ClearItem(); + for (uint8_t i = 0; i < num; i++) { + const CardInfo *info = MainModel::GetInstance().GetCardInfo( + static_cast(cardSettings[i])); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetUpListInfo::%d %s", info->id, info->cardImg); + if (selectCardId == info->id) { + presenter_->SetSelectedCardIndex(i); + scrollIndex_ = i; + presenter_->SetSelectedCard(MAX_CARD); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetUpListInfo::scrollIndex_ = %u", scrollIndex_); + } + setCardAdapter_->AddListItem(*info); + } +} + +void SetCardView::SetUpListView(void) +{ + addImg_.SetPosition(187, 10); + addImg_.Resize(80, 80); + addImg_.SetResizeMode(UIImageView::FILL); + addImg_.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + addImg_.SetSrc(PNG_SET_CARD_ADD); + addImg_.SetViewId(SET_CARD_ADD); + addImg_.SetVisible(false); + + contentList_.SetPosition(0, 92); + contentList_.Resize(HORIZONTAL_RESOLUTION, 280); + contentList_.SetScrollBlankSize(HORIZONTAL_RESOLUTION / 2); + contentList_.SetSelectPosition(HORIZONTAL_RESOLUTION / 2); + contentList_.SetDraggable(true); + contentList_.SetThrowDrag(true); + contentList_.EnableAutoAlign(true); + contentList_.SetScrollStateListener(presenter_); + contentList_.SetMaxScrollDistance(1000); + contentList_.SetAdapter(setCardAdapter_); + contentList_.SetVisible(false); + contentList_.ScrollTo(scrollIndex_); + + delImg_.SetPosition(187, 374); + delImg_.Resize(80, 80); + delImg_.SetResizeMode(UIImageView::FILL); + delImg_.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + delImg_.SetSrc(PNG_SET_CARD_DEL); + delImg_.SetViewId(SET_CARD_DEL); + delImg_.SetVisible(false); + + addImg_.SetTouchable(true); + addImg_.SetOnClickListener(presenter_); + delImg_.SetTouchable(true); + delImg_.SetOnClickListener(presenter_); + + container_->Add(&addImg_); + container_->Add(&contentList_); + container_->Add(&delImg_); +} + +void SetCardView::SetUpDeleteView(void) +{ + deleteView_ = new SetCardDeleteView(presenter_); + if (deleteView_ == nullptr) { + return; + } + deleteView_->SetVisible(false); + container_->Add(deleteView_); +} + +void SetCardView::SetUpAddView(void) +{ + noCardView_ = new SetCardNoCardView(presenter_); + if (noCardView_ == nullptr) { + return; + } + noCardView_->SetVisible(false); + container_->Add(noCardView_); +} + +void SetCardView::ShowCardListView(bool show) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::ShowCardListView %u", show); + if (show) { + addImg_.SetVisible(true); + contentList_.SetVisible(true); + delImg_.SetVisible(true); + } else { + addImg_.SetVisible(false); + contentList_.SetVisible(false); + delImg_.SetVisible(false); + } +} + +void SetCardView::ShowDeleteView(bool show) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::ShowDeleteView %u", show); + if (show) { + ShowCardListView(false); + deleteView_->SetVisible(true); + } else { + ShowCardListView(true); + deleteView_->SetVisible(false); + } +} + +void SetCardView::ShowAddView(bool show) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardView::ShowAddView %u", show); + if (show) { + ShowCardListView(false); + noCardView_->SetVisible(true); + } else { + ShowCardListView(true); + noCardView_->SetVisible(false); + } +} + +void SetCardView::RefreshCardList(void) +{ + contentList_.RemoveAll(); + SetUpListInfo(); + contentList_.RefreshList(); + if (setCardAdapter_->GetCount() == 0) { + ShowAddView(true); + } +} + +void SetCardView::SaveSelectCardIndex(void) +{ + uint8_t cardIdex = contentList_.GetSelectView()->GetViewIndex(); + presenter_->SetSelectedCardIndex(cardIdex); +} + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopModel.h b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopModel.h new file mode 100644 index 000000000..2ef2793dc --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopModel.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDesktopModel.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DESKTOP_MODEL_H +#define SET_DESKTOP_MODEL_H + +#include +#include +#include "AppViewIDs.h" +#include "UiConfig.h" +#include "SetDesktopPresenter.h" + +typedef enum { + APPLIST_STYLE, + HEXAGONS_STYLE, +} DesktopStyle; + +namespace OHOS { + class SetDesktopModel { + public: + static SetDesktopModel &GetInstance(void); + DesktopStyle GetDesktopStyle(void); + void SetDesktopStyle(DesktopStyle style); + private: + SetDesktopModel(); + SetDesktopModel(const SetDesktopModel &); + SetDesktopModel &operator=(const SetDesktopModel &); + virtual ~SetDesktopModel(); + }; +} + +#endif // SET_DESKTOP_MODEL_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopPresenter.h new file mode 100644 index 000000000..d757dbe8a --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopPresenter.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDesktopPresenter.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DESKTOP_PRESENTER_H +#define SET_DESKTOP_PRESENTER_H + +#include "Presenter.h" +#include "components/ui_view.h" + +namespace OHOS { +static const char *SET_DESKTOP_LIST = "setdesktopList"; +static const char *SET_DESKTOP_HEXAGONS = "setdesktopHexagons"; + +class SetDesktopView; +class SetDesktopModel; +class SetDesktopPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener { +public: + SetDesktopPresenter(); + ~SetDesktopPresenter() override; + + void OnStart() override; + void OnResume() override; + void OnStop() override; + + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView& view, const DragEvent& event) override; + bool GetHexagonsStyleState(void); +private: +}; +} + +#endif // SET_DESKTOP_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopView.h b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopView.h new file mode 100644 index 000000000..d1827c77a --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/include/SetDesktopView.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDesktopView.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DESKTOP_VIEW_H +#define SET_DESKTOP_VIEW_H + +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +#include "window/window.h" +#include "BaseView.h" +#include "ChangeSliceListener.h" +#include "UiConfig.h" + +namespace OHOS { +class SetDesktopPresenter; + +class SetDesktopView : public View { +public: + SetDesktopView(); + ~SetDesktopView() override; + + static SetDesktopView *GetInstance() + { + static SetDesktopView instance; + return &instance; + } + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + void UpdateSelectedStyle(bool hexagonsSelected); +private: + UILabel titleText; + UIToggleButton hexagonsBtn; + UIToggleButton listBtn; + UIImageView hexagonsImage; + UIImageView listImage; + UILabel listText; + UILabel hexagonsText; +}; +} +#endif // SET_DESKTOP_VIEW_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopModel.cpp new file mode 100644 index 000000000..43c523e4f --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopModel.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SettingModel.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "SetDesktopModel.h" +#include "kv_store.h" +#include "securec.h" + +namespace OHOS { + static const int STYLE_VALUE_LEN = 32; + SetDesktopModel::SetDesktopModel() {} + + SetDesktopModel::~SetDesktopModel() {} + + SetDesktopModel &SetDesktopModel::GetInstance() + { + static SetDesktopModel instance; + return instance; + } + + DesktopStyle SetDesktopModel::GetDesktopStyle(void) + { + DesktopStyle style; + char temp[STYLE_VALUE_LEN] = { 0 }; + (void)UtilsGetValue("applist_style", temp, STYLE_VALUE_LEN); + if (strcmp(temp, "hexagons") == 0) { + style = HEXAGONS_STYLE; + } else { + style = APPLIST_STYLE; + } + return style; + } + + void SetDesktopModel::SetDesktopStyle(DesktopStyle style) + { + if (style == APPLIST_STYLE) { + (void)UtilsSetValue("applist_style", "list"); + } else if (style == HEXAGONS_STYLE) { + (void)UtilsSetValue("applist_style", "hexagons"); + } + } + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopPresenter.cpp new file mode 100644 index 000000000..e535895fb --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopPresenter.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SettingPresenter.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "SetDesktopView.h" +#include "SetDesktopModel.h" +#include "SetDesktopPresenter.h" + +namespace OHOS { + SetDesktopPresenter::SetDesktopPresenter() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopPresenter::SetDesktopPresenter"); + } + + SetDesktopPresenter::~SetDesktopPresenter() {} + + void SetDesktopPresenter::OnStart() + { + Presenter::OnStart(); + } + + void SetDesktopPresenter::OnResume(void) + { + } + + void SetDesktopPresenter::OnStop(void) + { + } + + bool SetDesktopPresenter::OnDrag(UIView& view, const DragEvent& event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopPresenter::OnDrag"); + UNUSED(view); + if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && + (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnDrag ChangeSlice"); + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); + } + return false; + } + + bool SetDesktopPresenter::OnClick(UIView &view, const ClickEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopPresenter::OnClick"); + if (strcmp(view.GetViewId(), SET_DESKTOP_HEXAGONS) == 0) { + SetDesktopModel::GetInstance().SetDesktopStyle(HEXAGONS_STYLE); + } else if (strcmp(view.GetViewId(), SET_DESKTOP_LIST) == 0) { + SetDesktopModel::GetInstance().SetDesktopStyle(APPLIST_STYLE); + } + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); + return true; + } + + bool SetDesktopPresenter::GetHexagonsStyleState(void) + { + return (SetDesktopModel::GetInstance().GetDesktopStyle() == HEXAGONS_STYLE); + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopView.cpp new file mode 100644 index 000000000..c5f2b49df --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_desktop/src/SetDesktopView.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDesktopView.cpp + * Author: + * Create: 2021-11-23 + */ + +#include +#include "SetDesktopView.h" +#include "SetDesktopPresenter.h" + +namespace OHOS { +SetDesktopView::SetDesktopView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::SetDesktopView"); +} + +SetDesktopView::~SetDesktopView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::~SetDesktopView"); +} + +void SetDesktopView::OnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::OnStart"); + View::OnStart(); + SetContainerView(new UIViewGroup()); + container_->SetDraggable(true); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetOnDragListener(presenter_); + container_->SetTouchable(true); +} + +void SetDesktopView::OnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::OnSetUpView"); + View::OnSetUpView(); + + titleText.SetPosition(180, 45, 260, 110); + titleText.SetText("桌面"); + titleText.SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + titleText.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); + titleText.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + container_->Add(&titleText); + + listImage.SetPosition(25, 135, 190, 190); + listImage.SetSrc(PNG_SET_DESKTOP_BG_IMAGE); + container_->Add(&listImage); + + listBtn.SetPosition(47, 157, 148, 148); + listBtn.SetImages(PNG_SET_DESKTOP_LIST_IMAGE, PNG_SET_DESKTOP_LIST_IMAGE); + listBtn.SetViewId(SET_DESKTOP_LIST); + container_->Add(&listBtn); + + listText.SetPosition(96, 328, 200, 60); + listText.SetText("列表"); + listText.SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + listText.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + listText.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + container_->Add(&listText); + + hexagonsImage.SetPosition(247, 135, 190, 190); + hexagonsImage.SetSrc(PNG_SET_DESKTOP_BG_IMAGE); + container_->Add(&hexagonsImage); + + hexagonsBtn.SetPosition(267, 157, 148, 148); + hexagonsBtn.SetImages(PNG_SET_DESKTOP_HEXAGONS_IMAGE, PNG_SET_DESKTOP_HEXAGONS_IMAGE); + hexagonsBtn.SetViewId(SET_DESKTOP_HEXAGONS); + container_->Add(&hexagonsBtn); + + hexagonsText.SetPosition(305, 328, 200, 60); + hexagonsText.SetText("蜂窝"); + hexagonsText.SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + hexagonsText.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + hexagonsText.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + container_->Add(&hexagonsText); + + listBtn.SetOnClickListener(presenter_); + hexagonsBtn.SetOnClickListener(presenter_); + UpdateSelectedStyle(presenter_->GetHexagonsStyleState()); +} + +void SetDesktopView::OnTearDownView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::OnTearDownView"); + View::OnTearDownView(); +} + +void SetDesktopView::OnStop() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopView::OnStop"); + View::OnStop(); + if (container_ != nullptr) { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } +} + +void SetDesktopView::UpdateSelectedStyle(bool hexagonsSelected) +{ + listImage.SetVisible(!hexagonsSelected); + hexagonsImage.SetVisible(hexagonsSelected); + hexagonsBtn.SetState(hexagonsSelected); + listBtn.SetState(!hexagonsSelected); +} +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialInfo.h b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialInfo.h new file mode 100644 index 000000000..2de65cf48 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialInfo.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialInfo.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DIAL_INFO_H +#define SET_DIAL_INFO_H +#include +#include +#include +#include "common/image_cache_manager.h" +namespace OHOS { + typedef struct { + uint8_t dialFlag; /* 1:离线表盘 0:预制表盘 */ + uint8_t id; /* 仅预制表盘使用 */ + std::string dialFullName; /* 仅离线表盘使用 */ + std::string imageFullName; /* 仅预制表盘使用 */ + std::string dialName; + std::string description; /* 仅离线表盘使用 */ + ImageInfo *preImageInfo; + } SetDialInfo; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialModel.h b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialModel.h new file mode 100644 index 000000000..6125415a8 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialModel.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialModel.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DIAL_MODEL_H +#define SET_DIAL_MODEL_H +#include "AppViewIDs.h" +#include "UiConfig.h" +#include "SetDialInfo.h" + +namespace OHOS { + class SetDialModel { + public: + static SetDialModel &GetInstance(void); + void LoadAllDial(void); + size_t GetDialCount(void); + std::vector& GetDialInfo(void); + void SaveDialSetting(uint8_t pageIndex); + uint8_t GetPageIndex(void); + private: + void LoadAllDialFromRam(void); + void LoadAllDialFromFs(void); + SetDialModel(); + SetDialModel(const SetDialModel &); + SetDialModel &operator=(const SetDialModel &); + virtual ~SetDialModel(); + int32_t ParseDialHeader(const std::string &dialFileName, SetDialInfo &dialInfo); + std::vector dialInfoList; + }; +} + +#endif // SET_DIAL_MODEL_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialPresenter.h new file mode 100644 index 000000000..1af1cc92c --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialPresenter.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialPresenter.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DIAL_PRESENTER_H +#define SET_DIAL_PRESENTER_H +#include "SetDialInfo.h" +#include "SetDialModel.h" +#include "Presenter.h" +#include "components/ui_view.h" +#include "KeyInputListener.h" +#include "ModelListenerSample.h" + +namespace OHOS { + +const uint16_t MISS_DIAL_OPERATION_TIME = 3000; + +class SetDialView; +class SetDialModel; +class SetDialPresenter : public Presenter, + public UIView::OnClickListener, public ModelListenerSample, + public UICoverflowView::OnCoverflowScrollListener { +public: + SetDialPresenter(); + ~SetDialPresenter() override; + size_t GetDialCount(void); + std::vector& GetDialInfo(void); + uint8_t GetPageIndex(void); + void OnStart() override; + void OnResume() override; + void OnStop() override; + void OnTickEvent() override; + void Notify() override {} + bool OnScroll() override; + bool OnClick(UIView &view, const ClickEvent &event) override; + void ResetTickTimer(void); +private: + void OnClickAction(void); + KeyInputListener *keyActListenr{nullptr}; + SetDialModel *model{nullptr}; + uint64_t startTime{0}; +}; +} + +#endif // SET_DIAL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialView.h b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialView.h new file mode 100644 index 000000000..0a7f564fe --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/include/SetDialView.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialView.h + * Author: + * Create: 2021-11-23 + */ + +#ifndef SET_DIAL_VIEW_H +#define SET_DIAL_VIEW_H + +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_coverflow_view.h" +#include "window/window.h" +#include "BaseView.h" +#include "ChangeSliceListener.h" +#include "UiConfig.h" + +namespace OHOS { +static constexpr uint8_t DIVISOR_TWO = 2; +class SetDialPresenter; + +class SetDialView : public View { +public: + SetDialView(); + ~SetDialView() override; + + static SetDialView *GetInstance() + { + static SetDialView instance; + return &instance; + } + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + void CoverflowViewScroll(void); + uint8_t GetCoverflowPage(void); +private: + void SetUpCoverflowView(void); + UICoverflowView coverflow_; + UILabel label_; + uint8_t lastIndex_; +}; +} +#endif // SET_DIAL_VIEW_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialModel.cpp new file mode 100644 index 000000000..c26ec330a --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialModel.cpp @@ -0,0 +1,171 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialModel.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "MainModel.h" +#include "SetDialModel.h" +#include "kv_store.h" +#include "securec.h" +#include "dirent.h" +#include "DialBinParser.h" +#include "wearable_log.h" + +namespace OHOS { + SetDialModel::SetDialModel() {} + + SetDialModel::~SetDialModel() {} + + SetDialModel &SetDialModel::GetInstance() + { + static SetDialModel instance; + return instance; + } + void SetDialModel::LoadAllDial() + { + dialInfoList.clear(); + LoadAllDialFromRam(); + LoadAllDialFromFs(); + } + + void SetDialModel::LoadAllDialFromRam() + { + for (uint8_t i = DIAL_CLOCK; i < DIAL_MAX; i++) { + const DialInfo *info = MainModel::GetInstance().GetDialInfo((DialId)i); + if (info != nullptr) { + SetDialInfo dialInfo{0}; + dialInfo.dialFlag = 0; + dialInfo.id = i; + dialInfo.dialName = info->dialName; + dialInfo.imageFullName = info->dialImg; + ImageInfo* imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(info->dialImg, false); + if (info == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "LoadAllDialFromRam loadimage %s fail", + info->dialImg); + continue; + } + dialInfo.preImageInfo = imageInfo; + dialInfoList.push_back(dialInfo); + } + } + } + + void SetDialModel::LoadAllDialFromFs() + { + int ret; + struct dirent *direntp; + + // 打开目录 + DIR *dirp = opendir(APP_DIAL_PATH); + // 遍历文件 + if (dirp != nullptr) { + while ((direntp = readdir(dirp)) != nullptr) { + SetDialInfo dialInfo{0}; + int ret = ParseDialHeader(direntp->d_name, dialInfo); + if (ret == 0) { + dialInfoList.push_back(dialInfo); + } + } + } + // 关闭目录 + closedir(dirp); + return; + } + + int32_t SetDialModel::ParseDialHeader(const std::string &dialFileName, SetDialInfo &dialInfo) + { + std::string dialFullName = APP_DIAL_PATH; + dialFullName += "/"; + dialFullName += dialFileName; + FILE *fp = fopen(dialFullName.c_str(), "rb"); + if (fp == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader cannot open file: %s", + dialFullName.c_str()); + return -1; + } + DialPreviewInfo preInfo{0}; + bool ret = DialBinParser::GetInstance()->GetDialPreviewInfo(fp, &preInfo); + if (!ret) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetDialPreviewInfo %s fail", + dialFullName.c_str()); + return -1; + } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader dialFullName: %s", + dialFullName.c_str()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader dialName: %s", + preInfo.dialName); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader description: %s", + preInfo.description); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader previewImgId: %u", + preInfo.imgId); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader imageOffset: %u", + preInfo.offset); + ImageInfo *info = ImageCacheManager::GetInstance().LoadOneInMultiRes( + preInfo.imgId, dialFullName, fp, false, preInfo.offset); + if (info == nullptr) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ParseDialHeader loadimage fail"); + return -1; + } + + dialInfo.dialFlag = 1; + dialInfo.id = 0; + dialInfo.dialFullName = dialFullName; + dialInfo.dialName = preInfo.dialName; + dialInfo.description = preInfo.description; + dialInfo.preImageInfo = info; + + fclose(fp); + return 0; + } + + void SetDialModel::SaveDialSetting(uint8_t pageIndex) + { + if (pageIndex >= dialInfoList.size()) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialModel SaveDialSetting [%u %u]", + pageIndex, dialInfoList.size()); + return; + } + DialSetting diagSetting; + SetDialInfo &info = dialInfoList[pageIndex]; + diagSetting.dialFlag = info.dialFlag; + diagSetting.dialId = info.id; + diagSetting.dialFullName = info.dialFullName; + MainModel::GetInstance().AddDialSetting(diagSetting); + } + + size_t SetDialModel::GetDialCount(void) + { + return dialInfoList.size(); + } + + std::vector& SetDialModel::GetDialInfo(void) + { + return dialInfoList; + } + + uint8_t SetDialModel::GetPageIndex(void) + { + uint8_t index = 0; + DialSetting dialSetting = MainModel::GetInstance().GetDialSetting(); + for (auto iter : dialInfoList) { + if (dialSetting.dialFlag) { + if (strcmp(iter.dialFullName.c_str(), dialSetting.dialFullName.c_str()) == 0) { + break; + } + } else { + if (iter.id == dialSetting.dialId ) { + break; + } + } + index++; + } + if (index >= dialInfoList.size()) { + return 0; + } else { + return index; + } + } + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp new file mode 100644 index 000000000..2c3ae789d --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialPresenter.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialPresenter.cpp + * Author: + * Create: 2021-11-23 + */ + +#include "SetDialView.h" +#include "SetDialModel.h" +#include "SetDialPresenter.h" + +namespace OHOS { + SetDialPresenter::SetDialPresenter() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialPresenter::SetDialPresenter"); + model = &SetDialModel::GetInstance(); + model->LoadAllDial(); + ResetTickTimer(); + } + + SetDialPresenter::~SetDialPresenter() + { + if (keyActListenr != nullptr) { + delete keyActListenr; + keyActListenr = nullptr; + } + } + + void SetDialPresenter::OnStart() + { + Presenter::OnStart(); + if (keyActListenr == nullptr) { + keyActListenr = new KeyInputListener(); + if (keyActListenr != nullptr) { + RootView::GetInstance()->SetOnKeyActListener(keyActListenr); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnStart: new KeyInputListener fail"); + } + } + } + + void SetDialPresenter::OnResume(void) + { + } + + void SetDialPresenter::OnStop(void) + { + } + + void SetDialPresenter::OnClickAction(void) + { + uint8_t pageIndex = view_->GetCoverflowPage(); + model->SaveDialSetting(pageIndex); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); + } + + bool SetDialPresenter::OnClick(UIView &view, const ClickEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialPresenter::OnClick"); + OnClickAction(); + return true; + } + + bool SetDialPresenter::OnScroll() + { + view_->CoverflowViewScroll(); + return true; + } + + size_t SetDialPresenter::GetDialCount(void) + { + return model->GetDialCount(); + } + + std::vector& SetDialPresenter::GetDialInfo(void) + { + return model->GetDialInfo(); + } + + uint8_t SetDialPresenter::GetPageIndex(void) + { + return model->GetPageIndex(); + } + + void SetDialPresenter::OnTickEvent() + { + uint64_t current_time = osKernelGetTick2ms(); + if ((startTime != 0) && (current_time - startTime > MISS_DIAL_OPERATION_TIME)) { + OnClickAction(); + } + } + + void SetDialPresenter::ResetTickTimer(void) + { + startTime = osKernelGetTick2ms(); + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialView.cpp new file mode 100644 index 000000000..daa69cd6f --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/set_dial/src/SetDialView.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: SetDialView.cpp + * Author: + * Create: 2021-11-23 + */ + +#include +#include "SetDialView.h" +#include "SetDialPresenter.h" + +namespace OHOS { +SetDialView::SetDialView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::SetDialView"); +} + +SetDialView::~SetDialView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::~SetDialView"); +} + +void SetDialView::OnStart() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::OnStart"); + View::OnStart(); + SetContainerView(new UIViewGroup()); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + SetUpCoverflowView(); +} + +void SetDialView::SetUpCoverflowView(void) +{ + coverflow_.SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + coverflow_.SetIntercept(true); + coverflow_.SetOnCoverflowListener(presenter_); + coverflow_.SetOnClickListener(presenter_); + std::vector &dialInfo = presenter_->GetDialInfo(); + for (auto iter : dialInfo) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::SetUpCoverflowView %s", + iter.dialName.c_str()); + coverflow_.Add(iter.dialName.c_str(), iter.preImageInfo); + } + lastIndex_ = presenter_->GetPageIndex(); + coverflow_.SetCurrentPage(lastIndex_); + + label_.SetPosition(127, 50, 200, 50); + label_.SetTextColor(Color::White()); + label_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label_.SetText(dialInfo[lastIndex_].dialName.c_str()); + label_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + container_->Add(&coverflow_); + container_->Add(&label_); +} + +void SetDialView::OnSetUpView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::OnSetUpView"); + View::OnSetUpView(); +} + +void SetDialView::OnTearDownView() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::OnTearDownView"); + View::OnTearDownView(); +} + +void SetDialView::OnStop() +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDialView::OnStop"); + View::OnStop(); + if (container_ != nullptr) { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } +} + +void SetDialView::CoverflowViewScroll(void) +{ + int16_t contMidX = static_cast(Screen::GetInstance().GetWidth() / DIVISOR_TWO); + int16_t minOffset = contMidX; + uint8_t newCenterIndex = lastIndex_; + for (uint8_t i = 0; i < coverflow_.GetChildrenNumber(); i++) { + Rect rect = coverflow_.GetViewByIndex(i)->GetOrigRect(); + int16_t x = rect.GetLeft(); + int16_t x1 = rect.GetRight(); + int16_t xMid = static_cast(x + (x1 - x + 1) / DIVISOR_TWO); + int16_t distance = MATH_ABS(xMid - contMidX); + if (distance < minOffset) { + newCenterIndex = i; + minOffset = distance; + } + } + if (newCenterIndex != lastIndex_) { + lastIndex_ = newCenterIndex; + std::vector &dialInfo = presenter_->GetDialInfo(); + label_.SetText(dialInfo[lastIndex_].dialName.c_str()); + } + + Rect curViewRect = coverflow_.GetViewByIndex(lastIndex_)->GetOrigRect(); + int16_t centerMid = curViewRect.GetLeft() + curViewRect.GetWidth() / DIVISOR_TWO; + int16_t offset = MATH_ABS(contMidX - centerMid); + if (offset > curViewRect.GetWidth() / DIVISOR_TWO) { + label_.SetStyle(STYLE_TEXT_OPA, 0); + } else { + uint8_t alpha = (uint8_t)((1.0f - ((float)offset / (curViewRect.GetWidth() / DIVISOR_TWO))) * OPA_OPAQUE); + label_.SetStyle(STYLE_TEXT_OPA, alpha); + } + presenter_->ResetTickTimer(); +} + +uint8_t SetDialView::GetCoverflowPage(void) +{ + return lastIndex_; +} + +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingAdapter.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingAdapter.h index 80cd05eb6..d89fe3ee0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingAdapter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingAdapter.h @@ -24,7 +24,7 @@ namespace OHOS { class SettingAdapter : public AbstractAdapter { public: explicit SettingAdapter(); - virtual ~SettingAdapter(); + ~SettingAdapter() override; /* * * @brief Sets the UIView adapter data, which is a SettingItem linked list. @@ -42,11 +42,11 @@ public: * @since 1.0 * @version 1.0 */ - virtual uint16_t GetCount(void) override; + uint16_t GetCount(void) override; - virtual UIView *GetView(UIView *inView, int16_t index) override; + UIView *GetView(UIView *inView, int16_t index) override; - virtual void AddListItem(const SettingItem &item); + void AddListItem(const SettingItem &item); void SetItemClickListener(UIView::OnClickListener *itemclicklistener) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h index 448deb599..250105ce0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItem.h @@ -11,19 +11,8 @@ #include namespace OHOS { -/* - * setting id. - */ -typedef enum : uint16_t { - // setting item index - SETTING_ITEM_ZERO = 0x0000, - SETTING_ITEM_ONE, - SETTING_ITEM_TWO, - SETTING_ITEM_THREE, -} SettingIndex; - typedef struct { - SettingIndex index; + AppViewId viewId; const char *icon; const char *label; bool hasSecondMenu; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItemView.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItemView.h index 20de7163c..934e8166b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItemView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingItemView.h @@ -19,18 +19,16 @@ namespace OHOS { class SettingItemView : public UIViewGroup { public: explicit SettingItemView(); - virtual ~SettingItemView(); + ~SettingItemView() override; virtual void SetItemInfo(const SettingItem itemInfo); virtual void SetUpChild(); - SettingIndex GetSettingIndex(); - + AppViewId GetViewId(); + const char* GetIconId(); private: - SettingItemView(const SettingItemView &); - UIImageView sIcon; UILabel sLabel; UIImageView sNextImage; - SettingItem sItemInfo = { SETTING_ITEM_ZERO, nullptr, nullptr, false }; + SettingItem sItemInfo = { VIEW_INVALID, nullptr, nullptr, false }; }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h index d26280bec..6a50ebfc8 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h @@ -16,13 +16,13 @@ #include "SettingPresenter.h" namespace OHOS { + static const uint16_t SETTING_ITEM_COUNT = 10; class SettingModel { public: static SettingModel &GetInstance(void); void InitSettingItem(); const SettingItem *GetSettinglistItems() const; uint8_t GetSettingListNum() const; - const std::map &GetSettingIdToViewId() const; bool GetBlueToothConnectStatus(void); void UpdateBlueToothConnectStatus(bool status); private: @@ -30,9 +30,8 @@ namespace OHOS { SettingModel(const SettingModel &); SettingModel &operator=(const SettingModel &); virtual ~SettingModel(); - static const uint16_t SETTING_ITEM_LEN = 4; - SettingItem settings[SETTING_ITEM_LEN] = { SETTING_ITEM_ZERO, nullptr, nullptr, false }; - std::map settingIdToViewId; + SettingItem settings[SETTING_ITEM_COUNT] = { VIEW_INVALID, nullptr, nullptr, false }; + int usedLen; bool btConnectStatus{false}; }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingPresenter.h index 08ca8d580..827ad6fac 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingPresenter.h @@ -19,14 +19,14 @@ class SettingPresenter : public Presenter, public UIView::OnDragListener { public: SettingPresenter(); - virtual ~SettingPresenter(); + ~SettingPresenter() override; - virtual void OnStart() override; - virtual void OnResume() override; - virtual void OnStop() override; + void OnStart() override; + void OnResume() override; + void OnStop() override; bool OnClick(UIView &view, const ClickEvent &event) override; - virtual bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnDrag(UIView& view, const DragEvent& event) override; private: SettingModel *settingModel; }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingView.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingView.h index a016243a6..94ab5101d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingView.h @@ -23,12 +23,12 @@ class SettingPresenter; class SettingView : public View { public: SettingView(); - virtual ~SettingView(); + ~SettingView() override; - virtual void OnStart() override; - virtual void OnSetUpView() override; - virtual void OnTearDownView() override; - virtual void OnStop() override; + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; void AddSettingItemToList(const SettingItem &item); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp index f9b7424e3..fed442ced 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp @@ -67,8 +67,13 @@ namespace OHOS { sNextImage.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); } - SettingIndex SettingItemView::GetSettingIndex() + AppViewId SettingItemView::GetViewId() { - return sItemInfo.index; + return sItemInfo.viewId; + } + + const char* SettingItemView::GetIconId() + { + return sItemInfo.icon; } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp index 016996c62..71fed048f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp @@ -21,14 +21,15 @@ namespace OHOS { void SettingModel::InitSettingItem() { - settings[0] = {SETTING_ITEM_ZERO, PNG_BLUETOOTH_STITLE, "蓝牙耳机", true}; - settings[1] = {SETTING_ITEM_ONE, PNG_CONNECT_PHONE_IMAGE, "连接手机", true}; - settings[2] = {SETTING_ITEM_TWO, PNG_SETTTING_REBOOT_IMAGE, "重启", true}; - settings[3] = {SETTING_ITEM_THREE, PNG_SETTTING_SHUTDOWN_IMAGE, "关机", true}; - settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_BLUETOOTH_EARPHONE)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_CONNECT_PHONE)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_REBOOT)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_REBOOT)); + int index = 0; + settings[index++] = {VIEW_BLUETOOTH_EARPHONE, PNG_BLUETOOTH_STITLE, "蓝牙耳机", true}; + settings[index++] = {VIEW_CONNECT_PHONE, PNG_CONNECT_PHONE_IMAGE, "连接手机", true}; + settings[index++] = {VIEW_REBOOT, PNG_SETTTING_REBOOT_IMAGE, "重启", true}; + settings[index++] = {VIEW_REBOOT, PNG_SETTTING_SHUTDOWN_IMAGE, "关机", true}; + settings[index++] = {VIEW_SET_DESKTOP, PNG_SETTTING_DESKTOP_IMAGE, "桌面", true}; + settings[index++] = {VIEW_SET_DIAL, PNG_SETTTING_DESKTOP_IMAGE, "表盘", true}; + settings[index++] = {VIEW_SET_CARD, PNG_SETTTING_DESKTOP_IMAGE, "卡片", true}; + usedLen = index; } const SettingItem *SettingModel::GetSettinglistItems() const @@ -38,12 +39,7 @@ namespace OHOS { uint8_t SettingModel::GetSettingListNum() const { - return SETTING_ITEM_LEN; - } - - const std::map &SettingModel::GetSettingIdToViewId() const - { - return settingIdToViewId; + return usedLen; } bool SettingModel::GetBlueToothConnectStatus(void) @@ -54,7 +50,7 @@ namespace OHOS { void SettingModel::UpdateBlueToothConnectStatus(bool status) { btConnectStatus = status; - if (PullUpDownView::GetInstance() != NULL) { + if (PullUpDownView::GetInstance() != nullptr) { PullUpDownView::GetInstance()->UpdateBlueToothStatus(status); } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp index 6f6fd5ae8..1b21157c6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp @@ -56,20 +56,17 @@ namespace OHOS { { UNUSED(event); SettingItemView *settingItemView = static_cast(&view); - SettingIndex index = settingItemView->GetSettingIndex(); - if (index >= SettingModel::GetInstance().GetSettingListNum()) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnClick is no index"); - return false; - } else { - if (index == SETTING_ITEM_TWO) { + AppViewId viewId = settingItemView->GetViewId(); + if (viewId == VIEW_REBOOT) { + if (strstr(settingItemView->GetIconId(), "REBOOT") != nullptr) { RebootModel::GetInstance()->SetSelectViewId(REBOOTDEVICE); RebootModel::GetInstance()->SetExitsView(true); - } else if (index == SETTING_ITEM_THREE) { + } else { RebootModel::GetInstance()->SetSelectViewId(SHUTDOWNDEVICE); RebootModel::GetInstance()->SetExitsView(true); } - NativeAbility::GetInstance().ChangeSlice(SettingModel::GetInstance().GetSettingIdToViewId().at(index)); - return true; } + NativeAbility::GetInstance().ChangeSlice(viewId); + return true; } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp index 9de644b8c..868feb134 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp @@ -31,21 +31,31 @@ SettingView::SettingView() SettingView::~SettingView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingView::~SettingView"); - scrollView->RemoveAll(); - delete title; - title = nullptr; + if (scrollView != nullptr) { + scrollView->RemoveAll(); + delete scrollView; + scrollView = nullptr; + } - delete listAdapter; - listAdapter = nullptr; + if (title != nullptr) { + delete title; + title = nullptr; + } - delete contentList; - contentList = nullptr; + if (listAdapter != nullptr) { + delete listAdapter; + listAdapter = nullptr; + } - delete scrollView; - scrollView = nullptr; + if (contentList != nullptr) { + delete contentList; + contentList = nullptr; + } - delete dragListener; - dragListener = nullptr; + if (dragListener != nullptr) { + delete dragListener; + dragListener = nullptr; + } } void SettingView::OnStart() @@ -122,8 +132,7 @@ void SettingView::OnSetUpView() scrollView->Add(contentList); RootView::GetInstance()->Add(scrollView); contentList->SetAdapter(listAdapter); - - Draw(); + container_ = scrollView; return; } @@ -131,18 +140,13 @@ void SettingView::OnTearDownView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingView::OnTearDownView"); View::OnTearDownView(); - return; + Draw(); } void SettingView::OnStop() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingView::OnStop"); View::OnStop(); - if (container_ != nullptr) { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); return; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempClickMea.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempClickMea.h index c73207053..7756ff74e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempClickMea.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempClickMea.h @@ -17,7 +17,7 @@ namespace OHOS { class TempClickMea : public UIScrollView { public: TempClickMea(); - virtual ~TempClickMea(); + ~TempClickMea() override; bool InitClickMea(); static TempClickMea *GetInstance(); void RefreshClickMea(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempContinueWarn.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempContinueWarn.h index d827b2284..c6aca9ea1 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempContinueWarn.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempContinueWarn.h @@ -17,7 +17,7 @@ namespace OHOS { class TempContinueWarn : public UIViewGroup { public: TempContinueWarn(); - virtual ~TempContinueWarn(); + ~TempContinueWarn() override; bool InitTempContinue(); static TempContinueWarn *GetInstance(); void RefreshTempContinue(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitInter.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitInter.h index 27207e5ec..81df8141b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitInter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitInter.h @@ -17,7 +17,7 @@ namespace OHOS { class TempExitInter : public AppGroupView { public: TempExitInter(); - virtual ~TempExitInter(); + ~TempExitInter() override; static TempExitInter *GetInstance(); bool InitView(void *caller) override; private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitPrompt.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitPrompt.h index cd02beb48..63543772d 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitPrompt.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempExitPrompt.h @@ -17,7 +17,7 @@ namespace OHOS { class TempExitPrompt : public UIScrollView { public: TempExitPrompt(); - virtual ~TempExitPrompt(); + ~TempExitPrompt() override; bool InitExitPrompt(); static TempExitPrompt *GetInstance(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempInitInter.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempInitInter.h index 69b4997b0..6de798213 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempInitInter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempInitInter.h @@ -18,7 +18,7 @@ namespace OHOS { class TempInitInter : public AppGroupView { public: TempInitInter(); - virtual ~TempInitInter(); + ~TempInitInter() override; static TempInitInter *GetInstance(); bool InitView(void *caller) override; private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempJoinStudy.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempJoinStudy.h index 20e1759ab..6aec60c0b 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempJoinStudy.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempJoinStudy.h @@ -17,7 +17,7 @@ namespace OHOS { class TempJoinStudy : public UIScrollView { public: TempJoinStudy(); - virtual ~TempJoinStudy(); + ~TempJoinStudy() override; bool InitJoinStudy(); static TempJoinStudy *GetInstance(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempLittleTip.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempLittleTip.h index ffec9b440..49320fcff 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempLittleTip.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempLittleTip.h @@ -16,7 +16,7 @@ namespace OHOS { class TempLittleTip : public UIScrollView { public: TempLittleTip(); - virtual ~TempLittleTip(); + ~TempLittleTip() override; bool InitLittleTip(); static TempLittleTip *GetInstance(); void RefreshTip(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMainView.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMainView.h index 2a9dc4610..9fe86b1f6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMainView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMainView.h @@ -36,7 +36,7 @@ class TempMainView; class TempMainView : public View { public: TempMainView(); - virtual ~TempMainView(); + ~TempMainView() override; static TempMainView *GetInstance(void); void OnStart() override; void OnSetUpView() override; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeaProcess.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeaProcess.h index 94b8f79ea..ebd0ee48a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeaProcess.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeaProcess.h @@ -18,7 +18,7 @@ namespace OHOS { class TempMeaProcess : public UIScrollView { public: TempMeaProcess(); - virtual ~TempMeaProcess(); + ~TempMeaProcess() override; static TempMeaProcess *GetInstance(); bool InitMeaProcess(void); void TempMeaDelayExit(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeasure.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeasure.h index 433941f89..de6aa31c0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeasure.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempMeasure.h @@ -18,7 +18,7 @@ namespace OHOS { class TempMeasure : public AppGroupView { public: TempMeasure(); - virtual ~TempMeasure(); + ~TempMeasure() override; static TempMeasure *GetInstance(); bool InitView(void *caller) override; private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPresenter.h index d5e57715b..06c034658 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPresenter.h @@ -69,7 +69,7 @@ class TempPresenter : public Presenter, public UIView::OnClickList public ModelListenerSample, public UISwipeView::OnSwipeListener { public: TempPresenter(); - virtual ~TempPresenter(); + ~TempPresenter() override; void OnStart() override; void OnPause() override; void OnResume() override; @@ -98,7 +98,7 @@ public: void ProgressNotify(void); void SetTempCountMax(void); void UpdateTempCount(void); - virtual void Notify() override; + void Notify() override; private: uint8 wearListen{0}; int8 tempListen{-1}; // 监测隐藏界面 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPromptWear.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPromptWear.h index b1cf4238c..5f590e00f 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPromptWear.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempPromptWear.h @@ -18,7 +18,7 @@ namespace OHOS { class TempPromptWear : public UIScrollView { public: TempPromptWear(); - virtual ~TempPromptWear(); + ~TempPromptWear() override; bool InitPromptWear(); static TempPromptWear *GetInstance(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempRemindWear.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempRemindWear.h index 4bde638a1..24f10ed90 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempRemindWear.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempRemindWear.h @@ -17,7 +17,7 @@ namespace OHOS { class TempRemindWear : public UIScrollView { public: TempRemindWear(); - virtual ~TempRemindWear(); + ~TempRemindWear() override; bool InitRemindWear(); static TempRemindWear *GetInstance(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempReport.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempReport.h index 12df52cfc..3faadd519 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempReport.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempReport.h @@ -17,7 +17,7 @@ namespace OHOS { class TempReport : public AppGroupView { public: TempReport(); - virtual ~TempReport(); + ~TempReport() override; static TempReport *GetInstance(); bool InitView(void *caller) override; private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempStudyAbout.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempStudyAbout.h index b20be9516..3d0deee4a 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempStudyAbout.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempStudyAbout.h @@ -16,7 +16,7 @@ namespace OHOS { class TempStudyAbout : public UIScrollView { public: TempStudyAbout(); - virtual ~TempStudyAbout(); + ~TempStudyAbout() override; bool InitStudyAbout(); static TempStudyAbout *GetInstance(); void RefreshStudy(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempWarn.h b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempWarn.h index c87af9490..821b4a4bb 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempWarn.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/include/TempWarn.h @@ -18,7 +18,7 @@ namespace OHOS { class TempWarn : public UIScrollView { public: TempWarn(); - virtual ~TempWarn(); + ~TempWarn() override; bool InitTempWarn(); static TempWarn *GetInstance(); void RefreshTempWarn(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempClickMea.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempClickMea.cpp index 478501d1b..28c402b60 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempClickMea.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempClickMea.cpp @@ -125,11 +125,11 @@ bool TempClickMea::InitClickMea(void) SetDraggable(true); SetTouchable(true); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempClickMea::InitClickMea TempInitLabel() false"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempClickMea::InitClickMea TempInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempContinueWarn.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempContinueWarn.cpp index 8fe2db4eb..3a7799b8e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempContinueWarn.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempContinueWarn.cpp @@ -130,11 +130,11 @@ bool TempContinueWarn::InitTempContinue(void) SetDraggable(true); SetTouchable(true); - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempContinueWarn::InitTempContinue TempInitImage() error"); return false; } - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempContinueWarn::InitTempContinue TempInitLabel() error"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitInter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitInter.cpp index 09128a8f1..16ab19dcf 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitInter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitInter.cpp @@ -45,14 +45,13 @@ TempExitInter::~TempExitInter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempExitInter::~TempExitInter"); RemoveAll(); - int labelNum, ImageNum; - for (labelNum = SET_ZERO; labelNum < SET_TWO; labelNum++) { + for (int32_t labelNum = SET_ZERO; labelNum < SET_TWO; labelNum++) { if (tempLabel[labelNum] != nullptr) { delete tempLabel[labelNum]; tempLabel[labelNum] = nullptr; } } - for (ImageNum = SET_ZERO; ImageNum < SET_FOUR; ImageNum++) { + for (int32_t ImageNum = SET_ZERO; ImageNum < SET_FOUR; ImageNum++) { if (tempImage[ImageNum] != nullptr) { delete tempImage[ImageNum]; tempImage[ImageNum] = nullptr; @@ -118,19 +117,19 @@ bool TempExitInter::InitSimilarImage(int16 num, int16 tempX, int16 tempY, const bool TempExitInter::TempInitImage(void) { - if (InitSimilarImage(SET_ZERO, EXIT_IMAGE_X, EXIT_IMAGE_EXIT_Y, TEMP_EXIT) == false) { + if (!InitSimilarImage(SET_ZERO, EXIT_IMAGE_X, EXIT_IMAGE_EXIT_Y, TEMP_EXIT)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::TempInitImage new tempImage[SET_ZERO] fail"); return false; } - if (InitSimilarImage(SET_ONE, EXIT_IMAGE_X, EXIT_IMAGE_STUDY_Y, TEMP_ABOUT_STUDY) == false) { + if (!InitSimilarImage(SET_ONE, EXIT_IMAGE_X, EXIT_IMAGE_STUDY_Y, TEMP_ABOUT_STUDY)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::TempInitImage new tempImage[SET_ONE] fail"); return false; } - if (InitSimilarImage(SET_TWO, EXIT_IMAGE_THIS_X, EXIT_THIS_Y_FIRST, PNG_SETTTING_BUTTON_IMAGE) == false) { + if (!InitSimilarImage(SET_TWO, EXIT_IMAGE_THIS_X, EXIT_THIS_Y_FIRST, PNG_SETTTING_BUTTON_IMAGE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::TempInitImage new tempImage[SET_TWO] fail"); return false; } - if (InitSimilarImage(SET_THREE, EXIT_IMAGE_THIS_X, EXIT_THIS_Y_SECOND, PNG_SETTTING_BUTTON_IMAGE) == false) { + if (!InitSimilarImage(SET_THREE, EXIT_IMAGE_THIS_X, EXIT_THIS_Y_SECOND, PNG_SETTTING_BUTTON_IMAGE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::TempInitImage new tempImage[SET_THREE] fail"); return false; } @@ -153,11 +152,11 @@ bool TempExitInter::InitView(void *caller) SetDraggable(true); SetTouchable(true); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::InitView TempInitLabel() false"); return false; } - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitInter::InitView TempInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitPrompt.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitPrompt.cpp index 61512e3bf..1246218dd 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitPrompt.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempExitPrompt.cpp @@ -114,11 +114,11 @@ bool TempExitPrompt::InitExitPrompt(void) SetDraggable(true); SetTouchable(true); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitPrompt::InitExitPrompt TempInitLabel() false"); return false; } - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempExitPrompt::InitExitPrompt TempInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempInitInter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempInitInter.cpp index 134053f30..f82267b01 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempInitInter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempInitInter.cpp @@ -67,14 +67,13 @@ TempInitInter::~TempInitInter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempInitInter::~TempInitInter"); RemoveAll(); - int8 stNum, ndNum; - for (stNum = SET_ZERO; stNum < SET_THREE; stNum++) { + for (int8_t stNum = SET_ZERO; stNum < SET_THREE; stNum++) { if (tempImage[stNum] != nullptr) { delete tempImage[stNum]; tempImage[stNum] = nullptr; } } - for (ndNum = SET_ZERO; ndNum < TEMP_LABEL_MAX; ndNum++) { + for (int8_t ndNum = SET_ZERO; ndNum < TEMP_LABEL_MAX; ndNum++) { if (tempLabel[ndNum] != nullptr) { delete tempLabel[ndNum]; tempLabel[ndNum] = nullptr; @@ -142,18 +141,18 @@ typedef struct { } TempInitItem; static const TempInitItem tempInitItem[] = { - {SET_ZERO, LABEL_ONE_X, TEMP_INIT_LABEL_TEMP_Y, TEMP_INIT_LABEL_WIDTH, TEMP_INIT_LABEL_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_FONT, TEMP_INIT_TEMP_LABEL}, - {SET_ONE, LABEL_TWO_X, TEMP_INIT_LABEL_TEMP_Y, TEMP_INIT_LABEL_WIDTH, TEMP_INIT_LABEL_WIDTH, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_FONT, TEMP_INIT_SKIN_TEMP_LABEL}, - {SET_TWO, TEMP_INIT_LABEL_THREE_X, TEMP_INIT_LABEL_SKIN_Y, LABEL_THREE_WIDTH, TITLE_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_SKIN_SMALL_LABEL}, - {SET_THREE, TEMP_INIT_LABEL_FOUR_X, TEMP_INIT_LABEL_THREE_Y, TITLE_WIDTH, TITLE_WIDTH, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_TITLE_FONT, TEMP_INIT_TITLE}, - {SET_FOUR, TEMP_INIT_LABEL_TIME_X, TEMP_INIT_LABEL_TIME_Y, TITLE_WIDTH, TITLE_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_TITLE_TIME}, - {SET_FIVE, LABEL_FIVE_X, TEMP_INIT_LABEL_FIVE_Y, LABEL_FIVE_WIDTH, LABEL_FIVE_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_LABEL_TIP}, + { SET_ZERO, LABEL_ONE_X, TEMP_INIT_LABEL_TEMP_Y, TEMP_INIT_LABEL_WIDTH, TEMP_INIT_LABEL_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_FONT, TEMP_INIT_TEMP_LABEL }, + { SET_ONE, LABEL_TWO_X, TEMP_INIT_LABEL_TEMP_Y, TEMP_INIT_LABEL_WIDTH, TEMP_INIT_LABEL_WIDTH, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_FONT, TEMP_INIT_SKIN_TEMP_LABEL }, + { SET_TWO, TEMP_INIT_LABEL_THREE_X, TEMP_INIT_LABEL_SKIN_Y, LABEL_THREE_WIDTH, TITLE_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_SKIN_SMALL_LABEL }, + { SET_THREE, TEMP_INIT_LABEL_FOUR_X, TEMP_INIT_LABEL_THREE_Y, TITLE_WIDTH, TITLE_WIDTH, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_TITLE_FONT, TEMP_INIT_TITLE }, + { SET_FOUR, TEMP_INIT_LABEL_TIME_X, TEMP_INIT_LABEL_TIME_Y, TITLE_WIDTH, TITLE_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_TITLE_TIME }, + { SET_FIVE, LABEL_FIVE_X, TEMP_INIT_LABEL_FIVE_Y, LABEL_FIVE_WIDTH, LABEL_FIVE_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_INIT_TEMP_SKIN_FONT, TEMP_INIT_LABEL_TIP }, }; bool TempInitInter::SetBasicLabel(void) @@ -216,19 +215,19 @@ bool TempInitInter::InitView(void *caller) return false; } - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempInitInter::InitView TempInitImage() false"); return false; } - if (SetBasicLabel() == false) { + if (!SetBasicLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempInitInter::InitView TempInitLabel() false"); return false; } - if (SetAppendLabel() ==false) { + if (!SetAppendLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempInitInter::InitView TempLowLabel() false"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempInitInter::InitView TempInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp index 77d36a8ed..90eb0edff 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp @@ -49,18 +49,17 @@ TempJoinStudy::~TempJoinStudy() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::~TempJoinStudy"); RemoveAll(); - int numLabel, numButton; if (tempTitle != nullptr) { delete tempTitle; tempTitle = nullptr; } - for (numLabel = SET_ZERO; numLabel < TEMP_LABEL_MAX; numLabel++) { + for (int32_t numLabel = SET_ZERO; numLabel < TEMP_LABEL_MAX; numLabel++) { if (tempLabel[numLabel] != nullptr) { delete tempLabel[numLabel]; tempLabel[numLabel] = nullptr; } } - for (numButton = SET_ZERO; numButton < TEMP_BUTTON_MAX; numButton++) { + for (int32_t numButton = SET_ZERO; numButton < TEMP_BUTTON_MAX; numButton++) { if (tempButton[numButton] != nullptr) { delete tempButton[numButton]; tempButton[numButton] = nullptr; @@ -102,15 +101,15 @@ bool TempJoinStudy::TempInitLabel(void) tempTitle->SetText(TEMP_TITLE_TEXT); Add(tempTitle); - if (InitSimilarLabel(SET_ZERO, TEMP_LABEL_FIRST_Y, TEMP_LABEL_ONE) == false) { + if (!InitSimilarLabel(SET_ZERO, TEMP_LABEL_FIRST_Y, TEMP_LABEL_ONE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::TempInitLabel new tempLabel[SET_ZERO] error"); return false; } - if (InitSimilarLabel(SET_ONE, TEMP_LABEL_SECOND_Y, TEMP_LABEL_TWO) == false) { + if (!InitSimilarLabel(SET_ONE, TEMP_LABEL_SECOND_Y, TEMP_LABEL_TWO)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::TempInitLabel new tempLabel[SET_ONE] error"); return false; } - if (InitSimilarLabel(SET_TWO, TEMP_LABEL_THIRD_Y, TEMP_LABEL_THREE) == false) { + if (!InitSimilarLabel(SET_TWO, TEMP_LABEL_THIRD_Y, TEMP_LABEL_THREE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::TempInitLabel new tempLabel[SET_ONE] error"); return false; } @@ -174,11 +173,11 @@ bool TempJoinStudy::InitJoinStudy(void) SetDraggable(true); SetTouchable(true); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::InitJoinStudy TempInitLabel() false"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::InitJoinStudy TempInitButton() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempLittleTip.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempLittleTip.cpp index abf0694a8..0ce666801 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempLittleTip.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempLittleTip.cpp @@ -85,24 +85,24 @@ typedef struct { } TempTipItem; static const TempTipItem tempTipItem[] = { - {SET_ZERO, TEMP_TIP_LABEL_ONE_X, TEMP_TIP_LABEL_ONE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, TEMP_TIP_LABEL_TITLE_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_ONE}, - {SET_ONE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_TWO_Y, TEMP_LABEL_WIDTH, TEMP_LABEL_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_TWO}, - {SET_TWO, TEMP_TIP_LABEL_TITLE_X, TEMP_TIP_LABEL_THREE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, - TEMP_TIP_LABEL_TITLE_HEIGHT, (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_THREE}, - {SET_THREE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_FOUR_Y, TEMP_LABEL_WIDTH, TEMP_LABEL_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_FOUR}, - {SET_FOUR, TEMP_TIP_LABEL_TITLE_X, TEMP_TIP_LABEL_FIVE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, - TEMP_TIP_LABEL_TITLE_HEIGHT, (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_FIVE}, - {SET_FIVE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_SIX_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_SIX}, - {SET_SIX, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_SEVEN_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SEVEN_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_SEVEN}, - {SET_SEVEN, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_EIGHT_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_EIGHT}, - {SET_EIGHT, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_NIGHT_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_NINE}, + { SET_ZERO, TEMP_TIP_LABEL_ONE_X, TEMP_TIP_LABEL_ONE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, TEMP_TIP_LABEL_TITLE_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_ONE }, + { SET_ONE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_TWO_Y, TEMP_LABEL_WIDTH, TEMP_LABEL_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_TWO }, + { SET_TWO, TEMP_TIP_LABEL_TITLE_X, TEMP_TIP_LABEL_THREE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, + TEMP_TIP_LABEL_TITLE_HEIGHT, (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_THREE }, + { SET_THREE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_FOUR_Y, TEMP_LABEL_WIDTH, TEMP_LABEL_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_FOUR }, + { SET_FOUR, TEMP_TIP_LABEL_TITLE_X, TEMP_TIP_LABEL_FIVE_Y, TEMP_TIP_LABEL_TITLE_WIDTH, + TEMP_TIP_LABEL_TITLE_HEIGHT, (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TITLE_FONT, TEMP_TIP_LABEL_FIVE }, + { SET_FIVE, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_SIX_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_SIX }, + { SET_SIX, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_SEVEN_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SEVEN_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_SEVEN }, + { SET_SEVEN, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_EIGHT_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_EIGHT }, + { SET_EIGHT, TEMP_TIP_LABEL_X, TEMP_TIP_LABEL_NIGHT_Y, TEMP_LABEL_WIDTH, TEMP_TIP_LABEL_SIX_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_TIP_TEXT_FONT, TEMP_TIP_LABEL_NINE }, }; bool TempLittleTip::SetBasicLabel(void) @@ -155,11 +155,11 @@ bool TempLittleTip::InitLittleTip(void) SetDraggable(true); SetTouchable(true); - if (SetBasicLabel() == false) { + if (!SetBasicLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempLittleTip::InitLittleTip SetLabel() false"); return false; } - if (SetAppendLabel() == false) { + if (!SetAppendLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempLittleTip::InitLittleTip SetAppendLabel() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMainView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMainView.cpp index 2b111d515..5f0952fde 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMainView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMainView.cpp @@ -31,13 +31,12 @@ TempMainView::TempMainView() TempMainView::~TempMainView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempMainView::~TempMainView"); - int16 numGroup, numSwipe; - for (numGroup = SET_ZERO; numGroup <= INTERFACES_MAX; numGroup++) { + for (int16_t numGroup = SET_ZERO; numGroup <= INTERFACES_MAX; numGroup++) { if (container[numGroup] != nullptr) { container[numGroup] = nullptr; } } - for (numSwipe = SET_ZERO; numSwipe < SET_TWO; numSwipe++) { + for (int16_t numSwipe = SET_ZERO; numSwipe < SET_TWO; numSwipe++) { if (tempSwipeList[numSwipe] != nullptr) { tempSwipeList[numSwipe]->RemoveAll(); delete tempSwipeList[numSwipe]; @@ -74,7 +73,7 @@ void TempMainView::OnStart() group = container[0]; } else if (tempInterListen == SECOND_TIME_JOIN) { AppGroupView *view[SET_TWO] = {nullptr}; - if (SetSwipeInter(0) == false) { + if (!SetSwipeInter(0)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::OnStart SetSwipeInter[0] null error!"); return; } @@ -297,7 +296,7 @@ bool TempMainView::ChangeMeasure(int16 thisView) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure"); if (container[thisView] == nullptr) { AppGroupView *view[SET_THREE] = {nullptr}; - if (SetSwipeInter(SET_ZERO) == false) { + if (!SetSwipeInter(SET_ZERO)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure SetSwipeInter[0] null error!"); return false; } @@ -307,7 +306,7 @@ bool TempMainView::ChangeMeasure(int16 thisView) return false; } view[SET_ZERO] = tempMeasure; - if (view[SET_ZERO]->InitView(this) == false) { + if (!view[SET_ZERO]->InitView(this)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure view [0] InitView null error!"); return false; } @@ -318,7 +317,7 @@ bool TempMainView::ChangeMeasure(int16 thisView) return false; } view[SET_ONE] = tempExitInter; - if (view[SET_ONE]->InitView(this) == false) { + if (!view[SET_ONE]->InitView(this)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure view [1] InitView null error!"); return false; } @@ -344,7 +343,7 @@ bool TempMainView::ChangeClickMea(int16 thisView) return false; } container[thisView] = tempClickMea; - if (tempClickMea->InitClickMea() == false) { + if (!tempClickMea->InitClickMea()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeClickMea InitClickMea error!"); return false; } @@ -369,7 +368,7 @@ bool TempMainView::ChangeRemindWear(int16 thisView) return false; } container[thisView] = tempRemindWear; - if (tempRemindWear->InitRemindWear() == false) { + if (!tempRemindWear->InitRemindWear()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeRemindWear InitRemindWear error!"); return false; } @@ -389,7 +388,7 @@ bool TempMainView::ChangeMeaProcess(int16 thisView) return false; } container[thisView] = tempMeaProcess; - if (tempMeaProcess->InitMeaProcess() == false) { + if (!tempMeaProcess->InitMeaProcess()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeaProcess InitMeaProcess error!"); return false; } @@ -409,7 +408,7 @@ bool TempMainView::ChangeTempInit(int16 thisView) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeTempInit"); if (container[thisView] == nullptr) { AppGroupView *view[SET_THREE] = {nullptr}; - if (SetSwipeInter(SET_ONE) == false) { + if (!SetSwipeInter(SET_ONE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure SetSwipeInter[1] null error!"); return false; } @@ -419,7 +418,7 @@ bool TempMainView::ChangeTempInit(int16 thisView) return false; } view[SET_ZERO] = tempInitInter; - if (view[SET_ZERO]->InitView(this) == false) { + if (!view[SET_ZERO]->InitView(this)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeTempInit view [0] InitView null error!"); return false; } @@ -430,7 +429,7 @@ bool TempMainView::ChangeTempInit(int16 thisView) return false; } view[SET_ONE] = tempExitInter; - if (view[SET_ONE]->InitView(this) == false) { + if (!view[SET_ONE]->InitView(this)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeTempInit view [1] InitView null error!"); return false; } @@ -441,7 +440,7 @@ bool TempMainView::ChangeTempInit(int16 thisView) return false; } view[SET_TWO] = tempReport; - if (view[SET_TWO]->InitView(this) == false) { + if (!view[SET_TWO]->InitView(this)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeMeasure view [2] InitView null error!"); return false; } @@ -467,7 +466,7 @@ bool TempMainView::ChangeTempWarn(int16 thisView) return false; } container[thisView] = tempWarn; - if (tempWarn->InitTempWarn() == false) { + if (!tempWarn->InitTempWarn()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::InitTempWarn tempWarn null error!"); return false; } @@ -492,7 +491,7 @@ bool TempMainView::ChangeContinue(int16 thisView) return false; } container[thisView] = tempContinue; - if (tempContinue->InitTempContinue() == false) { + if (!tempContinue->InitTempContinue()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::InitTempWarn tempContinue null error!"); return false; } @@ -516,7 +515,7 @@ bool TempMainView::ChangeTempTip(int16 thisView) return false; } container[thisView] = tempLittleTip; - if (tempLittleTip->InitLittleTip() == false) { + if (!tempLittleTip->InitLittleTip()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView:: ChangeTempTip InitLittleTip null error!"); return false; } @@ -541,7 +540,7 @@ bool TempMainView::ChangeExitPrompt(int16 thisView) return false; } container[thisView] = tempExitPrompt; - if (tempExitPrompt->InitExitPrompt() == false) { + if (!tempExitPrompt->InitExitPrompt()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView:: ChangeExitPrompt InitExitPrompt null error!"); return false; } @@ -561,7 +560,7 @@ bool TempMainView::ChangeStudyAbout(int16 thisView) return false; } container[thisView] = tempStudyAbout; - if (tempStudyAbout->InitStudyAbout() == false) { + if (!tempStudyAbout->InitStudyAbout()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView:: ChangeStudyAbout InitStudyAbout null error!"); return false; } @@ -600,7 +599,7 @@ bool TempMainView::ClickFunc(int16 interface) for (int i = 0; i < funcSize; i++) { if (interface == ViewMapper[i].viewId) { bool jug = (this->*(ViewMapper[i].func))(interface); - if (jug == false) { + if (!jug) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: ChangeInterFace[%d] false", interface); return false; } @@ -618,7 +617,7 @@ void TempMainView::ChangeView(int16 hideView, int16 showView) return; } interListen = hideView; - if (ClickFunc(showView) == false) { + if (!ClickFunc(showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMainView::ChangeView ClickFunc error"); return; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeaProcess.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeaProcess.cpp index b28167168..462541cf2 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeaProcess.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeaProcess.cpp @@ -160,15 +160,15 @@ bool TempMeaProcess::InitMeaProcess(void) SetDraggable(true); SetTouchable(true); - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeaProcess::InitMeaProcess TempInitImage() false"); return false; } - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeaProcess::InitMeaProcess TempInitLabel() false"); return false; } - if (TempCirCleProcess() == false) { + if (!TempCirCleProcess()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeaProcess::InitMeaProcess TempCirCleProcess() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeasure.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeasure.cpp index 28e9e24e4..f06aeaff7 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeasure.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempMeasure.cpp @@ -166,15 +166,15 @@ bool TempMeasure::InitView(void *caller) SetTouchable(true); SetOnDragListener(listener); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeasure::InitView TempInitLabel() false"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeasure::InitView TempInitButton() false"); return false; } - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempMeasure::InitView TempInitImage() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp index 9826b504b..d65187a51 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp @@ -9,15 +9,11 @@ #include "TempMainView.h" #include "ChangeSliceListener.h" #include "graphic_service.h" +#include "ui_service.h" #include "string" #include "iostream" #include "sstream" -#include "errcode.h" -#include "pm_definition.h" -extern "C" errcode_t uapi_pm_add_sleep_veto(pm_id_t veto_id); -extern "C" errcode_t uapi_pm_remove_sleep_veto(pm_id_t veto_id); - namespace OHOS { static TempPresenter *g_tempPresenter = nullptr; @@ -47,13 +43,17 @@ void TempPresenter::OnStart() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempPresenter OnStart"); Presenter::OnStart(); + SendMsgToUIService(UI_ADD_SLEEP_VETO, 0, nullptr, 0); } void TempPresenter::OnPause(void) {} void TempPresenter::OnResume(void) {} -void TempPresenter::OnStop(void) {} +void TempPresenter::OnStop(void) +{ + SendMsgToUIService(UI_RM_SLEEP_VETO, 0, nullptr, 0); +} bool TempPresenter::OnDrag(UIView& view, const DragEvent& event) { @@ -72,12 +72,9 @@ void TempPresenter::ProgressNotify(void) if (TempMeaProcess::GetInstance() == nullptr) { return; } - if (TempMeaProcess::GetInstance()->GetCircleStatus() == true && + if (TempMeaProcess::GetInstance()->GetCircleStatus() && TempMeaProcess::GetInstance()->GetCircleProgress() != nullptr) { if (countTemp > 0) { - if (countTemp == SET_HUNDRED) { - uapi_pm_add_sleep_veto(PM_ID_SCREEN); - } GraphicService::GetInstance()->PostGraphicEvent(std::bind(&TempPresenter::UpdateTempCount, this)); } else { TempMeaProcess::GetInstance()->SetCircleStatus(false); @@ -85,7 +82,6 @@ void TempPresenter::ProgressNotify(void) TempMainView::GetInstance()->ChangeView(MEASURE_ING, MEASURE_INIT); } SetTempCountMax(); - uapi_pm_remove_sleep_veto(PM_ID_SCREEN); } } return; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPromptWear.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPromptWear.cpp index db3d2aec2..ab8ac12be 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPromptWear.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPromptWear.cpp @@ -119,15 +119,15 @@ bool TempPromptWear::InitPromptWear(void) SetDraggable(true); SetTouchable(true); - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempPromptWear::InitPromptWear TempInitLabel() fail"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempPromptWear::InitPromptWear TempInitButton() fail"); return false; } - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempPromptWear::InitPromptWear TempInitImage() fail"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempRemindWear.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempRemindWear.cpp index afa948ff5..20c1e8e94 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempRemindWear.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempRemindWear.cpp @@ -108,11 +108,11 @@ bool TempRemindWear::InitRemindWear(void) SetDraggable(true); SetTouchable(true); - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempRemindWear::InitRemindWear TempInitImage() false"); return false; } - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempRemindWear::InitRemindWear TempInitLabel() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempReport.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempReport.cpp index 09e313300..b4a0f6e86 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempReport.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempReport.cpp @@ -63,15 +63,14 @@ TempReport::TempReport() TempReport::~TempReport() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TempReport::~TempReport"); - int16 labelNum, imageNum; RemoveAll(); - for (labelNum = 0; labelNum < TEMP_SET_SIX; labelNum++) { + for (int16_t labelNum = 0; labelNum < TEMP_SET_SIX; labelNum++) { if (tempLabel[labelNum] != nullptr) { delete tempLabel[labelNum]; tempLabel[labelNum] = nullptr; } } - for (imageNum = 0; imageNum < SET_FIVE; imageNum++) { + for (int16_t imageNum = 0; imageNum < SET_FIVE; imageNum++) { if (tempImage[imageNum] != nullptr) { delete tempImage[imageNum]; tempImage[imageNum] = nullptr; @@ -159,23 +158,23 @@ bool TempReport::InitSimilarImage(int16 num, int16 tempX, int16 tempY, const cha bool TempReport::TempInitImage(void) { - if (InitSimilarImage(SET_ZERO, TEMP_IMAGE_ONE_X, TEMP_IMAGE_ONE_Y, TEMP_LITTLE_MEASURE) == false) { + if (!InitSimilarImage(SET_ZERO, TEMP_IMAGE_ONE_X, TEMP_IMAGE_ONE_Y, TEMP_LITTLE_MEASURE)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::TempReport InitSimilarImage false"); return false; } - if (InitSimilarImage(SET_ONE, TEMP_IMAGE_TWO_X, TEMP_IMAGE_TWO_Y, TEMP_LIT_TIP) == false) { + if (!InitSimilarImage(SET_ONE, TEMP_IMAGE_TWO_X, TEMP_IMAGE_TWO_Y, TEMP_LIT_TIP)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::TempReport InitSimilarImage false"); return false; } - if (InitSimilarImage(SET_TWO, TEMP_IMAGE_THREE_X, TEMP_IMAGE_THREE_Y, TEMP_POINT) == false) { + if (!InitSimilarImage(SET_TWO, TEMP_IMAGE_THREE_X, TEMP_IMAGE_THREE_Y, TEMP_POINT)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::TempReport InitSimilarImage false"); return false; } - if (InitSimilarImage(SET_THREE, TEMP_IMAGE_FOUR_X, TEMP_IMAGE_THREE_Y, TEMP_REV_POINTER) == false) { + if (!InitSimilarImage(SET_THREE, TEMP_IMAGE_FOUR_X, TEMP_IMAGE_THREE_Y, TEMP_REV_POINTER)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::TempReport InitSimilarImage false"); return false; } - if (InitSimilarImage(SET_FOUR, TEMP_FOUR_X, TEMP_IMAGE_FOUR_Y, TEMP_REPORT) == false) { + if (!InitSimilarImage(SET_FOUR, TEMP_FOUR_X, TEMP_IMAGE_FOUR_Y, TEMP_REPORT)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::TempReport InitSimilarImage false"); return false; } @@ -197,15 +196,15 @@ bool TempReport::InitView(void *caller) SetDraggable(true); SetTouchable(true); - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::InitView TempInitImage false"); return false; } - if (SetBasicLabel() == false) { + if (!SetBasicLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::InitView SetBasicLabel false"); return false; } - if (SetAppendLabel() == false) { + if (!SetAppendLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempReport::InitView SetAppendLabel false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp index 362ca5cc6..7153c761e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp @@ -70,16 +70,16 @@ typedef struct { } TempStudyItem; static const TempStudyItem tempStudyItem[] = { - {SET_ZERO, TEMP_LABEL_ONE_X, TEMP_LABEL_ONE_Y, TEMP_LABEL_ONE_WIDTH, TEMP_LABEL_ONE_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_ONE}, - {SET_ONE, TEMP_LABEL_TWO_X, TEMP_LABEL_TWO_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_TWO}, - {SET_TWO, TEMP_LABEL_TWO_X, TEMP_LABEL_THREE_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_THREE}, - {SET_THREE, TEMP_LABEL_TWO_X, TEMP_LABEL_FOUR_Y, TEMP_LABEL_TWO_WIDTH, LABEL_FOUR_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_FOUR}, - {SET_FOUR, TEMP_LABEL_TWO_X, TEMP_LABEL_FIVE_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, - (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_TIP_FONT, TEMP_STUDY_LABEL_FIVE}, + { SET_ZERO, TEMP_LABEL_ONE_X, TEMP_LABEL_ONE_Y, TEMP_LABEL_ONE_WIDTH, TEMP_LABEL_ONE_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_ONE }, + { SET_ONE, TEMP_LABEL_TWO_X, TEMP_LABEL_TWO_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_TWO }, + { SET_TWO, TEMP_LABEL_TWO_X, TEMP_LABEL_THREE_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_THREE }, + { SET_THREE, TEMP_LABEL_TWO_X, TEMP_LABEL_FOUR_Y, TEMP_LABEL_TWO_WIDTH, LABEL_FOUR_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_FONT, TEMP_STUDY_LABEL_FOUR }, + { SET_FOUR, TEMP_LABEL_TWO_X, TEMP_LABEL_FIVE_Y, TEMP_LABEL_TWO_WIDTH, TEMP_LABEL_TWO_HEIGHT, + (char *)DEFAULT_VECTOR_FONT_FILENAME, TEMP_LABEL_TIP_FONT, TEMP_STUDY_LABEL_FIVE }, }; bool TempStudyAbout::SetBasicLabel(void) @@ -129,11 +129,11 @@ bool TempStudyAbout::InitStudyAbout(void) SetDraggable(true); SetTouchable(true); - if (SetBasicLabel() == false) { + if (!SetBasicLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempStudyAbout::InitStudyAbout SetBasicLabel() false"); return false; } - if (SetAppendLabel() == false) { + if (!SetAppendLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempStudyAbout::InitStudyAbout SetAppendLabel() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempWarn.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempWarn.cpp index cbd1503c1..6ef18b542 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempWarn.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempWarn.cpp @@ -122,15 +122,15 @@ bool TempWarn::InitTempWarn(void) SetDraggable(true); SetTouchable(true); - if (TempInitImage() == false) { + if (!TempInitImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempWarn::InitTempWarn TempInitImage() false"); return false; } - if (TempInitButton() == false) { + if (!TempInitButton()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempWarn::InitTempWarn TempInitButton() false"); return false; } - if (TempInitLabel() == false) { + if (!TempInitLabel()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempWarn::InitTempWarn TempInitLabel() false"); return false; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h index 4a37a0661..45028caf6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h @@ -24,7 +24,6 @@ namespace OHOS { UISampleModel(const UISampleModel &); UISampleModel &operator=(const UISampleModel &); virtual ~UISampleModel(); - }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISamplePresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISamplePresenter.h index 2272d09f5..821544b28 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISamplePresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISamplePresenter.h @@ -19,18 +19,17 @@ class UISamplePresenter : public Presenter, public UIView::OnDragListener { public: UISamplePresenter(); - virtual ~UISamplePresenter(); + ~UISamplePresenter() override; - virtual void OnStart() override; - virtual void OnResume() override; - virtual void OnStop() override; + void OnStart() override; + void OnResume() override; + void OnStop() override; bool OnClick(UIView &view, const ClickEvent &event) override; - virtual bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnDrag(UIView& view, const DragEvent& event) override; private: UISampleModel *uisampleModel; - }; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h index e7e902c87..6009abbaa 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleView.h @@ -26,9 +26,9 @@ class UISamplePresenter; class UISampleOnDragListener : public UIView::OnDragListener { public: UISampleOnDragListener() {} - virtual ~UISampleOnDragListener() {} + ~UISampleOnDragListener() override {} - bool OnDrag(UIView& view, const DragEvent& event) + bool OnDrag(UIView& view, const DragEvent& event) override { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISampleOnDragListener::OnDrag"); UNUSED(view); @@ -44,7 +44,7 @@ public: class UISampleView : public View { public: UISampleView(); - virtual ~UISampleView(); + ~UISampleView(); static UISampleView *GetInstance() { @@ -52,10 +52,10 @@ public: return &instance; } - virtual void OnStart() override; - virtual void OnSetUpView() override; - virtual void OnTearDownView() override; - virtual void OnStop() override; + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; void InitView(); private: diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp index 221440102..7037c35fc 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/src/UISamplePresenter.cpp @@ -8,6 +8,7 @@ #include "UISampleView.h" #include "UISampleModel.h" #include "UISamplePresenter.h" +#include "ui_service.h" namespace OHOS { UISamplePresenter::UISamplePresenter() @@ -21,17 +22,16 @@ namespace OHOS { void UISamplePresenter::OnStart() { Presenter::OnStart(); + SendMsgToUIService(UI_ADD_SLEEP_VETO, 0, nullptr, 0); } void UISamplePresenter::OnResume(void) { - if (view_ == nullptr) { - return; - } } void UISamplePresenter::OnStop(void) { + SendMsgToUIService(UI_RM_SLEEP_VETO, 0, nullptr, 0); return; } @@ -39,7 +39,7 @@ namespace OHOS { { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISamplePresenter::OnDrag"); UNUSED(view); - UNUSED(event); + UNUSED(event); return false; } @@ -47,7 +47,7 @@ namespace OHOS { { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISamplePresenter::OnDrag"); UNUSED(view); - UNUSED(event); - return true; + UNUSED(event); + return true; } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp index db1ab83f3..a6307df44 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/uitest/framework/src/ui_test_group.cpp @@ -25,7 +25,10 @@ #include "ui_test_running_ball/ui_test_running_ball.h" #endif #include "ui_test_tiger/ui_test_tiger.h" +#include "ui_test_hexagons_list/ui_test_hexagons_list.h" #include "ui_test_video_play/ui_test_video_play.h" +#include "ui_test_coverflow/ui_test_coverflow.h" +#include "ui_test_kaleidoscope/ui_test_kaleidoscope.h" namespace OHOS { void UITestGroup::AddTestCase(TestCaseInfo testCaseInfo) @@ -44,11 +47,14 @@ void UITestGroup::SetUpTestCase() } testCaseList_->Clear(); testCaseList_->PushBack(TestCaseInfo{"老虎头", new UITestTiger()}); + testCaseList_->PushBack(TestCaseInfo{"蜂窝表盘", new UITestHexagonsList()}); testCaseList_->PushBack(TestCaseInfo{"滑动列表", new UITestListFPS()}); testCaseList_->PushBack(TestCaseInfo{"卡片切换", new UITestCardSwitch()}); testCaseList_->PushBack(TestCaseInfo{"立方体旋转", new UITestCubeRotate()}); testCaseList_->PushBack(TestCaseInfo{"消息", new UITestMessage()}); testCaseList_->PushBack(TestCaseInfo{"呼吸效果", new UITestBreath()}); + testCaseList_->PushBack(TestCaseInfo{"覆盖流", new UITestCoverflow()}); + testCaseList_->PushBack(TestCaseInfo{"万花筒", new UITestKaleidoscope()}); #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH testCaseList_->PushBack(TestCaseInfo{"倒计时", new UITestCountdown()}); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h b/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h index 5e442e726..823ad1844 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h @@ -47,6 +47,8 @@ typedef enum { SCREEN_TURN_ON_TO_UI, SCREEN_TURN_OFF_TO_UI, SCREEN_OFF_ENABLE_TO_UI, + UI_ADD_SLEEP_VETO, + UI_RM_SLEEP_VETO, } UiServiceMsgId; #define BUNDLE_NAME_LEN 128 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/nativeapp/nativeui/uiservice/src/ui_service.cpp index b12fcf3a1..ed8408eb5 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/uiservice/src/ui_service.cpp @@ -20,7 +20,7 @@ #include "UiServersMsg.h" #include "ohos_init.h" #include "memory_adapter.h" -#include +#include #include "service_id_define.h" #include "bundle_install_msg.h" #include "graphic_service.h" @@ -31,6 +31,11 @@ #include "ui_screennotify.h" #include "HealthModel.h" +#include "errcode.h" +#include "pm_definition.h" +extern "C" errcode_t uapi_pm_add_sleep_veto(pm_id_t veto_id); +extern "C" errcode_t uapi_pm_remove_sleep_veto(pm_id_t veto_id); + #ifdef __cplusplus extern "C" { #endif @@ -50,7 +55,7 @@ static UiService g_uiService = { DEFAULT_IUNKNOWN_ENTRY_BEGIN, .SendMsg = SendMsg, DEFAULT_IUNKNOWN_ENTRY_END, - .identity = { -1, -1, NULL }, + .identity = { -1, -1, nullptr }, }; const int DATA_DIST_STACK_SIZE = 0xC00; @@ -137,17 +142,16 @@ void ServiceMsgProcess(Request *request) case JS_UNINSTALL_SUCESS_TO_UI: WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "bms msg_id = %d bundleName = %s", request->msgId, ((BundleData *)request->data)->bundleName); - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::ApplistModel::ApplistUpdate, - &OHOS::ApplistModel::GetInstance())); - + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::ApplistModel::ApplistUpdate, &OHOS::ApplistModel::GetInstance())); break; case BT_CONNECTED_TO_UI: - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::SettingModel::UpdateBlueToothConnectStatus, - &OHOS::SettingModel::GetInstance(), true)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::SettingModel::UpdateBlueToothConnectStatus, &OHOS::SettingModel::GetInstance(), true)); break; case BT_DISCONNECTED_TO_UI: - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::SettingModel::UpdateBlueToothConnectStatus, - &OHOS::SettingModel::GetInstance(), false)); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::SettingModel::UpdateBlueToothConnectStatus, &OHOS::SettingModel::GetInstance(), false)); break; case SCREEN_TURN_ON_TO_UI: ScreenTurnOn(request); @@ -158,7 +162,12 @@ void ServiceMsgProcess(Request *request) case SCREEN_OFF_ENABLE_TO_UI: ScreenOffEnable(request); break; - + case UI_ADD_SLEEP_VETO: + uapi_pm_add_sleep_veto(PM_ID_SCREEN); + break; + case UI_RM_SLEEP_VETO: + uapi_pm_remove_sleep_veto(PM_ID_SCREEN); + break; } SAMGR_FreeRequestMsg(request); } @@ -184,17 +193,17 @@ TaskConfig GetServiceTaskConfig(Service *service) static int32_t SendMsg(int32_t msgId, uint32_t msgValue, void *data, int32_t dataLen) { Request *request = SAMGR_AllocRequestMsg(0, PLATFORM_CORE, UI_SVR_ID, dataLen); - if (request == NULL) { + if (request == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "SAMGR_AllocRequestMsg failed"); return FALSE; } request->msgId = msgId; request->msgValue = msgValue; - if (data != NULL) { + if (data != nullptr) { (void)memcpy_s(request->data, dataLen, data, dataLen); } - int32_t ret = SAMGR_SendRequest(IUNKNOWN_GetIdentity(GET_IUNKNOWN(g_uiService)), request, NULL); + int32_t ret = SAMGR_SendRequest(IUNKNOWN_GetIdentity(GET_IUNKNOWN(g_uiService)), request, nullptr); if (ret != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "SendMsg failed ret = %d ", ret); return FALSE; @@ -205,14 +214,14 @@ static int32_t SendMsg(int32_t msgId, uint32_t msgValue, void *data, int32_t dat void SendMsgToUIService(int32_t msgId, uint32_t msgValue, void *data, int32_t dataLen) { - UiServiceFeatureApi *comApi = NULL; + UiServiceFeatureApi *comApi = nullptr; IUnknown *iUnknown = SAMGR_GetInstance()->GetDefaultFeatureApi(UI_SERVICE); - if (iUnknown == NULL) { + if (iUnknown == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "GetDefaultFeatureApi failed"); return; } int result = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void **)&comApi); - if (result != 0 || comApi == NULL) { + if (result != 0 || comApi == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "QueryInterface comApi failed"); return; } diff --git a/code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c b/code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c index 5b14264fa..32e9496c7 100644 --- a/code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c +++ b/code/sdk/application/wearable/service/broadcast/src/broadcast_feature.c @@ -51,14 +51,14 @@ void BroadcastFeatureLog(IUnknown *broadcastApi) void InitBroadcastFeature(void) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "InitBroadcastFeature start!"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "InitBroadcastFeature start!"); BroadcastFeature *feature = &broadcastFeature; InitTopicSubscriberInfoImpl(&(feature->topicSubscriberInfo)); SAMGR_GetInstance()->RegisterFeature(BROADCAST_SERVICE_NAME, (Feature *)feature); SAMGR_GetInstance()->RegisterDefaultFeatureApi(BROADCAST_SERVICE_NAME, GET_IUNKNOWN(broadcastFeature)); SAMGR_GetInstance()->RegisterFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME, GET_IUNKNOWN(broadcastFeature)); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "InitBroadcastFeature end!"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "InitBroadcastFeature end!"); } static const char *GetFeatureName(Feature *feature) @@ -74,7 +74,7 @@ static void OnInitialize(Feature *feature, Service *parent, Identity identity) (void)identity; BroadcastFeature *f = (BroadcastFeature *)feature; Identity *id = &(f->id); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "BroadcastFeature featureId=%u, queueId=%u, serviceId=%u", + WEARABLE_LOGI(WEARABLE_LOG_MODULE_BROADCASE_SERVICE, "BroadcastFeature featureId=%u, queueId=%u, serviceId=%u", id->featureId, id->queueId, id->serviceId); } diff --git a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt index c2b8c3f93..75d45b2a5 100644 --- a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt @@ -24,11 +24,13 @@ set(PRIVATE_HEADER ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits ${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audio_player/interfaces/kits ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiomanager ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits/ + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent ${ROOT_DIR}/middleware/utils/fs/include/fs ${ROOT_DIR}/include/middleware/services/bts/br ${ROOT_DIR}/include/middleware/services/bts/common @@ -113,11 +115,13 @@ set(PRIVATE_HEADER ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits ${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audio_player/interfaces/kits ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiomanager ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits/ + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent ${ROOT_DIR}/middleware/utils/fs/include/fs ${ROOT_DIR}/include/middleware/services/bts/br ${ROOT_DIR}/include/middleware/services/bts/common @@ -143,7 +147,7 @@ set(SOURCES endif() if("SUPPORT_ALIPAY_SEC" IN_LIST DEFINES) -set(SOURCES +set(SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/vendor_app/alipay/alipay_app.cpp ) @@ -187,3 +191,11 @@ set(PRIVATE_DEFINES ) build_component() + + +set(COMPONENT_NAME "baidumapsdk") +set(LIBS ${CMAKE_CURRENT_SOURCE_DIR}/libs/lib${COMPONENT_NAME}.a) +set(WHOLE_LINK + true +) +build_component() \ No newline at end of file diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a index 056841fe4..0aa918900 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-native-js/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a index 9d10dc59e..cef97c6b8 100644 Binary files a/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a and b/code/sdk/application/wearable/service/msg_center/brandy-xts/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/include/msg_center.h b/code/sdk/application/wearable/service/msg_center/include/msg_center.h index 30f78d378..fb41aa590 100644 --- a/code/sdk/application/wearable/service/msg_center/include/msg_center.h +++ b/code/sdk/application/wearable/service/msg_center/include/msg_center.h @@ -47,13 +47,14 @@ typedef struct MsgCenter { Subscriber subscriber; } MsgCenter; -typedef void (*msg_center_notify_cb)(const Topic topic, Request* req); +typedef void (*MsgCenterNotifyCb)(const Topic topic, Request* req); typedef struct { Topic topic; - msg_center_notify_cb cb; -} msg_center_notify_table_t; + MsgCenterNotifyCb cb; +} MsgCenterNotifyTable; void DmsLiteSendMsgToJS(const char *msgBody); +void DuerMapInfo(uint8_t cmd_id, uint8_t type, void* data); void InitMsgCenter(OHOS::ACELite::JSIValue exports); struct PriorityMapper { diff --git a/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h b/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h index 4d8923b01..0b0b14d1e 100644 --- a/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h +++ b/code/sdk/application/wearable/service/msg_center/include/msg_center_protocol.h @@ -69,6 +69,54 @@ typedef enum msg_center_vector_navi_type_id { MSGCENTER_TYPE_ID_VECTOR_NAVI_RECV_POI, MSGCENTER_TYPE_ID_VECTOR_NAVI_FINISH_FROM_WATCH, MSGCENTER_TYPE_ID_VECTOR_NAVI_FINISH_FROM_PHONE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_AUTH_LICENSE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEO_LOCATION, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_INIT, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_START, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_SUCC, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_FAIL, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_START, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_DESTROY, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_TEXT_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_ICON_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_TIME_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_DISTANCE_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_ROUTE_UPDATE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GPS_STATUS_CHANGE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_FARAWAY, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_YAWING, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_RE_ROUTE_COMPLETE, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ARRIVE_DSTINATION, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_POI_SUG_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_RIDING_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_WALKING_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_TRANSIT_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEOCODE_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH, + MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REGEOCODE_SEARCH, } msg_center_vector_navi_type_id_t; typedef enum msg_center_alipay_type_id { @@ -184,6 +232,62 @@ static inline uint8_t msg_center_get_tlv_tl_len(void *usr_data) return offset; } +static const char *g_vector_navi_str_tb[] = { + "req_auth_license", + "rec_auth_license", + "req_geo_location", + "rec_geo_location", + "req_navi_init", + "rec_navi_init", + "req_route_plan_start", + "rec_route_plan_start", + "req_route_plan_succ", + "rec_route_plan_succ", + "req_route_plan_fail", + "rec_route_plan_fail", + "req_navi_start", + "rec_navi_start", + "req_navi_destroy", + "rec_navi_destroy", + "req_road_guide_text_update", + "rec_road_guide_text_update", + "req_road_guide_icon_update", + "rec_road_guide_icon_update", + "req_remain_time_update", + "rec_remain_time_update", + "req_remain_distance_update", + "rec_remain_distance_update", + "req_remain_route_update", + "rec_remain_route_update", + "req_gps_status_change", + "rec_gps_status_change", + "req_route_faraway", + "rec_route_faraway", + "req_route_plan_yawing", + "rec_route_plan_yawing", + "req_re_route_complete", + "rec_re_route_complete", + "req_arrive_destination", + "rec_arrive_destination", + "req_poi_sug_search", + "rec_poi_sug_search", + "req_route_riding_search", + "rec_route_riding_search", + "req_route_walking_search", + "rec_route_walking_search", + "req_route_transit_search", + "rec_route_transit_search", + "req_geocode_search", + "rec_geocode_search", + "req_regeocode_search", + "rec_regeocode_search", +}; + +static inline const char* vector_navi_get_str(uint8_t type) +{ + return g_vector_navi_str_tb[type - MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE]; +} + errcode_t msg_center_pkt_proc(diag_ser_data_t *data); uint8_t msg_center_get_response_cmd(uint8_t cmd_id); diag_ser_data_t *msg_center_encap_diag_info(diag_ser_header_t *header, uint16_t tlv_len, uint8_t cmd_id); diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h index 8f4005ba2..4393f7845 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/alarm_notification.h @@ -8,18 +8,18 @@ #ifndef ALARM_NOTIFICATION_H #define ALARM_NOTIFICATION_H -#define ALARM_IMAGE_DELETE "alarm_delete" -#define ALARM_IMAGE_CLOCK "alarm_clock" -#define ALARM_VIEW_CLOSE "alarm_close" -#define ALARM_VIEW_DELAY "alarm_delay" -#define ALARM_VIEW_POPUP "alarm_popup" +constexpr char* ALARM_IMAGE_DELETE = "alarm_delete"; +constexpr char* ALARM_IMAGE_CLOCK = "alarm_clock"; +constexpr char* ALARM_VIEW_CLOSE = "alarm_close"; +constexpr char* ALARM_VIEW_DELAY = "alarm_delay"; +constexpr char* ALARM_VIEW_POPUP = "alarm_popup"; -typedef enum { +enum class AlarmTimerType { NOTIFY_ALARM_CLOSE = 0, NOTIFY_ALARM_DELAY = 1, NOTIFY_ALARM_RING = 2, NOTIFY_ALARM_UNKNOWN = 10, -}AlarmTimerType; +}; namespace OHOS { UIViewGroup* CreateAlarmView(void); @@ -37,25 +37,25 @@ class AlarmViewEventListener : public OHOS::UIView::OnClickListener, public OHOS::UIView::OnDragListener { public: AlarmViewEventListener(); - virtual ~AlarmViewEventListener(); - static AlarmViewEventListener *GetInstance(void); + virtual ~AlarmViewEventListener(); + static AlarmViewEventListener *GetInstance(void); bool OnDrag(UIView& view, const DragEvent& event) override; bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override; bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override; - virtual bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override + bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override { return true; } - virtual bool OnLongPress(OHOS::UIView& view, const OHOS::LongPressEvent& event) override + bool OnLongPress(OHOS::UIView& view, const OHOS::LongPressEvent& event) override { return true; } - virtual bool OnRelease(OHOS::UIView& view, const OHOS::ReleaseEvent& event) override + bool OnRelease(OHOS::UIView& view, const OHOS::ReleaseEvent& event) override { return true; } - virtual bool OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event) override + bool OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event) override { return true; } diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h index 98d57971f..59671baec 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h @@ -8,23 +8,29 @@ #ifndef MAKEPHONE_NOTIFICATION_H #define MAKEPHONE_NOTIFICATION_H -typedef enum { +enum class CallTimerType { NOTIFY_PHONE_CALLING_DISPLAY = 0, NOTIFY_PHONE_CURTIME_DISPLAY = 1, NOTIFY_PHONE_UNKNOWN = 10, -}CallTimerType; +}; namespace OHOS { UIViewGroup* CreatePhoneCallView(void); UIViewGroup* CreateCallingView(void); +UIViewGroup* CreateMultiplePhoneView(void); +UIViewGroup* CreateWaitingHintsView(void); void HonrsViewChange(void); void FreeCallingView(void); void FreePhoneCallView(void); +void FreeMultiplePhoneCallView(void); +void FreeWaitingHintsView(void); void RefreshMicrophoneImageSrc(const char* src); void CallTimerCallBackProc(int data); void CallCurTimerCallBack(int data); void StartCallTimer(CallTimerType type, int32_t interval); void DisableCallTimer(CallTimerType type); +void EnableWaitingView(void); +void DisableWatingView(void); class CallViewEventListener : public OHOS::UIView::OnClickListener, public OHOS::UIView::OnLongPressListener, @@ -32,31 +38,31 @@ class CallViewEventListener : public OHOS::UIView::OnClickListener, public OHOS::UIView::OnDragListener { public: CallViewEventListener(); - virtual ~CallViewEventListener(); - static CallViewEventListener *GetInstance(void); + ~CallViewEventListener() override; + static CallViewEventListener *GetInstance(void); bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override; - virtual bool OnDrag(UIView& view, const DragEvent& event) override + bool OnDrag(UIView& view, const DragEvent& event) override { return true; } - virtual bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override + bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override { return true; } - virtual bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override + bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override { return true; } - virtual bool OnLongPress(OHOS::UIView& view, const OHOS::LongPressEvent& event) override + bool OnLongPress(OHOS::UIView& view, const OHOS::LongPressEvent& event) override { return true; } - virtual bool OnRelease(OHOS::UIView& view, const OHOS::ReleaseEvent& event) override + bool OnRelease(OHOS::UIView& view, const OHOS::ReleaseEvent& event) override { return true; } - virtual bool OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event) override + bool OnDragStart(OHOS::UIView& view, const OHOS::DragEvent& event) override { return true; } diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h b/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h index f81e0b878..f71205649 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/notification_manager.h @@ -24,9 +24,8 @@ #include "alarm_notification.h" #include "makephone_notification.h" -#define UN_OPACITY 255 -#define HAlf_SCREEN 2 -#define NOTIFY_PRIORITY_DEFAULT 4 +constexpr uint16_t HALF_SCREEN = 2; +constexpr int16_t NOTIFY_PRIORITY_DEFAULT = 4; namespace OHOS { using NewNotify = std::function; @@ -62,7 +61,7 @@ public: /** * @brief notify is or not showing. */ - bool hasNotifyShowing(); + bool HasNotifyShowing(); void StartShowNotify(void); uint16_t GetNotifyPriority(void); uint16_t GetShowingNotifyId(void); @@ -70,17 +69,19 @@ public: void SetNativeUIRunning(bool flag); bool GetVolumeScreenStatus(); void SetVolumeScreenStatus(bool status); + bool GetWatchCallStatus(); + void SetWatchCallStatus(bool status); void Callback() override; UIViewGroup* screenContainer_ = nullptr; private: NotificationManager() {} - ~NotificationManager() {} + ~NotificationManager() override {} void StartRefreshNotifyContent(void); void StopShowNotify(void); - void FreeNotifyViews(void); + void FreeNotifyViews(void); NewNotify notify_; RefreshNotifyContent refreshNotifyContent_; @@ -89,6 +90,7 @@ private: bool isFullScreen_ = false; bool isNativeUI = false; bool volumeScreenStatus = false; + bool watchCallStatus = false; bool stopIsLast_ = false; bool showIsLast_ = false; diff --git a/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidu_app.h b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidu_app.h index 2d2815456..71d268ab7 100644 --- a/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidu_app.h +++ b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidu_app.h @@ -9,7 +9,7 @@ #define BAIDU_APP_H #include "errcode.h" - +#include "cmsis_os2.h" #ifdef __cplusplus #if __cplusplus extern "C" { @@ -26,6 +26,7 @@ typedef struct { uint16_t len; } pcm_stream_queue_msg; +osMessageQueueId_t GetPcmMsgQueueId(void); errcode_t pcm_stream_msg_thread(void *data); errcode_t pcm_stream_queue_init(void); errcode_t pcm_stream_create_task(void); @@ -53,6 +54,68 @@ errcode_t msg_center_vector_navi_req_poi(uint8_t cmd_id, uint8_t type, void *usr errcode_t msg_center_vector_navi_recv_poi(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); errcode_t msg_center_vector_navi_finish_from_watch(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); errcode_t msg_center_vector_navi_finish_from_phone(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_auth_license(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_auth_license(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_geo_location(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_geo_location(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_navi_init(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_navi_init(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_plan_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_plan_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_plan_succ(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_plan_succ(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_plan_fail(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_plan_fail(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_navi_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_navi_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_navi_destroy(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_navi_destroy(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_road_guide_text_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_road_guide_text_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_road_guide_icon_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_road_guide_icon_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_remain_time_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_remain_time_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_remain_distance_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_remain_distance_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_remain_route_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_remain_route_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_gps_status_change(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_gps_status_change(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_faraway(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_faraway(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_plan_yawing(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_plan_yawing(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_re_route_complete(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_re_route_complete(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_arrive_destination(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_arrive_destination(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vertor_navi_req_poi_sug_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vertor_navi_rec_poi_sug_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_riding_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_riding_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_walking_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_walking_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_route_transit_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_route_transit_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len); +errcode_t msg_center_vector_navi_req_geocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_geocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_req_regeocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); +errcode_t msg_center_vector_navi_rec_regeocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_component.h b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_component.h new file mode 100644 index 000000000..8d9e4b878 --- /dev/null +++ b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_component.h @@ -0,0 +1,60 @@ +#ifndef BAIDU_MAP_COMPONENT_INTERFACE_H +#define BAIDU_MAP_COMPONENT_INTERFACE_H + +#include "baidumap_msg_center.h" +#include "components/ui_view.h" + +class MapComponentApi +{ +public: + + static MapComponentApi &getInstance(); + MapComponentApi(const MapComponentApi &) = delete; + MapComponentApi &operator=(const MapComponentApi &) = delete; + + const OHOS::UIView* get_baidumap_root_view(); + virtual void destroy(); + virtual void set_zoom_event_enabled(bool enabled); + virtual void zoom_in(); + virtual void zoom_out(); + virtual void zoom_by(int amount); + virtual void zoom_to(int level); + virtual void set_map_background_color(char * json_color); + virtual void set_map_overlayer_enabled(bool enabled); + virtual void set_map_tiles_enabled(bool enabled); + virtual void set_scroll_gestures_enabled(bool enabled); + virtual void scroll_by(int pixel_x, int pixel_y); + // 导航过程、定位成功 + virtual void new_lat_lng(char * json_lat_lng); + virtual void new_lat_lng_zoom(char * json_lat_lng, int zoom); + // 导航结束 + virtual void clear_map_overlayer(); + // 画点 + virtual void draw_circle(char * json_circle); + // 无 + virtual void draw_polygon(char * json_polygon); + // 导航路线 + virtual void draw_path(char * json_path); + // 无 + virtual void draw_text(char * json_text); + // 定位成功定位点 + virtual void draw_marker(char * json_marker); + // 导航过程箭头 + virtual void draw_navi_marker(char * json_navi_marker); + // 定位点 + virtual void overlayer_clear_circle(); + // 定位点 + virtual void overlayer_clear_marker(); + // 导航箭头 + virtual void overlayer_clear_navi_marker(); + // 以下调用使用,不用提供js通路 + void RecvMapSvgInfo(Content *info); +private: + // MapRootView* container_ = nullptr; + /** + * @brief 构造函数 + */ + MapComponentApi(); +}; + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_location.h b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_location.h new file mode 100644 index 000000000..324a80817 --- /dev/null +++ b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_js_location.h @@ -0,0 +1,56 @@ +#ifndef BAIDU_MAP_LOCATION_H +#define BAIDU_MAP_LOCATION_H + +struct JSCoordinate { + double lon; + double lat; +}; + +/** + * @brief 将 WGS84 坐标转换为 GCJ02 坐标 + * + * 将给定的 WGS84 坐标转换为 GCJ02 坐标,并返回转换后的 GCJ02 坐标。 + * + * @param lon WGS84 经度坐标 + * @param lat WGS84 纬度坐标 + * + * @return GCJ02 坐标点 + */ +extern void WGS84ToGCJ02(double lon, double lat, JSCoordinate &output); + + /** + * @brief 将 GCJ02 坐标转换为 BD09 坐标 + * + * 将给定的 GCJ02 坐标转换为 BD09 坐标,并返回转换后的 BD09 坐标。 + * + * @param lon GCJ02 坐标的经度 + * @param lat GCJ02 坐标的纬度 + * + * @return 转换后的 BD09 坐标 + */ +extern void GCJ02ToBD09(double lon, double lat, JSCoordinate &output); + +/** + * @brief 将WGS84坐标转换为BD09坐标 + * + * 将给定的 WGS84 坐标转换为 BD09 坐标,并返回转换后的 BD09 坐标。 + * + * @param lon WGS84经度坐标 + * @param lat WGS84纬度坐标 + * + * @return 转换后的BD09坐标点 + */ +extern void WGS84ToBD09(double lon, double lat, JSCoordinate &output); + +/** + * @brief 将 BD09 坐标转换为 GCJ02 坐标 + * + * 将给定的 BD09 坐标转换为 GCJ02 坐标,并返回转换后的 GCJ02 坐标。 + * + * @param bd_lon BD09 经度 + * @param bd_lat BD09 纬度 + * + * @return 转换后的 GCJ02 坐标 + */ +extern void BD09ToGCJ02(double bd_lon, double bd_lat, JSCoordinate &output); +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_msg_center.h b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_msg_center.h new file mode 100644 index 000000000..e20f08a55 --- /dev/null +++ b/code/sdk/application/wearable/service/msg_center/include/vendor_app/baidumap_msg_center.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. + * Description: broadcast service api + * Author: CompanyName + * Create: 2021-11-11 + */ + +#ifndef BAIDU_MAP_MSG_CENTER_H +#define BAIDU_MAP_MSG_CENTER_H + +#include + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif + +/** + * 请求接口的 type_id,目前只有svg的请求 + */ +typedef enum duer_msg_center_type_id { + DUER_MSG_TYPE_ID_REQ_SVG = 1, + DUER_MSG_TYPE_ID_MAX +} duer_msg_center_type_id_t; + +struct Content +{ + int x; + int y; + int z; + void *data; + char *json; +}; + + +/** + * 接收msg_center返回的数据,填充对应的content + */ +uint8_t duer_msg_center_recv_map_info(uint8_t command_id, uint8_t type, struct Content *content); + +/** + * 通过【duer_msg_center_type_id】来区分对应请求的是msg_center接口,方便以后扩展 + */ +uint8_t duer_msg_center_send_map_info(uint8_t duer_type, void *usr_data, uint16_t usr_len); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif +#endif /* BAIDU_MAP_MSG_CENTER_H */ diff --git a/code/sdk/application/wearable/service/msg_center/libs/libbaidumapsdk.a b/code/sdk/application/wearable/service/msg_center/libs/libbaidumapsdk.a new file mode 100644 index 000000000..3fdb0f0db Binary files /dev/null and b/code/sdk/application/wearable/service/msg_center/libs/libbaidumapsdk.a differ diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp index 6300431df..97f83291f 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_cmd.cpp @@ -40,6 +40,54 @@ msg_center_cmd_map_t g_msg_center_type_tbl[] = { { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_RECV_POI, msg_center_vector_navi_recv_poi}, { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_FINISH_FROM_WATCH, msg_center_vector_navi_finish_from_watch}, { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_FINISH_FROM_PHONE, msg_center_vector_navi_finish_from_phone}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE, msg_center_vector_navi_req_auth_license}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_AUTH_LICENSE, msg_center_vector_navi_rec_auth_license}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION, msg_center_vector_navi_req_geo_location}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEO_LOCATION, msg_center_vector_navi_rec_geo_location}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT, msg_center_vector_navi_req_navi_init}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_INIT, msg_center_vector_navi_rec_navi_init}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START, msg_center_vector_navi_req_route_plan_start}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_START, msg_center_vector_navi_rec_route_plan_start}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC, msg_center_vector_navi_req_route_plan_succ}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_SUCC, msg_center_vector_navi_rec_route_plan_succ}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL, msg_center_vector_navi_req_route_plan_fail}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_FAIL, msg_center_vector_navi_rec_route_plan_fail}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START, msg_center_vector_navi_req_navi_start}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_START, msg_center_vector_navi_rec_navi_start}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY, msg_center_vector_navi_req_navi_destroy}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_DESTROY, msg_center_vector_navi_rec_navi_destroy}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE, msg_center_vector_navi_req_road_guide_text_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_TEXT_UPDATE, msg_center_vector_navi_rec_road_guide_text_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE, msg_center_vector_navi_req_road_guide_icon_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_ICON_UPDATE, msg_center_vector_navi_rec_road_guide_icon_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE, msg_center_vector_navi_req_remain_time_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_TIME_UPDATE, msg_center_vector_navi_rec_remain_time_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE, msg_center_vector_navi_req_remain_distance_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_DISTANCE_UPDATE, msg_center_vector_navi_rec_remain_distance_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE, msg_center_vector_navi_req_remain_route_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_ROUTE_UPDATE, msg_center_vector_navi_rec_remain_route_update}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE, msg_center_vector_navi_req_gps_status_change}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GPS_STATUS_CHANGE, msg_center_vector_navi_rec_gps_status_change}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY, msg_center_vector_navi_req_route_faraway}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_FARAWAY, msg_center_vector_navi_rec_route_faraway}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING, msg_center_vector_navi_req_route_plan_yawing}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_YAWING, msg_center_vector_navi_rec_route_plan_yawing}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE, msg_center_vector_navi_req_re_route_complete}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_RE_ROUTE_COMPLETE, msg_center_vector_navi_rec_re_route_complete}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION, msg_center_vector_navi_req_arrive_destination}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ARRIVE_DSTINATION, msg_center_vector_navi_rec_arrive_destination}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH, msg_center_vertor_navi_req_poi_sug_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_POI_SUG_SEARCH, msg_center_vertor_navi_rec_poi_sug_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_RIDING_SEARCH, msg_center_vector_navi_req_route_riding_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_RIDING_SEARCH, msg_center_vector_navi_rec_route_riding_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_WALKING_SEARCH, msg_center_vector_navi_req_route_walking_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_WALKING_SEARCH, msg_center_vector_navi_rec_route_walking_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_TRANSIT_SEARCH, msg_center_vector_navi_req_route_transit_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_TRANSIT_SEARCH, msg_center_vector_navi_rec_route_transit_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH, msg_center_vector_navi_req_geocode_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEOCODE_SEARCH, msg_center_vector_navi_rec_geocode_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH, msg_center_vector_navi_req_regeocode_search}, + { MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REGEOCODE_SEARCH, msg_center_vector_navi_rec_regeocode_search}, #endif #ifdef SUPPORT_ALIPAY_SEC { MSGCENTER_CMD_ALIPAY, MSGCENTER_TYPE_ID_ALIPAY_NETWORK_STATUS, msg_center_alipay_network_status}, diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index cb69f9f52..7dea05609 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -5,7 +5,7 @@ * Create: 2021-11-11 */ -#include +#include #include "securec.h" #include "adapter.h" #include "ohos_init.h" @@ -32,7 +32,7 @@ extern "C" { #endif /* 订阅事件设定优先级 */ -const PriorityMapper g_pri_mapper[] = { +const PriorityMapper PRI_MAPPER[] = { {TOPIC_EVENT_ALARM_RING, PRIORITY_TWO}, {TOPIC_EVENT_NEXTDAY_UPDATE, PRIORITY_TWO}, {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE}, @@ -45,11 +45,11 @@ const PriorityMapper g_pri_mapper[] = { static bool CheckPriority(const Topic topic) { - uint16_t mapperSize = sizeof(g_pri_mapper) / sizeof(g_pri_mapper[0]); + uint16_t mapperSize = sizeof(PRI_MAPPER) / sizeof(PRI_MAPPER[0]); for (uint16_t i = 0; i < mapperSize; i++) { - if (topic == g_pri_mapper[i].topicId) { - if (g_pri_mapper[i].prId <= OHOS::NativeAbility::GetInstance().GetCurSlicePriority() && - g_pri_mapper[i].prId <= OHOS::NotificationManager::GetInstance()->GetNotifyPriority()) { + if (topic == PRI_MAPPER[i].topicId) { + if (PRI_MAPPER[i].prId <= OHOS::NativeAbility::GetInstance().GetCurSlicePriority() && + PRI_MAPPER[i].prId <= OHOS::NotificationManager::GetInstance()->GetNotifyPriority()) { return true; } else { return false; @@ -72,29 +72,34 @@ void MsgCenterSubscribe() MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_TO_PHONE); } -static OHOS::UIViewGroup* showAlarmNotify(void) +static OHOS::UIViewGroup* ShowAlarmNotify(void) { return OHOS::CreateAlarmView(); } -static OHOS::UIViewGroup* showPhoneCallNotify(void) +static OHOS::UIViewGroup* ShowPhoneCallNotify(void) { return OHOS::CreatePhoneCallView(); } -static OHOS::UIViewGroup* showCallingNotify(void) +static OHOS::UIViewGroup* ShowCallingNotify(void) { return OHOS::CreateCallingView(); } +static OHOS::UIViewGroup* ShowMultiPhoneCallNotify(void) +{ + return OHOS::CreateMultiplePhoneView(); +} + void MsgCenterNotifyAlarmProc(const Topic topic, Request* req) { unused(req); // The alarm notification is not displayed if the incoming call notification is already being processed - if (CheckPriority(topic) == true) { + if (CheckPriority(topic)) { AlarmClockModel::GetInstance()->PopInterPlayMusic(); NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showAlarmNotify, (uint16_t)topic, true); + NotificationManager::GetInstance()->ShowNotify(ShowAlarmNotify, static_cast(topic), true); } else { // just delay the alarm WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "just delay the alarm"); @@ -112,45 +117,58 @@ void MsgCenterNotifyNextDayProc(const Topic topic, Request* req) void MsgCenterNotifyHfpIncomingProc(const Topic topic, Request* req) { - unused(topic); - hfp_hf_calls_info_t call_data = {0}; - int32 ret = memcpy_s(&call_data, sizeof(hfp_hf_calls_info_t), req->data, req->len); + hfp_hf_calls_info_t callData = {0}; + int32 ret = memcpy_s(&callData, sizeof(hfp_hf_calls_info_t), req->data, req->len); if (ret != EOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotify memcpy_s request data fail!"); } else { // Prevent this from happening: // When the incoming call view is displayed, the calling number is not set in CallerLogModel. - CallerLogModel::GetInstance()->SetoperateNumber(call_data.number, call_data.number_len); + CallerLogModel::GetInstance()->SetoperateNumber(callData.number, callData.number_len); } NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); CallerLogModel::GetInstance()->SetNotifyFlag(true); - NotificationManager::GetInstance()->ShowNotify(showPhoneCallNotify, (uint16_t)topic, true); + if (GetCurrCallNum() == 1) { + NotificationManager::GetInstance()->ShowNotify(ShowPhoneCallNotify, static_cast(topic), true); + } else { + EnableWaitingView(); + } + NotificationManager::GetInstance()->SetWatchCallStatus(true); } void MsgCenterNotifyHfpPhoneProc(const Topic topic, Request* req) { - unused(topic); unused(req); - // just stop the notify - if (CallerLogModel::GetInstance()->GetNotifyFlag() == true) { - NotificationManager::GetInstance()->StopNotify(); + // finish a single-channel call, or switch to phone, stop the notify + if (CallerLogModel::GetInstance()->GetNotifyFlag()) { + DisableWatingView(); + if ((topic == TOPIC_EVENT_HFP_FINISHED && GetCurrCallNum() == 0) || + topic == TOPIC_EVENT_HFP_PHONE_ACTIVE || topic == TOPIC_EVENT_HFP_WATCH_TO_PHONE) { + NotificationManager::GetInstance()->StopNotify(); + NotificationManager::GetInstance()->SetWatchCallStatus(false); + } } } void MsgCenterNotifyHfpWatchProc(const Topic topic, Request* req) { - unused(topic); unused(req); - if (CallerLogModel::GetInstance()->GetNotifyFlag() == true) { + if (CallerLogModel::GetInstance()->GetNotifyFlag()) { NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); // default not mute SetMicMute(false); - NotificationManager::GetInstance()->ShowNotify(showCallingNotify, (uint16_t)topic, true); + if (CallerLogModel::GetInstance()->IsMulitplePhoneStatus()) { + NotificationManager::GetInstance()->ShowNotify(ShowMultiPhoneCallNotify, + static_cast(topic), true); + } else { + NotificationManager::GetInstance()->ShowNotify(ShowCallingNotify, static_cast(topic), true); + } + NotificationManager::GetInstance()->SetWatchCallStatus(true); } } /* 订阅事件通知逻辑可定制 */ -static msg_center_notify_table_t g_msg_center_notify_table[] = { +static MsgCenterNotifyTable g_msgCenterNotifyTable[] = { {TOPIC_EVENT_ALARM_RING, MsgCenterNotifyAlarmProc}, {TOPIC_EVENT_NEXTDAY_UPDATE, MsgCenterNotifyNextDayProc}, {TOPIC_EVENT_HFP_INCOMMING, MsgCenterNotifyHfpIncomingProc}, @@ -161,24 +179,24 @@ static msg_center_notify_table_t g_msg_center_notify_table[] = { {TOPIC_EVENT_HFP_PHONE_TO_WATCH, MsgCenterNotifyHfpWatchProc}, }; -static msg_center_notify_table_t *MsgCenterGetNotifyTblCb(uint8_t idx) +static MsgCenterNotifyTable *MsgCenterGetNotifyTblCb(uint8_t idx) { - return &g_msg_center_notify_table[idx]; + return &g_msgCenterNotifyTable[idx]; } static uint8_t MsgCenterGetNotifyTblSize(void) { - return sizeof(g_msg_center_notify_table) / sizeof(g_msg_center_notify_table[0]); + return sizeof(g_msgCenterNotifyTable) / sizeof(g_msgCenterNotifyTable[0]); } bool MsgCenterNotifyProc(const Topic topic, Request* req) { uint8_t i; - uint8_t tbl_size = MsgCenterGetNotifyTblSize(); + uint8_t tblSize = MsgCenterGetNotifyTblSize(); - for (i = 0; i < tbl_size; i++) { - msg_center_notify_table_t *item = MsgCenterGetNotifyTblCb(i); - if (item->topic == topic && item->cb != NULL) { + for (i = 0; i < tblSize; i++) { + MsgCenterNotifyTable *item = MsgCenterGetNotifyTblCb(i); + if (item->topic == topic && item->cb != nullptr) { item->cb(topic, req); return true; } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp index 37ab4317d..417c99a5d 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/alarm_notification.cpp @@ -12,28 +12,27 @@ #include "components/ui_image_view.h" #include "components/ui_label.h" -#define RING_AGAIN "响铃将在十分钟后再次响起" -#define NOTIFY_THREE_SECONDS 3000 -#define NOTIFY_ONE_SECOND 1000 -#define NOTIFY_THIRTY_SECONDS 30000 -#define NOTIFY_ONE_MINUTE 60000 -#define NOTOFY_NO_OPERATE_TIME 35000 - namespace OHOS { -osTimerId_t g_notifyStopHandle = NULL; // timer of close view and alarm ring view -osTimerId_t g_alarmRing = NULL; // timer of alarm view - -UIViewGroup* alarmView = nullptr; -UIViewGroup* closeView = nullptr; -UIViewGroup* ringView = nullptr; -UIImageView* imageClose = nullptr; -UIImageView* imageRing = nullptr; -UIImageView* imageDelete = nullptr; -UIImageView* imageClock = nullptr; -UILabel* closeLable = nullptr; -UILabel* ringLable = nullptr; -UILabel* mainLable = nullptr; -UIDigitalClock *dClock = nullptr; +constexpr char* RING_AGAIN = "响铃将在十分钟后再次响起"; +constexpr int32_t NOTIFY_THREE_SECONDS = 3000; +constexpr int32_t NOTIFY_ONE_SECOND = 1000; +constexpr int32_t NOTIFY_THIRTY_SECONDS = 30000; +constexpr int32_t NOTIFY_ONE_MINUTE = 60000; +constexpr int32_t NOTOFY_NO_OPERATE_TIME = 35000; +osTimerId_t g_notifyStopHandle = nullptr; // timer of close view and alarm ring view +osTimerId_t g_alarmRing = nullptr; // timer of alarm view + +UIViewGroup* g_alarmView = nullptr; +UIViewGroup* g_closeView = nullptr; +UIViewGroup* g_ringView = nullptr; +UIImageView* g_imageClose = nullptr; +UIImageView* g_imageRing = nullptr; +UIImageView* g_imageDelete = nullptr; +UIImageView* g_imageClock = nullptr; +UILabel* g_closeLable = nullptr; +UILabel* g_ringLable = nullptr; +UILabel* g_mainLable = nullptr; +UIDigitalClock* g_dClock = nullptr; // alarm close view constexpr int16_t MAX_SET_ZERO_LEN = 0; @@ -89,33 +88,33 @@ void StartAlarmTimer(AlarmTimerType type, int32_t interval) { uint32_t tick; osStatus_t retTimer; - if (type >= NOTIFY_ALARM_UNKNOWN) { + if (type >= AlarmTimerType::NOTIFY_ALARM_UNKNOWN) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartAlarmTimer type:%d invalid!!", type); return; } switch (type) { - case NOTIFY_ALARM_CLOSE: - case NOTIFY_ALARM_DELAY: - g_notifyStopHandle = osTimerNew((osTimerFunc_t)StopNotifyCallback, osTimerPeriodic, NULL, NULL); + case AlarmTimerType::NOTIFY_ALARM_CLOSE: + case AlarmTimerType::NOTIFY_ALARM_DELAY: + g_notifyStopHandle = osTimerNew((osTimerFunc_t)StopNotifyCallback, osTimerPeriodic, nullptr, nullptr); tick = osMs2Tick(interval); retTimer = osTimerStart(g_notifyStopHandle, tick); - if (retTimer != osOK && g_notifyStopHandle != NULL) { + if (retTimer != osOK && g_notifyStopHandle != nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartAlarmTimer osTimerStart failed, type= %d ret = %lx!!", type, retTimer); osTimerDelete(g_notifyStopHandle); - g_notifyStopHandle = NULL; + g_notifyStopHandle = nullptr; return; } break; - case NOTIFY_ALARM_RING: - g_alarmRing = osTimerNew((osTimerFunc_t)NoOperateCallback, osTimerPeriodic, NULL, NULL); + case AlarmTimerType::NOTIFY_ALARM_RING: + g_alarmRing = osTimerNew((osTimerFunc_t)NoOperateCallback, osTimerPeriodic, nullptr, nullptr); tick = osMs2Tick(interval); retTimer = osTimerStart(g_alarmRing, tick); - if (retTimer != osOK && g_alarmRing != NULL) { + if (retTimer != osOK && g_alarmRing != nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartAlarmTimer osTimerStart failed, type= %d ret = %lx!!", type, retTimer); osTimerDelete(g_alarmRing); - g_alarmRing = NULL; + g_alarmRing = nullptr; return; } break; @@ -126,31 +125,31 @@ void StartAlarmTimer(AlarmTimerType type, int32_t interval) void DisableAlarmTimer(AlarmTimerType type) { - if (type >= NOTIFY_ALARM_UNKNOWN) { + if (type >= AlarmTimerType::NOTIFY_ALARM_UNKNOWN) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableAlarmTimer type:%d invalid!!", type); return; } osStatus_t ret; switch (type) { - case NOTIFY_ALARM_CLOSE: - case NOTIFY_ALARM_DELAY: - if (g_notifyStopHandle != NULL) { + case AlarmTimerType::NOTIFY_ALARM_CLOSE: + case AlarmTimerType::NOTIFY_ALARM_DELAY: + if (g_notifyStopHandle != nullptr) { ret = osTimerDelete(g_notifyStopHandle); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableAlarmTimer failed, type= %d ret = %lx!", type, ret); return; } - g_notifyStopHandle = NULL; + g_notifyStopHandle = nullptr; } break; - case NOTIFY_ALARM_RING: - if (g_alarmRing != NULL) { + case AlarmTimerType::NOTIFY_ALARM_RING: + if (g_alarmRing != nullptr) { ret = osTimerDelete(g_alarmRing); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableAlarmTimer failed, type= %d ret = %lx!", type, ret); return; } - g_alarmRing = NULL; + g_alarmRing = nullptr; } break; default: @@ -160,254 +159,256 @@ void DisableAlarmTimer(AlarmTimerType type) UIViewGroup *CreateAlarmCloseView() { - closeView = new UIViewGroup(); - if (closeView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView closeView null!"); + g_closeView = new UIViewGroup(); + if (g_closeView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView g_closeView null!"); return nullptr; } - closeView->SetPosition(MAX_SET_ZERO_LEN, MAX_SET_ZERO_LEN); - closeView->SetWidth(Screen::GetInstance().GetWidth()); - closeView->SetHeight(Screen::GetInstance().GetHeight()); - imageClose = new UIImageView(); - if (imageClose == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView imageClose null!"); - delete closeView; - closeView = nullptr; + g_closeView->SetPosition(MAX_SET_ZERO_LEN, MAX_SET_ZERO_LEN); + g_closeView->SetWidth(Screen::GetInstance().GetWidth()); + g_closeView->SetHeight(Screen::GetInstance().GetHeight()); + g_imageClose = new UIImageView(); + if (g_imageClose == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView g_imageClose null!"); + delete g_closeView; + g_closeView = nullptr; return nullptr; } - imageClose->SetPosition(MAX_IMAGE_X_LEN, MAX_IMAGE_Y_LEN); - imageClose->SetWidth(MAX_SET_SRC_LEN); - imageClose->SetHeight(MAX_SET_SRC_LEN); - imageClose->SetSrc(ALARM_CLOCK_CLOSE_ADD_PATH); - imageClose->SetTouchable(true); - closeView->Add(imageClose); - - closeLable = new UILabel(); - if (closeLable == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView closeLable null!"); - delete closeView; - closeView = nullptr; - delete imageClose; - imageClose = nullptr; + g_imageClose->SetPosition(MAX_IMAGE_X_LEN, MAX_IMAGE_Y_LEN); + g_imageClose->SetWidth(MAX_SET_SRC_LEN); + g_imageClose->SetHeight(MAX_SET_SRC_LEN); + g_imageClose->SetSrc(ALARM_CLOCK_CLOSE_ADD_PATH); + g_imageClose->SetTouchable(true); + g_closeView->Add(g_imageClose); + + g_closeLable = new UILabel(); + if (g_closeLable == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmCloseView g_closeLable null!"); + delete g_closeView; + g_closeView = nullptr; + delete g_imageClose; + g_imageClose = nullptr; return nullptr; } - closeLable->SetPosition(MAX_LABEL_X_LEN, MAX_LABEL_Y_LEN, MAX_LABEL_LENGTH_LEN, MAX_LABEL_HEIGHT_LEN); - closeLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, MAX_LABEL_FONT_LEN); - closeLable->SetText("CLOSE"); - closeView->Add(closeLable); - closeView->SetViewId(ALARM_VIEW_CLOSE); - UIView::OnDragListener *listener =static_cast(AlarmViewEventListener::GetInstance()); - closeView->SetOnDragListener(listener); - closeView->SetDraggable(true); - closeView->SetTouchable(true); - return closeView; + g_closeLable->SetPosition(MAX_LABEL_X_LEN, MAX_LABEL_Y_LEN, MAX_LABEL_LENGTH_LEN, MAX_LABEL_HEIGHT_LEN); + g_closeLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, MAX_LABEL_FONT_LEN); + g_closeLable->SetText("CLOSE"); + g_closeView->Add(g_closeLable); + g_closeView->SetViewId(ALARM_VIEW_CLOSE); + UIView::OnDragListener *listener = static_cast(AlarmViewEventListener::GetInstance()); + g_closeView->SetOnDragListener(listener); + g_closeView->SetDraggable(true); + g_closeView->SetTouchable(true); + return g_closeView; } void FreeAlarmCloseView(void) { - if (closeView != nullptr) { - DisableAlarmTimer(NOTIFY_ALARM_CLOSE); - closeView->RemoveAll(); - delete imageClose; - imageClose = nullptr; - delete closeLable; - closeLable = nullptr; - RootView::GetInstance()->Remove(closeView); - delete closeView; - closeView = nullptr; + if (g_closeView != nullptr) { + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_CLOSE); + g_closeView->RemoveAll(); + delete g_imageClose; + g_imageClose = nullptr; + delete g_closeLable; + g_closeLable = nullptr; + RootView::GetInstance()->Remove(g_closeView); + delete g_closeView; + g_closeView = nullptr; } } UIViewGroup *CreateAlarmRingView() { - ringView = new UIViewGroup(); - if (ringView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmRingView ringView null!"); + g_ringView = new UIViewGroup(); + if (g_ringView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmRingView g_ringView null!"); return nullptr; } - ringView->SetPosition(SET_ZERO, SET_ZERO); - ringView->SetWidth(Screen::GetInstance().GetWidth()); - ringView->SetHeight(Screen::GetInstance().GetHeight()); - imageRing = new UIImageView(); - if (imageRing == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmRingView imageRing null!"); - delete ringView; - ringView = nullptr; + g_ringView->SetPosition(SET_ZERO, SET_ZERO); + g_ringView->SetWidth(Screen::GetInstance().GetWidth()); + g_ringView->SetHeight(Screen::GetInstance().GetHeight()); + g_imageRing = new UIImageView(); + if (g_imageRing == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmRingView g_imageRing null!"); + delete g_ringView; + g_ringView = nullptr; return nullptr; } - imageRing->SetPosition(DELAY_IMAGE_X, DELAY_IMAGE_Y); - imageRing->SetWidth(SET_SRC); - imageRing->SetHeight(SET_SRC); - imageRing->SetSrc(ALARM_CLOCK_POP_ADD_PATH); - ringView->Add(imageRing); - ringLable = new UILabel(); - if (ringLable == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmRingView::ringLable null!"); - delete ringView; - ringView = nullptr; - delete imageRing; + g_imageRing->SetPosition(DELAY_IMAGE_X, DELAY_IMAGE_Y); + g_imageRing->SetWidth(SET_SRC); + g_imageRing->SetHeight(SET_SRC); + g_imageRing->SetSrc(ALARM_CLOCK_POP_ADD_PATH); + g_ringView->Add(g_imageRing); + g_ringLable = new UILabel(); + if (g_ringLable == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmRingView::g_ringLable null!"); + delete g_ringView; + g_ringView = nullptr; + delete g_imageRing; return nullptr; } - ringLable->SetPosition(DELAY_LABEL_X, DELAY_LABEL_Y, DELAY_LABEL_LENGTH, DELAY_LABEL_HEIGHT); - ringLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, DELAY_LABEL_FONT); - ringLable->SetText(RING_AGAIN); - ringView->Add(ringLable); - ringView->SetViewId(ALARM_VIEW_DELAY); - UIView::OnDragListener *listener =static_cast(AlarmViewEventListener::GetInstance()); - ringView->SetOnDragListener(listener); - ringView->SetDraggable(true); - ringView->SetTouchable(true); - return ringView; + g_ringLable->SetPosition(DELAY_LABEL_X, DELAY_LABEL_Y, DELAY_LABEL_LENGTH, DELAY_LABEL_HEIGHT); + g_ringLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, DELAY_LABEL_FONT); + g_ringLable->SetText(RING_AGAIN); + g_ringView->Add(g_ringLable); + g_ringView->SetViewId(ALARM_VIEW_DELAY); + UIView::OnDragListener *listener = static_cast(AlarmViewEventListener::GetInstance()); + g_ringView->SetOnDragListener(listener); + g_ringView->SetDraggable(true); + g_ringView->SetTouchable(true); + return g_ringView; } void FreeAlarmRingView(void) { - if (ringView != nullptr) { - DisableAlarmTimer(NOTIFY_ALARM_DELAY); - ringView->RemoveAll(); - delete imageRing; - imageRing = nullptr; - delete ringLable; - ringLable = nullptr; - RootView::GetInstance()->Remove(ringView); - delete ringView; - ringView = nullptr; + if (g_ringView != nullptr) { + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_DELAY); + g_ringView->RemoveAll(); + delete g_imageRing; + g_imageRing = nullptr; + delete g_ringLable; + g_ringLable = nullptr; + RootView::GetInstance()->Remove(g_ringView); + delete g_ringView; + g_ringView = nullptr; } } static bool CreateAlarmViewImage(void) { - imageDelete = new UIImageView(); - if (imageDelete == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showAlarmNotify imageDelete null!"); + g_imageDelete = new UIImageView(); + if (g_imageDelete == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showAlarmNotify g_imageDelete null!"); return false; } - imageDelete->SetPosition(IMAGE_DELETE_X, IMAGE_DELETE_Y); - imageDelete->SetWidth(MAX_SET_SRC_LEN); - imageDelete->SetHeight(MAX_SET_SRC_LEN); - imageDelete->SetViewId(ALARM_IMAGE_DELETE); - imageDelete->SetSrc(ALARM_DELETE_ADD_PATH); - imageDelete->SetTouchable(true); - UIView::OnClickListener *closeListener = (UIView::OnClickListener *)AlarmViewEventListener::GetInstance(); - imageDelete->SetOnClickListener(closeListener); - - imageClock = new UIImageView(); - if (imageClock == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showAlarmNotify imageClock null!"); - delete imageDelete; + g_imageDelete->SetPosition(IMAGE_DELETE_X, IMAGE_DELETE_Y); + g_imageDelete->SetWidth(MAX_SET_SRC_LEN); + g_imageDelete->SetHeight(MAX_SET_SRC_LEN); + g_imageDelete->SetViewId(ALARM_IMAGE_DELETE); + g_imageDelete->SetSrc(ALARM_DELETE_ADD_PATH); + g_imageDelete->SetTouchable(true); + UIView::OnClickListener *closeListener = static_cast\ + (AlarmViewEventListener::GetInstance()); + g_imageDelete->SetOnClickListener(closeListener); + + g_imageClock = new UIImageView(); + if (g_imageClock == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showAlarmNotify g_imageClock null!"); + delete g_imageDelete; return false; } - imageClock->SetPosition(IMAGE_CLOCK_X, IMAGE_CLOCK_Y); - imageClock->SetWidth(MAX_SET_SRC_LEN); - imageClock->SetHeight(MAX_SET_SRC_LEN); - imageClock->SetViewId(ALARM_IMAGE_CLOCK); - imageClock->SetSrc(ALARM_CLOCK_ADD_PATH); - imageClock->SetTouchable(true); - imageClock->SetTouchable(true); - UIView::OnClickListener *clockListener = (UIView::OnClickListener *)OHOS::AlarmViewEventListener::GetInstance(); - imageClock->SetOnClickListener(clockListener); + g_imageClock->SetPosition(IMAGE_CLOCK_X, IMAGE_CLOCK_Y); + g_imageClock->SetWidth(MAX_SET_SRC_LEN); + g_imageClock->SetHeight(MAX_SET_SRC_LEN); + g_imageClock->SetViewId(ALARM_IMAGE_CLOCK); + g_imageClock->SetSrc(ALARM_CLOCK_ADD_PATH); + g_imageClock->SetTouchable(true); + g_imageClock->SetTouchable(true); + UIView::OnClickListener *clockListener = static_cast\ + (OHOS::AlarmViewEventListener::GetInstance()); + g_imageClock->SetOnClickListener(clockListener); return true; } static void FreeAlarmViewImage(void) { - delete imageDelete; - imageDelete = nullptr; - delete imageClock; - imageClock = nullptr; + delete g_imageDelete; + g_imageDelete = nullptr; + delete g_imageClock; + g_imageClock = nullptr; } static bool CreateAlarmViewLabel(void) { - struct tm local_time; - time_t seconds; - seconds = time(NULL); - int16 thisHour, thisMin; - - mainLable = new UILabel(); - if (mainLable == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmViewLabel mainLable is nullptr"); + struct tm localTime; + int16 thisHour; + int16 thisMin; + + g_mainLable = new UILabel(); + if (g_mainLable == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmViewLabel g_mainLable is nullptr"); return false; } - mainLable->SetPosition(LABEL_X, LABEL_Y, LABEL_WIDTH, LABEL_HEIGHT); - mainLable->SetText("闹钟"); - mainLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT); - - dClock = new UIDigitalClock(); - if (dClock == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmViewLabel dClock is nullptr"); - delete mainLable; + g_mainLable->SetPosition(LABEL_X, LABEL_Y, LABEL_WIDTH, LABEL_HEIGHT); + g_mainLable->SetText("闹钟"); + g_mainLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT); + + g_dClock = new UIDigitalClock(); + if (g_dClock == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmViewLabel g_dClock is nullptr"); + delete g_mainLable; return false; } - dClock->SetPosition(CLOCK_X, CLOCK_Y); - dClock->Resize(DIGITAL_CLOCK_WIDTH, DIGITAL_CLOCK_HEIGHT); - dClock->SetFont(DEFAULT_VECTOR_FONT_FILENAME, CLOCK_FONT); - if (localtime_r(&seconds, &local_time) == NULL) { + g_dClock->SetPosition(CLOCK_X, CLOCK_Y); + g_dClock->Resize(DIGITAL_CLOCK_WIDTH, DIGITAL_CLOCK_HEIGHT); + g_dClock->SetFont(DEFAULT_VECTOR_FONT_FILENAME, CLOCK_FONT); + time_t seconds = time(nullptr); + if (localtime_r(&seconds, &localTime) == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmViewLabel get localtime error!"); - delete mainLable; - delete dClock; + delete g_mainLable; + delete g_dClock; return false; } AlarmClockModel::GetInstance()->GetPopTimeData(&thisHour, &thisMin); - dClock->SetDisplayMode(UIDigitalClock::DISPLAY_24_HOUR_NO_SECONDS); - dClock->SetTime24Hour(thisHour, thisMin, 0); + g_dClock->SetDisplayMode(UIDigitalClock::DISPLAY_24_HOUR_NO_SECONDS); + g_dClock->SetTime24Hour(thisHour, thisMin, 0); return true; } static void FreeAlarmViewLabel(void) { - delete mainLable; - mainLable = nullptr; - delete dClock; - dClock = nullptr; + delete g_mainLable; + g_mainLable = nullptr; + delete g_dClock; + g_dClock = nullptr; } UIViewGroup* CreateAlarmView(void) { AlarmClockModel::GetInstance()->AlarmGetClockNum(); - alarmView = new UIViewGroup(); - if (alarmView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmView alarmView null!"); + g_alarmView = new UIViewGroup(); + if (g_alarmView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateAlarmView g_alarmView null!"); return nullptr; } - alarmView->SetPosition(CONTAINER_X, CONTAINER_Y, - Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - alarmView->SetViewId(ALARM_VIEW_POPUP); + g_alarmView->SetPosition(CONTAINER_X, CONTAINER_Y, + Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + g_alarmView->SetViewId(ALARM_VIEW_POPUP); - if (CreateAlarmViewLabel() == false) { - delete alarmView; - alarmView = nullptr; + if (!CreateAlarmViewLabel()) { + delete g_alarmView; + g_alarmView = nullptr; return nullptr; } - if (CreateAlarmViewImage() == false) { - delete alarmView; - alarmView = nullptr; + if (!CreateAlarmViewImage()) { + delete g_alarmView; + g_alarmView = nullptr; FreeAlarmViewLabel(); return nullptr; } - alarmView->Add(mainLable); - alarmView->Add(dClock); - alarmView->Add(imageDelete); - alarmView->Add(imageClock); - - alarmView->SetDraggable(true); - alarmView->SetTouchable(true); - UIView::OnDragListener *listener =static_cast(AlarmViewEventListener::GetInstance()); - alarmView->SetOnDragListener(listener); - StartAlarmTimer(NOTIFY_ALARM_RING, (int32_t)NOTOFY_NO_OPERATE_TIME); - return alarmView; + g_alarmView->Add(g_mainLable); + g_alarmView->Add(g_dClock); + g_alarmView->Add(g_imageDelete); + g_alarmView->Add(g_imageClock); + + g_alarmView->SetDraggable(true); + g_alarmView->SetTouchable(true); + UIView::OnDragListener *listener = static_cast(AlarmViewEventListener::GetInstance()); + g_alarmView->SetOnDragListener(listener); + StartAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING, NOTOFY_NO_OPERATE_TIME); + return g_alarmView; } void FreeAlarmView(void) { - if (alarmView != nullptr) { - DisableAlarmTimer(NOTIFY_ALARM_RING); - alarmView->RemoveAll(); + if (g_alarmView != nullptr) { + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING); + g_alarmView->RemoveAll(); FreeAlarmViewLabel(); FreeAlarmViewImage(); - RootView::GetInstance()->Remove(alarmView); - delete alarmView; - alarmView = nullptr; + RootView::GetInstance()->Remove(g_alarmView); + delete g_alarmView; + g_alarmView = nullptr; } } @@ -436,13 +437,13 @@ bool AlarmViewEventListener::OnDragEnd(UIView& view, const DragEvent& event) { if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { if (strcmp(view.GetViewId(), ALARM_VIEW_POPUP) == 0) { - DisableAlarmTimer(NOTIFY_ALARM_RING); + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING); AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); UIViewGroup* alarmRingView = CreateAlarmRingView(); NotificationManager::GetInstance()->screenContainer_->SetVisible(false); RootView::GetInstance()->Add(alarmRingView); alarmRingView->SetVisible(true); - StartAlarmTimer(NOTIFY_ALARM_DELAY, (int32_t)NOTIFY_THREE_SECONDS); + StartAlarmTimer(AlarmTimerType::NOTIFY_ALARM_DELAY, NOTIFY_THREE_SECONDS); } else if (strcmp(view.GetViewId(), ALARM_VIEW_CLOSE) == 0 || strcmp(view.GetViewId(), ALARM_VIEW_DELAY) == 0) { NotificationManager::GetInstance()->StopNotify(); @@ -456,22 +457,22 @@ bool AlarmViewEventListener::OnClick(UIView& view, const ClickEvent& event) UNUSED(event); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlamNotify ClickListener %s", view.GetViewId()); if (strcmp(view.GetViewId(), ALARM_IMAGE_DELETE) == 0) { - DisableAlarmTimer(NOTIFY_ALARM_RING); + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING); AlarmPopUpPresenter::GetInstance()->CancelAlarmRing(); UIViewGroup* alarmCloseView = CreateAlarmCloseView(); NotificationManager::GetInstance()->screenContainer_->SetVisible(false); RootView::GetInstance()->Add(alarmCloseView); alarmCloseView->SetVisible(true); - StartAlarmTimer(NOTIFY_ALARM_CLOSE, (int32_t)NOTIFY_THREE_SECONDS); + StartAlarmTimer(AlarmTimerType::NOTIFY_ALARM_CLOSE, NOTIFY_THREE_SECONDS); return true; } else if (strcmp(view.GetViewId(), ALARM_IMAGE_CLOCK) == 0) { - DisableAlarmTimer(NOTIFY_ALARM_RING); + DisableAlarmTimer(AlarmTimerType::NOTIFY_ALARM_RING); AlarmPopUpPresenter::GetInstance()->DelayAlarmRing(); UIViewGroup* alarmRingView = CreateAlarmRingView(); NotificationManager::GetInstance()->screenContainer_->SetVisible(false); RootView::GetInstance()->Add(alarmRingView); alarmRingView->SetVisible(true); - StartAlarmTimer(NOTIFY_ALARM_DELAY, (int32_t)NOTIFY_THREE_SECONDS); + StartAlarmTimer(AlarmTimerType::NOTIFY_ALARM_DELAY, NOTIFY_THREE_SECONDS); } return true; } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp index 81af08ec0..50ed97180 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp @@ -18,16 +18,15 @@ #include "VolumeSettingPresenter.h" #include "ui_resource_image.h" -#define NOTIFY_THREE_SECONDS 3000 -#define NOTIFY_ONE_SECOND 1000 -#define NOTIFY_THIRTY_SECONDS 30000 -#define NOTIFY_ONE_MINUTE 60000 -#define NOTOFY_NO_OPERATE_TIME 35000 - namespace OHOS { -int changeImage = 0; -osTimerId_t g_callDuration = NULL; // timer of call duration -osTimerId_t g_callCurrentTime = NULL; // timer of current time +constexpr int32_t NOTIFY_THREE_SECONDS = 3000; +constexpr int32_t NOTIFY_ONE_SECOND = 1000; +constexpr int32_t NOTIFY_THIRTY_SECONDS = 30000; +constexpr int32_t NOTIFY_ONE_MINUTE = 60000; +constexpr int32_t NOTOFY_NO_OPERATE_TIME = 35000; +int g_changeImage = 0; +osTimerId_t g_callDurationTimer = nullptr; // timer of call duration +osTimerId_t g_callCurrentTime = nullptr; // timer of current time static constexpr uint16 MATH_ZERO = 0; @@ -47,6 +46,8 @@ static constexpr uint16 LABEL_COMINGTIME_POSITION_Y = 340; // 图片坐标 static constexpr uint16 LABEL_CALLERD_POSITION_X = 0; static constexpr uint16 LABEL_CALLERD_POSITION_Y = 160; +static constexpr uint16 LABEL_NEWCALLERD_POSITION_X = 0; +static constexpr uint16 LABEL_NEWCALLERD_POSITION_Y = 160; static constexpr uint16 IMAGE_HONRS_POSITION_X = 185; static constexpr uint16 IMAGE_HONRS_POSITION_Y = 10; static constexpr uint16 IMAGE_HANDUP_POSITION_X = 70; @@ -54,24 +55,31 @@ static constexpr uint16 IMAGE_MIC_POSITION_X = 280; static constexpr uint16 IMAGE_DISSGREE_POSITION_X = 80; static constexpr uint16 IMAGE_AGREEING_POSITION_X = 270; static constexpr uint16 IMAGE_ALL_POSITION_Y = 240; +static constexpr uint16 IMAGE_HANDUP2_POSITION_X = 177; +static constexpr uint16 IMAGE_HANDUP2_POSITION_Y = 270; // 字体大小 static constexpr uint16 FONT_CURRENT_SIZE = 25; static constexpr uint16 FONT_CALLER_SIZE = 40; -UIViewGroup* phoneView = nullptr; -UIViewGroup* callingView = nullptr; -UIViewGroup* volumeSettingView = nullptr; -VolumeSettingView *volumeSetting = nullptr; -UIImageView* imageAgree = nullptr; -UIImageView* imageDissgree = nullptr; -UIImageView* imageMicrophone = nullptr; -UIImageView* imageHandUp = nullptr; -UIImageView* imageHorns = nullptr; -UILabel* callerNum = nullptr; -UILabel* callerDisplay = nullptr; -UILabel* callDuration = nullptr; -UILabel* currentTimes = nullptr; -UILabel* comingTimes = nullptr; +UIViewGroup* g_phoneView = nullptr; +UIViewGroup* g_multiPhoneView = nullptr; +UIViewGroup* g_callingView = nullptr; +UIViewGroup* g_volumeSettingView = nullptr; +UIViewGroup* g_waitingHintsView = nullptr; +VolumeSettingView *g_volumeSetting = nullptr; +UIImageView* g_imageAgree = nullptr; +UIImageView* g_imageDissgree = nullptr; +UIImageView* g_imageMicrophone = nullptr; +UIImageView* g_imageHandUp = nullptr; +UIImageView* g_imageHorns = nullptr; +UIImageView* g_imageDissgreeNew = nullptr; +UILabel* g_callerNum = nullptr; +UILabel* g_callerDisplay = nullptr; +UILabel* g_callDuration = nullptr; +UILabel* g_currentTimes = nullptr; +UILabel* g_comingTimes = nullptr; +UILabel* g_newCallHints = nullptr; +UILabel* g_newCallNum = nullptr; void CallTimerCallBack(int data) { @@ -80,15 +88,15 @@ void CallTimerCallBack(int data) void CallTimerCallBackProc(int data) { - if (callDuration != nullptr) { - callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration()); + if (g_callDuration != nullptr) { + g_callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); } } void CallCurTimerCallBack(int data) { - if (currentTimes != nullptr) { - currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); + if (g_currentTimes != nullptr) { + g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); } } @@ -96,32 +104,32 @@ void StartCallTimer(CallTimerType type, int32_t interval) { uint32_t tick; osStatus_t retTimer; - if (type >= NOTIFY_PHONE_UNKNOWN) { + if (type >= CallTimerType::NOTIFY_PHONE_UNKNOWN) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCallTimer type:%d invalid!!", type); return; } switch (type) { - case NOTIFY_PHONE_CALLING_DISPLAY: - g_callDuration = osTimerNew((osTimerFunc_t)CallTimerCallBack, osTimerPeriodic, NULL, NULL); + case CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY: + g_callDurationTimer = osTimerNew((osTimerFunc_t)CallTimerCallBack, osTimerPeriodic, nullptr, nullptr); tick = osMs2Tick(interval); - retTimer = osTimerStart(g_callDuration, tick); - if (retTimer != osOK && g_callDuration != NULL) { + retTimer = osTimerStart(g_callDurationTimer, tick); + if (retTimer != osOK && g_callDurationTimer != nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCallTimer osTimerStart failed, type = %d ret = %lx!!", type, retTimer); - osTimerDelete(g_callDuration); - g_callDuration = NULL; + osTimerDelete(g_callDurationTimer); + g_callDurationTimer = nullptr; return; } break; - case NOTIFY_PHONE_CURTIME_DISPLAY: - g_callCurrentTime = osTimerNew((osTimerFunc_t)CallCurTimerCallBack, osTimerPeriodic, NULL, NULL); + case CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY: + g_callCurrentTime = osTimerNew((osTimerFunc_t)CallCurTimerCallBack, osTimerPeriodic, nullptr, nullptr); tick = osMs2Tick(interval); retTimer = osTimerStart(g_callCurrentTime, tick); - if (retTimer != osOK && g_callCurrentTime != NULL) { + if (retTimer != osOK && g_callCurrentTime != nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCallTimer osTimerStart failed, type = %d ret = %lx!!", type, retTimer); osTimerDelete(g_callCurrentTime); - g_callCurrentTime = NULL; + g_callCurrentTime = nullptr; return; } break; @@ -132,30 +140,30 @@ void StartCallTimer(CallTimerType type, int32_t interval) void DisableCallTimer(CallTimerType type) { - if (type >= NOTIFY_PHONE_UNKNOWN) { + if (type >= CallTimerType::NOTIFY_PHONE_UNKNOWN) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer type:%d invalid!!", type); return; } osStatus_t ret; switch (type) { - case NOTIFY_PHONE_CALLING_DISPLAY: - if (g_callDuration != NULL) { - ret = osTimerDelete(g_callDuration); + case CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY: + if (g_callDurationTimer != nullptr) { + ret = osTimerDelete(g_callDurationTimer); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer failed, type= %d ret = %lx!", type, ret); return; } - g_callDuration = NULL; + g_callDurationTimer = nullptr; } break; - case NOTIFY_PHONE_CURTIME_DISPLAY: - if (g_callCurrentTime != NULL) { + case CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY: + if (g_callCurrentTime != nullptr) { ret = osTimerDelete(g_callCurrentTime); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer failed, type= %d ret = %lx!", type, ret); return; } - g_callCurrentTime = NULL; + g_callCurrentTime = nullptr; } break; default: @@ -165,23 +173,24 @@ void DisableCallTimer(CallTimerType type) void HonrsViewChange(void) { - if (volumeSettingView == nullptr) { - volumeSetting = new VolumeSettingView(); - if (volumeSetting == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::volumeSetting nullptr err"); + if (g_volumeSettingView == nullptr) { + g_volumeSetting = new VolumeSettingView(); + if (g_volumeSetting == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::g_volumeSetting nullptr err"); return; } - if (volumeSetting->SetUpVolume() == false) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::volumeSetting SetUpVolume fail"); + if (!g_volumeSetting->SetUpVolume()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makephone_notification::g_volumeSetting SetUpVolume fail"); return; } - volumeSetting->GetProgress()->SetValue(AudioManager::GetInstance().GetVolume(AUDIO_STREAM_VOICE_CALL_BT_SCO)); + g_volumeSetting->GetProgress()->SetValue( + AudioManager::GetInstance().GetVolume(AUDIO_STREAM_VOICE_CALL_BT_SCO)); if (AudioManager::GetInstance().GetVolume(AUDIO_STREAM_VOICE_CALL_BT_SCO) == 0) { ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_MUTE_BUTTON, PLAYER_IAMGES); - volumeSetting->GetDecreaseButton()->SetImageSrc(image, image); + g_volumeSetting->GetDecreaseButton()->SetImageSrc(image, image); } - volumeSettingView = volumeSetting; - NotificationManager::GetInstance()->screenContainer_->Add(volumeSettingView); + g_volumeSettingView = g_volumeSetting; + NotificationManager::GetInstance()->screenContainer_->Add(g_volumeSettingView); } VolumeSliderEventListener *volumeSliderEventListener = VolumeSliderEventListener::GetInstance(); if (volumeSliderEventListener == nullptr) { @@ -190,304 +199,512 @@ void HonrsViewChange(void) } volumeSliderEventListener->SetPlayerCoefficients(VOLUMEPHONENOTIFY); // 进度条系数 - volumeSettingView->SetVisible(true); + g_volumeSettingView->SetVisible(true); // 刷新UI RootView::GetInstance()->Invalidate(); } static void FreeCallingViewImage(void) { - if (imageMicrophone != nullptr) { - delete imageMicrophone; - imageMicrophone = nullptr; + if (g_imageMicrophone != nullptr) { + delete g_imageMicrophone; + g_imageMicrophone = nullptr; } - if (imageHandUp != nullptr) { - delete imageHandUp; - imageHandUp = nullptr; + if (g_imageHandUp != nullptr) { + delete g_imageHandUp; + g_imageHandUp = nullptr; } - if (imageHorns != nullptr) { - delete imageHorns; - imageHorns = nullptr; + if (g_imageHorns != nullptr) { + delete g_imageHorns; + g_imageHorns = nullptr; } } static bool DrawCallingViewImage(void) { - imageMicrophone = new UIImageView(); - if (imageMicrophone == nullptr) { + g_imageMicrophone = new UIImageView(); + if (g_imageMicrophone == nullptr) { return false; } - imageMicrophone->SetPosition(IMAGE_MIC_POSITION_X, IMAGE_ALL_POSITION_Y); - imageMicrophone->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); - imageMicrophone->SetTouchable(true); - imageMicrophone->SetViewId("microphoneChange"); + g_imageMicrophone->SetPosition(IMAGE_MIC_POSITION_X, IMAGE_ALL_POSITION_Y); + g_imageMicrophone->SetSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); + g_imageMicrophone->SetTouchable(true); + g_imageMicrophone->SetViewId("microphoneChange"); - imageHandUp = new UIImageView(); - if (imageHandUp == nullptr) { + g_imageHandUp = new UIImageView(); + if (g_imageHandUp == nullptr) { FreeCallingViewImage(); return false; } - imageHandUp->SetPosition(IMAGE_HANDUP_POSITION_X, IMAGE_ALL_POSITION_Y); - imageHandUp->SetSrc(PNG_DISSGREE_IMAGE_PATH); - imageHandUp->SetTouchable(true); - imageHandUp->SetViewId("callingHandUp"); + g_imageHandUp->SetPosition(IMAGE_HANDUP_POSITION_X, IMAGE_ALL_POSITION_Y); + g_imageHandUp->SetSrc(PNG_DISSGREE_IMAGE_PATH); + g_imageHandUp->SetTouchable(true); + g_imageHandUp->SetViewId("callingHandUp"); - imageHorns = new UIImageView(); - if (imageHorns == nullptr) { + g_imageHorns = new UIImageView(); + if (g_imageHorns == nullptr) { FreeCallingViewImage(); return false; } - imageHorns->SetPosition(IMAGE_HONRS_POSITION_X, IMAGE_HONRS_POSITION_Y); - imageHorns->SetSrc(PNG_SOUNDBUTTON2); - imageHorns->SetTouchable(true); - imageHorns->SetViewId("volumeSwitch"); + g_imageHorns->SetPosition(IMAGE_HONRS_POSITION_X, IMAGE_HONRS_POSITION_Y); + g_imageHorns->SetSrc(PNG_SOUNDBUTTON2); + g_imageHorns->SetTouchable(true); + g_imageHorns->SetViewId("volumeSwitch"); return true; } static void FreeCallingViewUILabel(void) { - if (callerDisplay != nullptr) { - delete callerDisplay; - callerDisplay = nullptr; + if (g_callerDisplay != nullptr) { + delete g_callerDisplay; + g_callerDisplay = nullptr; } - if (callDuration != nullptr) { - delete callDuration; - callDuration = nullptr; + if (g_callDuration != nullptr) { + delete g_callDuration; + g_callDuration = nullptr; } - if (currentTimes != nullptr) { - delete currentTimes; - currentTimes = nullptr; + if (g_currentTimes != nullptr) { + delete g_currentTimes; + g_currentTimes = nullptr; } } static bool DrawCallingViewUILabel(void) { - callerDisplay = new UILabel(); - if (callerDisplay == nullptr) { + g_callerDisplay = new UILabel(); + if (g_callerDisplay == nullptr) { return false; } - callerDisplay->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, + g_callerDisplay->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - callerDisplay->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); - callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - callerDisplay->SetTextColor(Color::White()); - - callDuration = new UILabel(); - if (callDuration == nullptr) { + g_callerDisplay->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + g_callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); + g_callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); + g_callerDisplay->SetTextColor(Color::White()); + + g_callDuration = new UILabel(); + if (g_callDuration == nullptr) { FreeCallingViewUILabel(); return false; } - callDuration->SetPosition(LABEL_CALLERD_POSITION_X, LABEL_CALLERD_POSITION_Y, + g_callDuration->SetPosition(LABEL_CALLERD_POSITION_X, LABEL_CALLERD_POSITION_Y, Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - callDuration->SetAlign(TEXT_ALIGNMENT_CENTER); - callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration()); - callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - callDuration->SetTextColor(Color::White()); - - currentTimes = new UILabel(); - if (currentTimes == nullptr) { + g_callDuration->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_callDuration->SetAlign(TEXT_ALIGNMENT_CENTER); + g_callDuration->SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); + g_callDuration->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); + g_callDuration->SetTextColor(Color::White()); + + g_currentTimes = new UILabel(); + if (g_currentTimes == nullptr) { FreeCallingViewUILabel(); return false; } - currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y, + g_currentTimes->SetPosition(LABEL_CURREMTTIME_POSITION_X, LABEL_CURREMTTIME_POSITION_Y, Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - currentTimes->SetTextColor(Color::White()); + g_currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); + g_currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); + g_currentTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); + g_currentTimes->SetTextColor(Color::White()); + + return true; +} + +static bool DrawWaitingHintsViewImage(void) +{ + g_imageDissgreeNew = new UIImageView(); + if (g_imageDissgreeNew == nullptr) { + FreeCallingViewImage(); + return false; + } + g_imageDissgreeNew->SetPosition(IMAGE_HANDUP2_POSITION_X, IMAGE_HANDUP2_POSITION_Y); + g_imageDissgreeNew->SetSrc(PNG_DISSGREE_IMAGE_PATH); + g_imageDissgreeNew->SetTouchable(true); + g_imageDissgreeNew->SetViewId("newCallHandUp"); + return true; +} + +static void FreeWaitingHintsViewImage(void) +{ + if (g_imageDissgreeNew != nullptr) { + delete g_imageDissgreeNew; + g_imageDissgreeNew = nullptr; + } +} + +static void FreeWaitingHintsViewLabel(void) +{ + if (g_newCallNum != nullptr) { + delete g_newCallNum; + g_newCallNum = nullptr; + } + if (g_newCallHints != nullptr) { + delete g_newCallHints; + g_newCallHints = nullptr; + } +} +static bool DrawWaitingHintsViewLabel(void) +{ + g_newCallNum = new UILabel(); + if (g_newCallNum == nullptr) { + return false; + } + g_newCallNum->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, + Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); + g_newCallNum->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_newCallNum->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + g_newCallNum->SetAlign(TEXT_ALIGNMENT_CENTER); + g_newCallNum->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); + g_newCallNum->SetTextColor(Color::White()); + + g_newCallHints = new UILabel(); + if (g_newCallHints == nullptr) { + FreeWaitingHintsViewLabel(); + return false; + } + g_newCallHints->SetPosition(LABEL_NEWCALLERD_POSITION_X, LABEL_NEWCALLERD_POSITION_Y, + Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); + g_newCallHints->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_newCallHints->SetText("新来电"); + g_newCallHints->SetAlign(TEXT_ALIGNMENT_CENTER); + g_newCallHints->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); + g_newCallHints->SetTextColor(Color::White()); return true; } static void FreePhoneCallViewImage(void) { - if (imageAgree != nullptr) { - delete imageAgree; - imageAgree = nullptr; + if (g_imageAgree != nullptr) { + delete g_imageAgree; + g_imageAgree = nullptr; } - if (imageDissgree != nullptr) { - delete imageDissgree; - imageDissgree = nullptr; + if (g_imageDissgree != nullptr) { + delete g_imageDissgree; + g_imageDissgree = nullptr; } } static bool DrawPhoneCallViewImage(void) { - imageAgree = new UIImageView(); - if (imageAgree == nullptr) { + g_imageAgree = new UIImageView(); + if (g_imageAgree == nullptr) { return false; } - imageAgree->SetPosition(IMAGE_AGREEING_POSITION_X, IMAGE_ALL_POSITION_Y); - imageAgree->SetSrc(PNG_AGREEING_IMAGE_PATH); - imageAgree->SetTouchable(true); - imageAgree->SetViewId("answer"); - UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::CallViewEventListener::GetInstance(); - imageAgree->SetOnClickListener(clickListener); - imageDissgree = new UIImageView(); - if (imageDissgree == nullptr) { + g_imageAgree->SetPosition(IMAGE_AGREEING_POSITION_X, IMAGE_ALL_POSITION_Y); + g_imageAgree->SetSrc(PNG_AGREEING_IMAGE_PATH); + g_imageAgree->SetTouchable(true); + g_imageAgree->SetViewId("answer"); + UIView::OnClickListener *clickListener = static_cast\ + (OHOS::CallViewEventListener::GetInstance()); + g_imageAgree->SetOnClickListener(clickListener); + g_imageDissgree = new UIImageView(); + if (g_imageDissgree == nullptr) { FreePhoneCallViewImage(); return false; } - imageDissgree->SetPosition(IMAGE_DISSGREE_POSITION_X, IMAGE_ALL_POSITION_Y); - imageDissgree->SetSrc(PNG_DISSGREE_IMAGE_PATH); - imageDissgree->SetTouchable(true); - imageDissgree->SetViewId("displayHandUp"); - imageDissgree->SetOnClickListener(clickListener); + g_imageDissgree->SetPosition(IMAGE_DISSGREE_POSITION_X, IMAGE_ALL_POSITION_Y); + g_imageDissgree->SetSrc(PNG_DISSGREE_IMAGE_PATH); + g_imageDissgree->SetTouchable(true); + g_imageDissgree->SetViewId("displayHandUp"); + g_imageDissgree->SetOnClickListener(clickListener); return true; } static void FreePhoneCallViewLabel(void) { - if (callerNum != nullptr) { - delete callerNum; - callerNum = nullptr; + if (g_callerNum != nullptr) { + delete g_callerNum; + g_callerNum = nullptr; } - if (comingTimes != nullptr) { - delete comingTimes; - comingTimes = nullptr; + if (g_comingTimes != nullptr) { + delete g_comingTimes; + g_comingTimes = nullptr; } } static bool DrawPhoneCallViewLabel(void) { - callerNum = new UILabel(); - if (callerNum == nullptr) { + g_callerNum = new UILabel(); + if (g_callerNum == nullptr) { return false; } - callerNum->SetPosition(LABEL_COMINGVIEW_POSITION_X, LABEL_COMINGVIEW_POSITION_Y, Screen::GetInstance().GetWidth(), - TITLE_LABEL_DEFAULT_HEIGHT); - callerNum->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_callerNum->SetPosition(LABEL_COMINGVIEW_POSITION_X, LABEL_COMINGVIEW_POSITION_Y, + Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); + g_callerNum->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "CreatePhoneCallView phonenum:%s!", CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - callerNum->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - callerNum->SetAlign(TEXT_ALIGNMENT_CENTER); - callerNum->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); - callerNum->SetTextColor(Color::White()); + g_callerNum->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + g_callerNum->SetAlign(TEXT_ALIGNMENT_CENTER); + g_callerNum->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); + g_callerNum->SetTextColor(Color::White()); - comingTimes = new UILabel(); - if (comingTimes == nullptr) { + g_comingTimes = new UILabel(); + if (g_comingTimes == nullptr) { FreePhoneCallViewLabel(); return false; } - comingTimes->SetPosition(LABEL_COMINGTIME_POSITION_X, LABEL_COMINGTIME_POSITION_Y, + g_comingTimes->SetPosition(LABEL_COMINGTIME_POSITION_X, LABEL_COMINGTIME_POSITION_Y, Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); - comingTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); - comingTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - comingTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); - comingTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); - comingTimes->SetTextColor(Color::White()); + g_comingTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + g_comingTimes->SetAlign(TEXT_ALIGNMENT_CENTER); + g_comingTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); + g_comingTimes->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CURRENT_SIZE); + g_comingTimes->SetTextColor(Color::White()); return true; } UIViewGroup* CreatePhoneCallView(void) { - phoneView = new UIViewGroup(); - if (phoneView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreatePhoneCallView phoneView null!"); + g_phoneView = new UIViewGroup(); + if (g_phoneView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreatePhoneCallView g_phoneView null!"); return nullptr; } - phoneView->SetPosition(MATH_ZERO, MATH_ZERO); - phoneView->SetWidth(Screen::GetInstance().GetWidth()); - phoneView->SetHeight(Screen::GetInstance().GetHeight()); - if (DrawPhoneCallViewImage() == false) { - delete phoneView; - phoneView = nullptr; + g_phoneView->SetPosition(MATH_ZERO, MATH_ZERO); + g_phoneView->SetWidth(Screen::GetInstance().GetWidth()); + g_phoneView->SetHeight(Screen::GetInstance().GetHeight()); + if (!DrawPhoneCallViewImage()) { + delete g_phoneView; + g_phoneView = nullptr; return nullptr; } - if (DrawPhoneCallViewLabel() == false) { + if (!DrawPhoneCallViewLabel()) { FreePhoneCallViewImage(); - delete phoneView; - phoneView = nullptr; + delete g_phoneView; + g_phoneView = nullptr; return nullptr; } - phoneView->Add(imageAgree); - phoneView->Add(imageDissgree); - phoneView->Add(callerNum); - phoneView->Add(comingTimes); - phoneView->SetDraggable(true); - phoneView->SetTouchable(true); - return phoneView; + g_phoneView->Add(g_imageAgree); + g_phoneView->Add(g_imageDissgree); + g_phoneView->Add(g_callerNum); + g_phoneView->Add(g_comingTimes); + g_phoneView->SetDraggable(true); + g_phoneView->SetTouchable(true); + return g_phoneView; } void FreePhoneCallView(void) { - if (phoneView != nullptr) { - phoneView->RemoveAll(); + if (g_phoneView != nullptr) { + g_phoneView->RemoveAll(); FreePhoneCallViewImage(); FreePhoneCallViewLabel(); - RootView::GetInstance()->Remove(phoneView); - delete phoneView; - phoneView = nullptr; + RootView::GetInstance()->Remove(g_phoneView); + delete g_phoneView; + g_phoneView = nullptr; + } +} + +UIViewGroup* CreateMultiplePhoneView(void) +{ + g_multiPhoneView = new UIViewGroup(); + if (g_multiPhoneView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMultiplePhoneView g_multiPhoneView null!"); + return nullptr; + } + g_multiPhoneView->SetPosition(MATH_ZERO, MATH_ZERO); + g_multiPhoneView->SetWidth(Screen::GetInstance().GetWidth()); + g_multiPhoneView->SetHeight(Screen::GetInstance().GetHeight()); + if (!DrawCallingViewImage()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateMultiplePhoneView create image error!"); + delete g_multiPhoneView; + g_multiPhoneView = nullptr; + return nullptr; + } + if (!DrawCallingViewUILabel()) { + FreeCallingViewImage(); + delete g_multiPhoneView; + g_multiPhoneView = nullptr; + return nullptr; + } + g_callerDisplay->SetText("正在通话"); + g_callDuration->SetText(""); + g_multiPhoneView->Add(g_imageMicrophone); + g_multiPhoneView->Add(g_imageHandUp); + g_multiPhoneView->Add(g_imageHorns); + g_multiPhoneView->Add(g_callerDisplay); + g_multiPhoneView->Add(g_callDuration); + g_multiPhoneView->Add(g_currentTimes); + g_multiPhoneView->SetDraggable(true); + g_multiPhoneView->SetTouchable(true); + UIView::OnClickListener *clickListener = static_cast\ + (OHOS::CallViewEventListener::GetInstance()); + g_imageMicrophone->SetOnClickListener(clickListener); + g_imageHandUp->SetOnClickListener(clickListener); + g_imageHorns->SetOnClickListener(clickListener); + StartCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY, NOTIFY_THIRTY_SECONDS); + NotificationManager::GetInstance()->SetVolumeScreenStatus(false); + + return g_multiPhoneView; +} + +void FreeMultiplePhoneCallView(void) +{ + if (g_multiPhoneView != nullptr) { + DisableCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY); + g_multiPhoneView->RemoveAll(); + FreeCallingViewImage(); + FreeCallingViewUILabel(); + RootView::GetInstance()->Remove(g_multiPhoneView); + delete g_multiPhoneView; + g_multiPhoneView = nullptr; + } + if (g_volumeSettingView != nullptr) { + delete g_volumeSettingView; + g_volumeSettingView = nullptr; + g_volumeSetting = nullptr; } } UIViewGroup* CreateCallingView(void) { - callingView = new UIViewGroup(); - if (callingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateCallingView callingView null!"); + g_callingView = new UIViewGroup(); + if (g_callingView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateCallingView g_callingView null!"); return nullptr; } - callingView->SetPosition(MATH_ZERO, MATH_ZERO); - callingView->SetWidth(Screen::GetInstance().GetWidth()); - callingView->SetHeight(Screen::GetInstance().GetHeight()); - if (DrawCallingViewImage() == false) { + g_callingView->SetPosition(MATH_ZERO, MATH_ZERO); + g_callingView->SetWidth(Screen::GetInstance().GetWidth()); + g_callingView->SetHeight(Screen::GetInstance().GetHeight()); + if (!DrawCallingViewImage()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateCallingView create image error!"); - delete callingView; - callingView = nullptr; + delete g_callingView; + g_callingView = nullptr; return nullptr; } - if (DrawCallingViewUILabel() == false) { + if (!DrawCallingViewUILabel()) { FreeCallingViewImage(); - delete callingView; - callingView = nullptr; + delete g_callingView; + g_callingView = nullptr; return nullptr; } - callingView->Add(imageMicrophone); - callingView->Add(imageHandUp); - callingView->Add(imageHorns); - callingView->Add(callerDisplay); - callingView->Add(callDuration); - callingView->Add(currentTimes); - callingView->SetDraggable(true); - callingView->SetTouchable(true); - UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::CallViewEventListener::GetInstance(); - imageMicrophone->SetOnClickListener(clickListener); - imageHandUp->SetOnClickListener(clickListener); - imageHorns->SetOnClickListener(clickListener); - StartCallTimer(NOTIFY_PHONE_CALLING_DISPLAY, (int32_t)NOTIFY_ONE_SECOND); - StartCallTimer(NOTIFY_PHONE_CURTIME_DISPLAY, (int32_t)NOTIFY_THIRTY_SECONDS); + g_callingView->Add(g_imageMicrophone); + g_callingView->Add(g_imageHandUp); + g_callingView->Add(g_imageHorns); + g_callingView->Add(g_callerDisplay); + g_callingView->Add(g_callDuration); + g_callingView->Add(g_currentTimes); + g_callingView->SetDraggable(true); + g_callingView->SetTouchable(true); + UIView::OnClickListener *clickListener = static_cast\ + (OHOS::CallViewEventListener::GetInstance()); + g_imageMicrophone->SetOnClickListener(clickListener); + g_imageHandUp->SetOnClickListener(clickListener); + g_imageHorns->SetOnClickListener(clickListener); + StartCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY, NOTIFY_ONE_SECOND); + StartCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY, NOTIFY_THIRTY_SECONDS); NotificationManager::GetInstance()->SetVolumeScreenStatus(false); - return callingView; + return g_callingView; } void FreeCallingView(void) { - if (callingView != nullptr) { - DisableCallTimer(NOTIFY_PHONE_CALLING_DISPLAY); - DisableCallTimer(NOTIFY_PHONE_CURTIME_DISPLAY); - callingView->RemoveAll(); + if (g_callingView != nullptr) { + DisableCallTimer(CallTimerType::NOTIFY_PHONE_CALLING_DISPLAY); + DisableCallTimer(CallTimerType::NOTIFY_PHONE_CURTIME_DISPLAY); + g_callingView->RemoveAll(); FreeCallingViewImage(); FreeCallingViewUILabel(); - RootView::GetInstance()->Remove(callingView); - delete callingView; - callingView = nullptr; + RootView::GetInstance()->Remove(g_callingView); + delete g_callingView; + g_callingView = nullptr; + } + if (g_volumeSettingView != nullptr) { + delete g_volumeSettingView; + g_volumeSettingView = nullptr; + g_volumeSetting = nullptr; + } +} + +UIViewGroup* CreateWaitingHintsView(void) +{ + g_waitingHintsView = new UIViewGroup(); + if (g_waitingHintsView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateWaitingHintsView g_waitingHintsView null!"); + return nullptr; + } + g_waitingHintsView->SetPosition(MATH_ZERO, MATH_ZERO); + g_waitingHintsView->SetWidth(Screen::GetInstance().GetWidth()); + g_waitingHintsView->SetHeight(Screen::GetInstance().GetHeight()); + if (!DrawWaitingHintsViewImage()) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CreateWaitingHintsView create image error!"); + delete g_waitingHintsView; + g_waitingHintsView = nullptr; + return nullptr; } - if (volumeSettingView != nullptr) { - delete volumeSettingView; - volumeSettingView = nullptr; - volumeSetting = nullptr; + if (!DrawWaitingHintsViewLabel()) { + FreeWaitingHintsViewImage(); + delete g_waitingHintsView; + g_waitingHintsView = nullptr; + return nullptr; + } + g_waitingHintsView->Add(g_imageDissgreeNew); + g_waitingHintsView->Add(g_newCallNum); + g_waitingHintsView->Add(g_newCallHints); + g_waitingHintsView->SetDraggable(true); + g_waitingHintsView->SetTouchable(true); + UIView::OnClickListener *clickListener = static_cast\ + (OHOS::CallViewEventListener::GetInstance()); + g_imageDissgreeNew->SetOnClickListener(clickListener); + return g_waitingHintsView; +} + +void FreeWaitingHintsView(void) +{ + if (g_waitingHintsView != nullptr) { + g_waitingHintsView->RemoveAll(); + FreeWaitingHintsViewImage(); + FreeWaitingHintsViewLabel(); + RootView::GetInstance()->Remove(g_waitingHintsView); + delete g_waitingHintsView; + g_waitingHintsView = nullptr; } } void RefreshMicrophoneImageSrc(const char* src) { - imageMicrophone->SetSrc(src); + g_imageMicrophone->SetSrc(src); +} + +void EnableWaitingView(void) +{ + if (g_waitingHintsView == nullptr) { + CreateWaitingHintsView(); + } + if (NotificationManager::GetInstance()->screenContainer_ != nullptr) { + NotificationManager::GetInstance()->screenContainer_->SetVisible(false); + } + RootView::GetInstance()->Add(g_waitingHintsView); + g_waitingHintsView->SetVisible(true); + RootView::GetInstance()->Invalidate(); +} + +void DisableWatingView(void) +{ + if (g_waitingHintsView != nullptr) { + g_waitingHintsView->SetVisible(false); + FreeWaitingHintsView(); + if (NotificationManager::GetInstance()->screenContainer_ != nullptr) { + NotificationManager::GetInstance()->screenContainer_->SetVisible(true); + } + RootView::GetInstance()->Invalidate(); + } +} + +bool HintsHandupClick(void) +{ + if (RejectIncomingCall() != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[HintsHandupClick] RejectIncomingCall error"); + return false; + } + CallerLogModel::GetInstance()->SetWaitingStatus(false); + CallerLogModel::GetInstance()->SetCallStatus(true); + + return true; } CallViewEventListener::CallViewEventListener() @@ -532,18 +749,22 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event) } return true; } else if (strcmp(view.GetViewId(), "microphoneChange") == 0) { - if (changeImage == 0) { - changeImage = 1; + if (g_changeImage == 0) { + g_changeImage = 1; RefreshMicrophoneImageSrc(PNG_MICROPHONE_CLOSE_IMAGE_PATH); SetMicMute(true); } else { - changeImage = 0; + g_changeImage = 0; RefreshMicrophoneImageSrc(PNG_MICROPHONE_OPEN_IMAGE_PATH); SetMicMute(false); } return true; } else if (strcmp(view.GetViewId(), "volumeSwitch") == 0) { HonrsViewChange(); + } else if (strcmp(view.GetViewId(), "newCallHandUp") == 0) { + if (!HintsHandupClick()) { + return false; + } } return true; } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp index 8c7311d3d..4feb730c9 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/notification_manager_customer.cpp @@ -25,5 +25,7 @@ void NotificationManager::FreeNotifyViews() FreeAlarmRingView(); FreePhoneCallView(); FreeCallingView(); + FreeMultiplePhoneCallView(); + FreeWaitingHintsView(); } } diff --git a/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp b/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp index c6a5193a0..0508c6521 100644 --- a/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/vendor_app/baidu/baidu_app.cpp @@ -5,8 +5,8 @@ * Create: 2021-11-11 */ -#include "msg_center.h" #include +#include "msg_center.h" #include "adapter.h" #include "msg_center_protocol.h" #include "msg_center_cmd.h" @@ -17,7 +17,9 @@ #endif #include "common_def.h" #include "player_sample_wrapper.h" -#include "cmsis_os2.h" +#include "baidumap_msg_center.h" +#include "baidumap.h" +#include "soc_osal.h" #ifdef __cplusplus extern "C" { @@ -29,7 +31,7 @@ extern "C" { #define TASK_PRIORITY_PCM_STREAM (osPriority_t)(40) #define PCM_STREAM_MSG_STACK_SIZE 0xC00 -osMessageQueueId_t g_pcm_stream_msg_queue_id = NULL; +osMessageQueueId_t g_pcm_stream_msg_queue_id = nullptr; errcode_t msg_center_navigation_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) { @@ -37,7 +39,7 @@ errcode_t msg_center_navigation_start(uint8_t cmd_id, uint8_t type, void *usr_da uint8_t ack = 1; /* 与手机APK侧约定 */ char *bundleName = msg_center_get_bundle_name(cmd_id); - if (bundleName == NULL) { + if (bundleName == nullptr) { return ERRCODE_FAIL; } WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "bundle name = %s\r\n", bundleName); @@ -77,18 +79,17 @@ errcode_t msg_center_navigation_recv(uint8_t cmd_id, uint8_t type, void *usr_dat } char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { + if (data == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "msg_center_navigation_recv: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv navigate info--> %s\r\n", tlv_payload); DmsLiteSendMsgToJS(data); - data = NULL; free(data); - + data = nullptr; return ERRCODE_SUCC; } @@ -97,7 +98,7 @@ static errcode_t pcm_stream_task_init(void) osMessageQueueAttr_t m_attr = {0}; m_attr.name = "PCM_STREAM_MSG"; g_pcm_stream_msg_queue_id = osMessageQueueNew(PCM_STREAM_MSG_QUEUE_LEN, sizeof(pcm_stream_queue_msg), &m_attr); - if (g_pcm_stream_msg_queue_id == 0) { + if (g_pcm_stream_msg_queue_id == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "create msg queue fail\r\n"); return ERRCODE_FAIL; } @@ -132,7 +133,7 @@ static errcode_t pcm_stream_task_body(void *data) } for (;;) { - osStatus_t ret = osMessageQueueGet(g_pcm_stream_msg_queue_id, &msg, NULL, osWaitForever); + osStatus_t ret = osMessageQueueGet(g_pcm_stream_msg_queue_id, &msg, nullptr, osWaitForever); if (ret != osOK) { continue; } @@ -145,7 +146,8 @@ static errcode_t pcm_stream_task_body(void *data) return ERRCODE_FAIL; } } else if (msg.msg_id == MSGCENTER_TYPE_ID_XIAODU_END_RECORD) { - res = msg_center_xiaodu_send_end_record(MSGCENTER_CMD_XIAODU, MSGCENTER_TYPE_ID_XIAODU_END_RECORD, NULL, 0); + res = msg_center_xiaodu_send_end_record(MSGCENTER_CMD_XIAODU, MSGCENTER_TYPE_ID_XIAODU_END_RECORD, nullptr, + 0); if (res != ERRCODE_SUCC) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "send pcm stream failed"); return ERRCODE_FAIL; @@ -157,6 +159,11 @@ static errcode_t pcm_stream_task_body(void *data) return ERRCODE_SUCC; } +osMessageQueueId_t GetPcmMsgQueueId(void) +{ + return g_pcm_stream_msg_queue_id; +} + errcode_t pcm_stream_create_task(void) { errcode_t ret = ERRCODE_SUCC; @@ -166,8 +173,9 @@ errcode_t pcm_stream_create_task(void) return ERRCODE_FAIL; } - osThreadAttr_t attr = {"pcm_stream", 0, NULL, 0, NULL, PCM_STREAM_MSG_STACK_SIZE, TASK_PRIORITY_PCM_STREAM, 0, 0 }; - if (osThreadNew((osThreadFunc_t)pcm_stream_task_body, NULL, &attr) == NULL) { + osThreadAttr_t attr = {"pcm_stream", 0, nullptr, 0, nullptr, PCM_STREAM_MSG_STACK_SIZE, TASK_PRIORITY_PCM_STREAM, 0, + 0 }; + if (osThreadNew((osThreadFunc_t)pcm_stream_task_body, nullptr, &attr) == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "create pcm_stream task fail!\r\n"); return ERRCODE_FAIL; } @@ -183,7 +191,7 @@ errcode_t msg_center_xiaodu_start(uint8_t cmd_id, uint8_t type, void *usr_data, errcode_t ret = ERRCODE_SUCC; char *bundleName = msg_center_get_bundle_name(cmd_id); - if (bundleName == NULL) { + if (bundleName == nullptr) { return ERRCODE_FAIL; } WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "bundle name = %s\r\n", bundleName); @@ -223,18 +231,17 @@ errcode_t msg_center_xiaodu_recv_xiaodu_info(uint8_t cmd_id, uint8_t type, void } char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { + if (data == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "msg_center_xiaodu_recv_xiaodu_info: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv xiaodu info--> %s\r\n", tlv_payload); DmsLiteSendMsgToJS(data); - data = NULL; free(data); - + data = nullptr; return ERRCODE_SUCC; } @@ -253,22 +260,22 @@ errcode_t msg_center_xiaodu_recv_wenxin_info(uint8_t cmd_id, uint8_t type, void } char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { + if (data == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "msg_center_xiaodu_recv_wenxin_info: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv wenxin info--> %s\r\n", tlv_payload); DmsLiteSendMsgToJS(data); - data = NULL; free(data); - + data = nullptr; return ERRCODE_SUCC; } -static int32_t convert_para_to_player_para(const uint8_t *inParam, uint16_t paramLen, int32_t *outArgc, uint8_t **outArgv) +static int32_t convert_para_to_player_para(const uint8_t *inParam, uint16_t paramLen, int32_t *outArgc, + uint8_t **outArgv) { int ret; char *pos; @@ -276,47 +283,47 @@ static int32_t convert_para_to_player_para(const uint8_t *inParam, uint16_t para uint32_t paramCnt = 0; strTemp = (uint8_t*)osal_kmalloc(paramLen, OSAL_GFP_KERNEL); - if (strTemp == NULL) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} malloc failed.\r\n", __FUNCTION__, __LINE__); + if (strTemp == nullptr) { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} malloc failed.\r\n", __FUNCTION__, __LINE__); return ERRCODE_FAIL; } ret = memset_s(strTemp, paramLen, 0, paramLen); if (ret != EOK) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} memset_s failed.\r\n", __FUNCTION__, __LINE__); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} memset_s failed.\r\n", __FUNCTION__, __LINE__); osal_kfree(strTemp); return ERRCODE_FAIL; } ret = memcpy_s(strTemp, paramLen, inParam, paramLen); if (ret != EOK) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} memcpy_s failed.\r\n", __FUNCTION__, __LINE__); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} memcpy_s failed.\r\n", __FUNCTION__, __LINE__); osal_kfree(strTemp); return ERRCODE_FAIL; } pos = strtok((char*)strTemp, ","); - for (uint32_t i = 0; pos != NULL; i++) { + for (uint32_t i = 0; pos != nullptr; i++) { outArgv[i] = (uint8_t*)osal_kmalloc(strlen(pos) + 1, OSAL_GFP_KERNEL); - if (outArgv[i] == NULL) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} malloc failed.\r\n", __FUNCTION__, __LINE__); + if (outArgv[i] == nullptr) { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} malloc failed.\r\n", __FUNCTION__, __LINE__); osal_kfree(strTemp); return ERRCODE_FAIL; } ret = memcpy_s(outArgv[i], strlen(pos) + 1, pos, strlen(pos) + 1); if (ret != EOK) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} memcpy_s failed.\r\n", __FUNCTION__, __LINE__); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} memcpy_s failed.\r\n", __FUNCTION__, __LINE__); osal_kfree(strTemp); return ERRCODE_FAIL; } paramCnt++; if (*outArgc >= TTS_MEDIA_MAX_PARAM_CNT) { - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER,"{%s():%d} invalid argc: %d(max: 64).\r\n", + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} invalid argc: %d(max: 64).\r\n", __FUNCTION__, __LINE__, *outArgc); osal_kfree(strTemp); return ERRCODE_FAIL; } - pos = strtok(NULL, ","); + pos = strtok(nullptr, ","); } *outArgc = paramCnt; @@ -345,9 +352,9 @@ static void msg_center_tts_player_start(const uint8_t *data, uint32_t dataLen) FREE: for (int32_t i = 0; i < argc; i++) { - if (argv[i] != NULL) { + if (argv[i] != nullptr) { osal_kfree(argv[i]); - argv[i] = NULL; + argv[i] = nullptr; } } WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "{%s():%d} func out %s.\r\n", __FUNCTION__, __LINE__, @@ -371,17 +378,17 @@ errcode_t msg_center_xiaodu_recv_tts(uint8_t cmd_id, uint8_t type, void *usr_dat /* 播放tts语音 */ char *tts_file = (char *)malloc(payload_len + 1); - if (tts_file == NULL) { + if (tts_file == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "msg_center_xiaodu_recv_tts: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(tts_file, tlv_payload, payload_len); + (void)memcpy_s(tts_file, payload_len, tlv_payload, payload_len); tts_file[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv_tts file: %s\r\n", tts_file); char buffer[TTS_AUDIO_PARA_LEN] = {0}; - sprintf_s(buffer, TTS_AUDIO_PARA_LEN, "%s,%s,%d,%d", "xx", tts_file, 1, 0); + (void)sprintf_s(buffer, TTS_AUDIO_PARA_LEN, "%s,%s,%d,%d", "xx", tts_file, 1, 0); msg_center_tts_player_start((const uint8_t *)buffer, strlen(buffer)); /* 播放完成后需删除文件 */ @@ -432,6 +439,39 @@ errcode_t msg_center_xiaodu_send_end_record(uint8_t cmd_id, uint8_t type, void * return ERRCODE_SUCC; } +static void msg_center_transfer_longbuf(char *data, uint8_t type) +{ + FILE *fp = nullptr; + + fp = fopen(data, "rb"); + if (fp == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "%s: open %s fail.\r\n", vector_navi_get_str(type), data); + return; + } + + fseek(fp, 0L, SEEK_END); + long file_len = ftell(fp); + char *file_content = (char *)malloc(sizeof(char) * (file_len + 1)); + if (file_content == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "%s: malloc fail, file_len = %d.\r\n", vector_navi_get_str(type), file_len); + return; + } + + fseek(fp, 0L, SEEK_SET); + if (fread(file_content, file_len, 1, fp) != 1) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "%s: fread fail, file_len = %d.\r\n", vector_navi_get_str(type), file_len); + return; + } + fclose(fp); + file_content[file_len] = '\0'; + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "file_len = %d.\r\n", file_len); + /* send to JSI */ + BaidumapSendMsgToJS(file_content, type); + free(file_content); + file_content = nullptr; +} + errcode_t msg_center_vector_navi_pull_up(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) { unused(usr_data); @@ -439,7 +479,7 @@ errcode_t msg_center_vector_navi_pull_up(uint8_t cmd_id, uint8_t type, void *usr errcode_t ret = ERRCODE_SUCC; char *bundleName = msg_center_get_bundle_name(cmd_id); - if (bundleName == NULL) { + if (bundleName == nullptr) { return ERRCODE_FAIL; } WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "bundle name = %s\r\n", bundleName); @@ -467,43 +507,12 @@ errcode_t msg_center_vector_navi_pull_up(uint8_t cmd_id, uint8_t type, void *usr errcode_t msg_center_vector_navi_recv_svg(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) { -#if 0 - /* 单包合并方案,效率低且file_name不好控制 */ - FILE *fw = NULL; - - if (access(BAIDU_NAVI_BASE_DIR, F_OK) != 0) { - if (mkdir(BAIDU_NAVI_BASE_DIR, S_IREAD | S_IWRITE) != 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "mkdir /user/baidu_navi/ fail.\r\n"); - return ERRCODE_FAIL; - } - } - - char svg_file_path[BAIDU_NAVI_MAX_FILE_LEN] = { 0 }; - if (sprintf_s(svg_file_path, sizeof(svg_file_path), "%s%s", BAIDU_NAVI_BASE_DIR, svg_file_path) < 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "svg_file_path is valid.\r\n"); - return ERRCODE_FAIL; - } - - fw = fopen(svg_file_path, "wb"); - if (!fw) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "open svg_file_path fail.\r\n"); - return ERRCODE_FAIL; - } - - if (fwrite(usr_data, usr_len, 1, fw) != 1) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "write svg_file fail.\r\n"); - return ERRCODE_FAIL; - } - fclose(fw); - - return ERRCODE_SUCC; -#endif - /* 采用数传方案,svg上传板侧后通知msg_center文件名 */ uint8_t tl_len = msg_center_get_tlv_tl_len(usr_data); uint16_t payload_len = usr_len - tl_len; uint8_t *tlv_payload = (uint8_t *)msg_center_get_tlv_payload(usr_data); uint8_t ack = 1; errcode_t ret = ERRCODE_SUCC; + uint8_t res; /* ack */ ret = msg_center_send_data(cmd_id, type, &ack, sizeof(ack)); @@ -511,17 +520,38 @@ errcode_t msg_center_vector_navi_recv_svg(uint8_t cmd_id, uint8_t type, void *us return ERRCODE_FAIL; } - /* svg_file_name */ - char *svg_file = (char *)malloc(payload_len + 1); - if (svg_file == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "recv_svg: malloc failed.\r\n"); + /* svg json */ + char *svg_json = (char *)malloc(payload_len + 1); + if (svg_json == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "rec_svg_json: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(svg_file, tlv_payload, payload_len); - svg_file[payload_len] = '\0'; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv_svg file: %s\r\n", svg_file); - /* send svg_file to baiduSDK */ + (void)memcpy_s(svg_json, payload_len, tlv_payload, payload_len); + svg_json[payload_len] = '\0'; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_MSG_CENTER, "rec_svg_json file: %s\r\n", svg_json); + +#if defined(SUPPORT_POWER_MANAGER) + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (display_api->get_screen_state() != SCREEN_ON) { + display_api->turn_on_screen(); + } + display_api->set_screen_set_keepon_timeout(600000); // 600000ms +#endif + + /* send svg_json to baiduSDK */ + struct Content content = { + .x = 0, + .y = 0, + .z = 0, + .data = NULL, + .json = svg_json + }; + + DuerMapInfo(cmd_id, type, &content); + + free(svg_json); + svg_json = NULL; return ERRCODE_SUCC; } @@ -533,6 +563,8 @@ errcode_t msg_center_vector_navi_req_svg(uint8_t cmd_id, uint8_t type, void *usr if (ret != ERRCODE_SUCC) { return ERRCODE_FAIL; } + + WEARABLE_LOGD(WEARABLE_LOG_MODULE_MSG_CENTER, "usr_data = %s\r\n", usr_data); return ERRCODE_SUCC; } @@ -565,20 +597,18 @@ errcode_t msg_center_vector_navi_recv_dst_list(uint8_t cmd_id, uint8_t type, voi uint8_t ack = 1; errcode_t ret = ERRCODE_SUCC; - /* send to baiduSDK */ char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { + if (data == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "recv dst list: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv vector navi info--> %s\r\n", tlv_payload); - // DmsLiteSendMsgToJS(data); - data = NULL; + /* send to baiduSDK */ free(data); - + data = nullptr; return ERRCODE_SUCC; } @@ -603,18 +633,17 @@ errcode_t msg_center_vector_navi_recv_navi_info(uint8_t cmd_id, uint8_t type, vo /* send to BaiduSDK */ char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { + if (data == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "recv dst list: malloc failed.\r\n"); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv vector navi info--> %s\r\n", tlv_payload); - // DmsLiteSendMsgToJS(data); - data = NULL; + /* send data to js */ free(data); - + data = nullptr; return ERRCODE_SUCC; } @@ -638,8 +667,11 @@ errcode_t msg_center_vector_navi_req_poi(uint8_t cmd_id, uint8_t type, void *usr errcode_t ret = ERRCODE_SUCC; ret = msg_center_send_data(cmd_id, type, usr_data, usr_len); if (ret != ERRCODE_SUCC) { + BaidumapFailSendMsgToJS("send data fail", type + 1); // JSI提供的fail回调只挂接了rec,因此req流程中加一 return ERRCODE_FAIL; } + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "req poi ok.\r\n"); return ERRCODE_SUCC; } @@ -651,19 +683,26 @@ errcode_t msg_center_vector_navi_recv_poi(uint8_t cmd_id, uint8_t type, void *us uint8_t ack = 1; errcode_t ret = ERRCODE_SUCC; - /* send to baiduSDK */ + /* ack */ + ret = msg_center_send_data(cmd_id, type, &ack, sizeof(ack)); + if (ret != ERRCODE_SUCC) { + return ERRCODE_FAIL; + } + char *data = (char *)malloc(payload_len + 1); - if (data == NULL) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "recv dst list: malloc failed.\r\n"); + if (data == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "recv poi: malloc failed.\r\n"); + BaidumapFailSendMsgToJS("rec malloc fail", type); return ERRCODE_FAIL; } - memcpy(data, tlv_payload, payload_len); + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); data[payload_len] = '\0'; - WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv vector navi info--> %s\r\n", tlv_payload); - // DmsLiteSendMsgToJS(data); - data = NULL; + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "recv poi info -- > %s, usr_len = %d\r\n", tlv_payload, usr_len); + + msg_center_transfer_longbuf(data, type); free(data); + data = nullptr; return ERRCODE_SUCC; } @@ -693,6 +732,319 @@ errcode_t msg_center_vector_navi_finish_from_phone(uint8_t cmd_id, uint8_t type, return ERRCODE_SUCC; } +static errcode_t msg_center_vector_navi_req_common_proc(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + errcode_t ret = ERRCODE_SUCC; + ret = msg_center_send_data(cmd_id, type, usr_data, usr_len); + if (ret != ERRCODE_SUCC) { + BaidumapFailSendMsgToJS("send data fail", type + 1); + return ERRCODE_FAIL; + } + + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "%s, usr_data = %s, usr_len = %d\r\n", vector_navi_get_str(type), + usr_data, usr_len); + return ERRCODE_SUCC; +} + +static bool is_vector_navi_longbuf(uint8_t type) +{ + if (type == MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_POI_SUG_SEARCH || + type == MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REGEOCODE_SEARCH || + type == MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_RIDING_SEARCH || + type == MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_WALKING_SEARCH || + type == MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_TRANSIT_SEARCH) { + return true; + } else { + return false; + } +} + +static errcode_t msg_center_vector_navi_rec_common_proc(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + uint8_t tl_len = msg_center_get_tlv_tl_len(usr_data); + uint16_t payload_len = usr_len - tl_len; + uint8_t *tlv_payload = (uint8_t *)msg_center_get_tlv_payload(usr_data); + errcode_t ret = ERRCODE_SUCC; + uint8_t ack = 1; + + /* ack */ + ret = msg_center_send_data(cmd_id, type, &ack, sizeof(ack)); + if (ret != ERRCODE_SUCC) { + return ERRCODE_FAIL; + } + + char *data = (char *)malloc(payload_len + 1); + if (data == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MSG_CENTER, "%s: malloc failed.\r\n", vector_navi_get_str(type)); + BaidumapFailSendMsgToJS("rec malloc fail", type); + return ERRCODE_FAIL; + } + + (void)memcpy_s(data, payload_len, tlv_payload, payload_len); + data[payload_len] = '\0'; + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MSG_CENTER, "%s -- > %s\r\n", vector_navi_get_str(type), tlv_payload); + + if (is_vector_navi_longbuf(type)) { + msg_center_transfer_longbuf(data, type); + } else { + BaidumapSendMsgToJS(data, type); + } + free(data); + data = nullptr; + + return ERRCODE_SUCC; +} + +errcode_t msg_center_vector_navi_req_auth_license(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_auth_license(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_geo_location(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_geo_location(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_navi_init(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_navi_init(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_plan_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_plan_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_plan_succ(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_plan_succ(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_plan_fail(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_plan_fail(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_navi_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_navi_start(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_navi_destroy(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_navi_destroy(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_road_guide_text_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_road_guide_text_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_road_guide_icon_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_road_guide_icon_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_remain_time_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_remain_time_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_remain_distance_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_remain_distance_update(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_remain_route_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_remain_route_update(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_gps_status_change(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_gps_status_change(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_faraway(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_faraway(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_plan_yawing(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_plan_yawing(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_re_route_complete(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_re_route_complete(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_arrive_destination(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_arrive_destination(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vertor_navi_req_poi_sug_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vertor_navi_rec_poi_sug_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_riding_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_riding_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_walking_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_walking_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_route_transit_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_route_transit_search(uint8_t cmd_id, uint8_t type, void *usr_data, + uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_geocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_geocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_req_regeocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_req_common_proc(cmd_id, type, usr_data, usr_len); +} + +errcode_t msg_center_vector_navi_rec_regeocode_search(uint8_t cmd_id, uint8_t type, void *usr_data, uint16_t usr_len) +{ + return msg_center_vector_navi_rec_common_proc(cmd_id, type, usr_data, usr_len); +} + #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/code/sdk/application/wearable/service/power_manager/include/power_display_service.h b/code/sdk/application/wearable/service/power_manager/include/power_display_service.h index 8c9b14ff2..bfe7eecdd 100644 --- a/code/sdk/application/wearable/service/power_manager/include/power_display_service.h +++ b/code/sdk/application/wearable/service/power_manager/include/power_display_service.h @@ -199,34 +199,6 @@ typedef enum timer_event_type { } timer_event_type_t; -/** - * @brief Touch Panel事件类型枚举值 - * - * TP数据上报时需要同时标识当前TP事件类型,比如按下、释放 - * 在standby mode上报的TP事件只包含当前事件的类型 - * - */ -typedef enum touch_event_type { - /* * 手指触摸 */ - TP_PRESS = 0, - /* * 手指抬起 */ - TP_RELEASE = 1, - /* * 手指触摸后滑动 */ - TP_MOVE = 2, - /* * 主表盘盖屏 */ - TP_COVER = 3, - /* * 手指单击 */ - TP_SHORT_CLICK = 4, - /* * 手指双击 */ - TP_DOUBLE_CLICK = 5, - /* * 上滑 */ - TP_SLIDE_UP = 6, - /* * 下滑 */ - TP_SLIDE_DOWN = 7, - /* * 异常TP事件 */ - TP_INVALID, -} touch_event_type_t; - /** * @brief 屏幕管理上下文,记录关键配置信息,传递给过滤器使用 */ diff --git a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c index b2c45a0a8..e4efdeeb6 100644 --- a/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c +++ b/code/sdk/application/wearable/service/power_manager/src/actions/display_action.c @@ -177,12 +177,14 @@ static uint32_t action_display_lcd_off() } last_screen_off_timestamp = get_display_timestamp(); caculate_screen_on_time(); -#ifdef SUPPORT_AT_OHOSFWK - notify_screen_off_event(); -#endif #if defined(ENABLE_UIKIT) || defined(ENABLE_LVGL) NotifyScreenOff(); // Instruct the uikit to close the display operation. #endif + +#ifdef SUPPORT_AT_OHOSFWK + notify_screen_off_event(); +#endif + osDelay(100); // Wait 100ms for the uikit to complete display. touch_screen_suspend(); // close touch ext_errno ret = drv_vau_suspend(NULL); diff --git a/code/sdk/application/wearable/service/power_manager/src/filters/gui_event_filter.c b/code/sdk/application/wearable/service/power_manager/src/filters/gui_event_filter.c index acf40a9f1..0a9b5e44e 100644 --- a/code/sdk/application/wearable/service/power_manager/src/filters/gui_event_filter.c +++ b/code/sdk/application/wearable/service/power_manager/src/filters/gui_event_filter.c @@ -8,6 +8,7 @@ #include "power_display_service.h" #include "display_filter.h" #include "common_def.h" +#include "touch_screen_def.h" static input_action_t filter_gui_execute_product_rule(screen_context_t *current, uint32_t event) { @@ -28,13 +29,13 @@ static input_action_t filter_gui_execute_touch_event(screen_context_t *current, { unused(type); input_action_t ac = KEEP_CURRENT_STATE; - if (event == TP_PRESS) { + if (event == MC_TP_PRESS) { current->press_state = true; - } else if (event == TP_RELEASE || event == TP_COVER) { + } else if (event == MC_TP_RELEASE || event == MC_TP_COVER) { current->press_state = false; } - if (event == TP_COVER) { + if (event == MC_TP_COVER) { ac = TURN_OFF_SCREEN; } else { ac = TURN_ON_SCREEN; diff --git a/code/sdk/application/wearable/service/power_manager/src/power_display_service.c b/code/sdk/application/wearable/service/power_manager/src/power_display_service.c index 2902e9760..719336089 100644 --- a/code/sdk/application/wearable/service/power_manager/src/power_display_service.c +++ b/code/sdk/application/wearable/service/power_manager/src/power_display_service.c @@ -19,6 +19,7 @@ #include "input_app.h" #include "touch_screen_def.h" #include "display_state_machine.h" +#include "touch_screen_def.h" #define DISPLAY_AUTO_POWER_OFF_PERIOD_MS 5000 #define DISPLAY_DEFAULT_BRIGHTNESS 50 @@ -222,11 +223,11 @@ static void power_display_touch_event_cb(uint32_t event, uint32_t event_value) unused(event_value); message_type_t mt = GUI_EVENT_CMD; uint32_t event_info = TOUCH; - if (event == INDEV_STATE_PRESS) { - event_info += TP_PRESS; + if (event == MC_TP_PRESS || event == MC_TP_MOVE) { + event_info += MC_TP_PRESS; g_power_tp_press_num++; - } else if (event == INDEV_STATE_RELEASE) { - event_info += TP_RELEASE; + } else if (event == MC_TP_RELEASE) { + event_info += MC_TP_RELEASE; g_power_tp_press_num = 0; } else { return; diff --git a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp index 7fa4d214c..7a36219b8 100644 --- a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp +++ b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp @@ -14,6 +14,7 @@ #include "abilityms_slite_client.h" #include "gt_bundle_manager_service.h" #include "ui_service.h" +#include "sign_mode.h" #define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) #define OHOSFWK_MAX_ARGC 8 @@ -162,9 +163,9 @@ static uint32_t OhosfwkATCmdBmSet(uint8_t *para, uint32_t paraLen, char *strComm char *enable = (char *)argv[0]; if (strcmp(enable, "enable") == 0) { - OHOS::GtManagerService::GetInstance().SetSignMode(true); + OHOS::SignMode::GetInstance().SetSignMode(true); } else if (strcmp(enable, "disable") == 0) { - OHOS::GtManagerService::GetInstance().SetSignMode(false); + OHOS::SignMode::GetInstance().SetSignMode(false); } else { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "input failed!"); } diff --git a/code/sdk/bootloader/flashboot/brandy/main.c b/code/sdk/bootloader/flashboot/brandy/main.c index be9afc107..274de4b8a 100644 --- a/code/sdk/bootloader/flashboot/brandy/main.c +++ b/code/sdk/bootloader/flashboot/brandy/main.c @@ -644,9 +644,6 @@ void main(void) show_reboot_info(); otp_init(); - // Enable the SSB hash check in the ROM program. - otp_write_bit(OTP_BOOTLOADER_BYTE, (1 << OTP_BOOTLOADER_FSB_EN_SSB_HASH_BIT)); - otp_write_bit(OTP_BOOTLOADER_DOUBLE_BYTE, (1 << OTP_BOOTLOADER_FSB_EN_SSB_HASH_BIT)); irmalloc_init_default(); ssb_hold_flash_pin(); uapi_flash_init(0); diff --git a/code/sdk/bootloader/flashboot/brandy/nandflash/hal_nandflash.c b/code/sdk/bootloader/flashboot/brandy/nandflash/hal_nandflash.c index df6910322..06298c845 100644 --- a/code/sdk/bootloader/flashboot/brandy/nandflash/hal_nandflash.c +++ b/code/sdk/bootloader/flashboot/brandy/nandflash/hal_nandflash.c @@ -79,9 +79,9 @@ uint32_t read_cell_array(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); @@ -111,9 +111,9 @@ uint32_t program_execute(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); @@ -137,9 +137,9 @@ uint32_t block_erase(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); diff --git a/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash.c b/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash.c index 32e41013f..8c740c089 100644 --- a/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash.c +++ b/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash.c @@ -111,15 +111,15 @@ uint32_t mc_flash_read_page(uint32_t nand_page, uint8_t *data, uint32_t data_len { uapi_watchdog_kick(); NFPRINT("mc_flash_read_page nand_page = %d\r\n", nand_page); - uint16_t page_addr; + uint32_t page_addr; errno_t err_code; uint8_t error_cnt = 0; if (nand_page >= (get_nand_flash()->pages_per_block * get_nand_flash()->total_block)) { return MC_FAILURE; } mc_flash_busy_wait(); - page_addr = SWAP_U16(nand_page); - NFPRINT("page addr = %d \r\n", page_addr); + page_addr = SWAP_U32(nand_page); + NFPRINT("page addr = %u \r\n", page_addr); qspi_data_type_def qspi_data = {0}; qspi_data.data_ptr = (uint8_t *)&page_addr; qspi_data.instruction = 0x13; @@ -139,7 +139,7 @@ uint32_t mc_flash_write_page(uint32_t nand_page, uint8_t *data, uint32_t data_le { uapi_watchdog_kick(); uint32_t ret; - uint16_t page_addr; + uint32_t page_addr; uint8_t status_reg; write_cmd(CMD_FLASH_WREN); qspi_data_type_def p_load_qspi_data = {0}; @@ -148,7 +148,7 @@ uint32_t mc_flash_write_page(uint32_t nand_page, uint8_t *data, uint32_t data_le program_load(&p_load_qspi_data, data, data_len, oob, oob_len); qspi_data_type_def e_load_qspi_data = {0}; e_load_qspi_data.instruction = CMD_FLASH_PP_EXE; - page_addr = SWAP_U16(nand_page); + page_addr = SWAP_U32(nand_page); e_load_qspi_data.data_ptr = (uint8_t *)&page_addr; program_execute(&e_load_qspi_data); mc_flash_busy_wait(); @@ -168,9 +168,9 @@ uint32_t mc_flash_erase_block(uint32_t block_no) uapi_watchdog_kick(); NFPRINT("mc_flash_erase_block block_no = %d\r\n", block_no); uint32_t ret; - uint16_t page_addr; + uint32_t page_addr; uint8_t reg_status; - page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); write_cmd(CMD_FLASH_WREN); qspi_data_type_def erase_qspi_data = {0}; erase_qspi_data.data_ptr = (uint8_t *)&page_addr; @@ -197,11 +197,11 @@ uint32_t mc_flash_mark_bad_block(uint32_t block_no) qspi_data_type_def mark = {0}; mark.instruction = CMD_FLASH_PP_RANDOM; mark.data_ptr = (uint8_t *)&mark_sign; - mark.address = get_nand_flash()->bytes_per_page; + mark.address = (uint16_t)(get_nand_flash()->bytes_per_page); mark_bad_block(&mark); qspi_data_type_def execute = {0}; execute.instruction = CMD_FLASH_PP_EXE; - uint16_t page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + uint32_t page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); execute.data_ptr = (uint8_t *)&page_addr; program_execute(&execute); mc_flash_busy_wait(); @@ -213,7 +213,7 @@ uint32_t mc_flash_check_bad_block(uint32_t block_no) { uapi_watchdog_kick(); uint32_t ret = NOT_BAD_BLOCK; - uint16_t page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + uint32_t page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); qspi_data_type_def cell_read = {0}; cell_read.data_ptr = (uint8_t *)&page_addr; cell_read.instruction = CMD_FLASH_READ_PAGE; @@ -225,7 +225,7 @@ uint32_t mc_flash_check_bad_block(uint32_t block_no) random_read.data_ptr = &check_value; random_read.instruction = CMD_FLASH_READ; random_read.data_size = 4; // 4 is data length - random_read.address = get_nand_flash()->bytes_per_page; + random_read.address = (uint16_t)(get_nand_flash()->bytes_per_page); read_buffer_single_line_width_8(&random_read); /* check the oob fisrt byte 2 and byte 3 bytes, they are badblock bits */ check_value = check_value >> 16; // 16 is mark pos need diff --git a/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash_qspi.c b/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash_qspi.c index 1baac32c3..e6694133e 100644 --- a/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash_qspi.c +++ b/code/sdk/bootloader/flashboot/brandy/nandflash/nandflash_qspi.c @@ -76,8 +76,11 @@ void qspi_read_width_8(uint8_t *buffer, uint32_t length) return; } while (((readl(SR)) & 0x8) == 0x8) { - buffer[ul_loop] = ((uint8_t)readl(DR)); - ul_loop++; + if (ul_loop < length) { + buffer[ul_loop++] = ((uint8_t)readl(DR)); + } else { + (void)readl(DR); + } ul_recv_timeout = 0; } ul_recv_timeout++; @@ -100,8 +103,11 @@ void qspi_read_width_32(uint32_t *recvbuf, uint32_t length) return; } while (((readl(SR)) & 0x8) == 0x8) { - recvbuf[ul_loop] = ((uint32_t)readl(DR)); - ul_loop++; + if (ul_loop < length) { + recvbuf[ul_loop++] = ((uint32_t)readl(DR)); + } else { + (void)readl(DR); + } ul_recv_timeout = 0; } ul_recv_timeout++; diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 10f7d78a1..370331fda 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -121,7 +121,7 @@ target = { 'ulp_aon', 'hal_l2ram', 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'x_vfs_private', 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'ohosfwk_at_service', - "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header'], + "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header', 'baidumapsdk'], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'bgh_audio', 'dfx_set', 'ohos_set', 'wearable_set', 'alipay_set'], 'dsp_version': 'max', 'packet': True, @@ -144,7 +144,7 @@ target = { 'ulp_aon', 'hal_l2ram', 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'x_vfs_private', 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'ohosfwk_at_service', - "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header'], + "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header', 'baidumapsdk'], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'bgh_audio', 'dfx_set', 'ohos_set', 'wearable_set', 'xts_set', 'xts_test_set', 'alipay_set'], 'dsp_version': 'max', 'packet': True, diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ACTIVITY.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ACTIVITY.bin new file mode 100644 index 000000000..45a459dac Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ACTIVITY.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ADD.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ADD.bin new file mode 100644 index 000000000..f308fc020 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_ADD.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_COMPASS.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_COMPASS.bin new file mode 100644 index 000000000..e253bbe46 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_COMPASS.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_DEL.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_DEL.bin new file mode 100644 index 000000000..0c0adcbd8 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_DEL.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_HEART.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_HEART.bin new file mode 100644 index 000000000..a19125d62 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_HEART.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_PLAYER.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_PLAYER.bin new file mode 100644 index 000000000..6b0985224 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/CARD_PLAYER.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DIAL_CLOCK.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DIAL_CLOCK.bin new file mode 100644 index 000000000..744141270 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/DIAL_CLOCK.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_DESKTOP.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_DESKTOP.bin new file mode 100644 index 000000000..332ebc054 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SETTTING_DESKTOP.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_BG.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_BG.bin new file mode 100644 index 000000000..fafbd1b50 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_BG.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_HEXAGONS.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_HEXAGONS.bin new file mode 100644 index 000000000..6c9477666 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_HEXAGONS.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_LIST.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_LIST.bin new file mode 100644 index 000000000..14547a23b Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/SET_DESKTOP_LIST.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/hexagons.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/hexagons.bin new file mode 100644 index 000000000..f3dc2e88b Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/hexagons.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/kaleidoscope.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/kaleidoscope.bin new file mode 100644 index 000000000..eac0b9066 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/kaleidoscope.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/planet.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/planet.bin new file mode 100644 index 000000000..9a6e5ba36 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/planet.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rabbit454.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rabbit454.bin new file mode 100644 index 000000000..f98a0c1bf Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rabbit454.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rainbow.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rainbow.bin new file mode 100644 index 000000000..3419bad22 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/rainbow.bin differ diff --git a/code/sdk/build/config/target_config/common_config.py b/code/sdk/build/config/target_config/common_config.py index eed6feca0..0719036c8 100644 --- a/code/sdk/build/config/target_config/common_config.py +++ b/code/sdk/build/config/target_config/common_config.py @@ -116,10 +116,11 @@ component_set = { 'efuse_v120': ['efuse', 'hal_efuse_v120', 'efuse_porting'], 'efuse_v100': ['efuse', 'hal_efuse_v100', 'efuse_porting'], 'efuse_v130': ['efuse', 'hal_efuse_v130', 'efuse_port'], - 'ohos_set' : ['bootstrap', 'samgr', 'ams', 'bms', 'ace', 'ace_adapt', 'permission', 'appverify', 'jerryscript','js_player', 'js_audio_captuer','i18n', 'resmgr', 'syspara'], + 'ohos_set' : ['bootstrap', 'samgr', 'ams', 'bms', 'bms_sign_mode', 'ace', 'ace_adapt', 'permission', 'appverify', 'jerryscript','js_player', 'js_audio_captuer', 'baidumapcomponent', 'i18n', + 'resmgr', 'syspara', 'utils_kv_store', 'native_file', 'storage_jsapi', 'brightness'], 'wearable_set' : ['nativeabilityfwk', 'nativelauncher', 'ai_voice_service', 'ai_voice_engine_hal', 'ai_voice_audio_stream_wrapper', 'ohos_deps', 'broadcast', 'msg_center', 'msg_center_adapt', 'ohos_startup'], - 'xts_set' : ["syspara", "utils_kv_store", "native_file", "xts_adapt", "ohos_drv_v3.2", + 'xts_set' : ["xts_adapt", "ohos_drv_v3.2", "hiview_lite", "hievent_lite", "hilog_lite", "huks_sdk"], 'xts_test_set' : ["hctest", "ActsHuksHalFunctionTest", "huks_test_common", "ActsAbilityMgrTest", "ActsBundleMgrTest", "ActsKvStoreTest", "ActsUtilsFileTest", "ActsHieventLiteTest", "ActsDfxFuncTest", "ActsWifiIotTest", diff --git a/code/sdk/drivers/boards/brandy_evb/linker/standard/acore.prelds b/code/sdk/drivers/boards/brandy_evb/linker/standard/acore.prelds index d233e1b28..69a5f10b6 100644 --- a/code/sdk/drivers/boards/brandy_evb/linker/standard/acore.prelds +++ b/code/sdk/drivers/boards/brandy_evb/linker/standard/acore.prelds @@ -238,6 +238,7 @@ SECTIONS *driver/dma*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *driver/ulp_aon*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *driver/uart*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) + *driver/touch*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *drivers/chips/brandy/libchip_brandy.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *drivers/chips/brandy/libbrandy_clocks.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *drivers/chips/brandy/libpmu_brandy.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) @@ -245,6 +246,10 @@ SECTIONS *drivers/chips/brandy/porting/xip*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *drivers/chips/brandy/porting/spi*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *drivers/chips/brandy/porting/uart*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) + *drivers/chips/brandy/porting/dma*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) + *drivers/chips/brandy/porting/pinctrl*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) + *drivers/chips/brandy/porting/systick*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) + *(.text.__udivdi3); /* Kernel */ *kernel/osal*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) *kernel/non_os*.a:*.o* (.text .text* .rodata .rodata* .srodata .srodata*) diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config.h index 5d8a7e82f..70fd0c17d 100644 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config.h +++ b/code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config.h @@ -31,8 +31,8 @@ ULP_RAM地址规划 ULP_RAM有8K大小,范围[0x57038000, 0x57039FFF] */ -/* 不下电日历占用ULP_RAM 8字节 */ +/* 不下电日历占用ULP_RAM 24字节,8字节存储时间8字节存储counter8字节存储alarm */ #define ULP_RAM_OFFSET 0x57038000 #define ULP_RAM_CALENDAR ULP_RAM_OFFSET -#define ULP_RAM_CALENDAR_LENGTH 0x8 +#define ULP_RAM_CALENDAR_LENGTH 0x18 #endif diff --git a/code/sdk/drivers/boards/brandy_evb/memory_config/include/psram_16.h b/code/sdk/drivers/boards/brandy_evb/memory_config/include/psram_16.h index 13b725be9..f425af133 100644 --- a/code/sdk/drivers/boards/brandy_evb/memory_config/include/psram_16.h +++ b/code/sdk/drivers/boards/brandy_evb/memory_config/include/psram_16.h @@ -37,7 +37,7 @@ /* GUI memory pool address NON Cache */ #define PSRAM_GUI_MEM_POOL_ADDR (PSRAM_PLT_RESERVE_ADDR + PSRAM_PLT_RESERVE_LENGTH) -#define PSRAM_GUI_MEM_POOL_SIZE psram_align_size(0x780000, POOL_ADDR_ALIGNSIZE) +#define PSRAM_GUI_MEM_POOL_SIZE psram_align_size(0x600000, POOL_ADDR_ALIGNSIZE) /* VAU Linked List Address NON Cache */ #define PSRAM_DISP_VAU_NODE_ADDR (PSRAM_GUI_MEM_POOL_ADDR + PSRAM_GUI_MEM_POOL_SIZE) @@ -45,6 +45,6 @@ /* reserve */ #define PSRAM_RESERVE_ADDR (PSRAM_DISP_VAU_NODE_ADDR + PSRAM_DISP_VAU_NODE_LENGTH) -#define PSRAM_RESERVE_ADDR_LENGTH psram_align_size(0x0, POOL_ADDR_ALIGNSIZE) +#define PSRAM_RESERVE_ADDR_LENGTH psram_align_size(0x180000, POOL_ADDR_ALIGNSIZE) #endif // PSRAM_H diff --git a/code/sdk/drivers/chips/brandy/porting/include/systick_porting.h b/code/sdk/drivers/chips/brandy/porting/include/systick_porting.h index 396fca7b0..3d2aecfc9 100644 --- a/code/sdk/drivers/chips/brandy/porting/include/systick_porting.h +++ b/code/sdk/drivers/chips/brandy/porting/include/systick_porting.h @@ -41,6 +41,21 @@ extern "C" { #define convert_us_2_count(us) ((us) * HAL_SYSTICK_SPEED / (MS_PER_S * US_PER_MS)) #define convert_count_2_us(count) ((count) * (MS_PER_S * US_PER_MS) / HAL_SYSTICK_SPEED) +#ifdef SUPPORT_RC_CALIBRATION +#define OS_SYS_MS_PER_SECOND 1000 +#define OS_SYS_US_PER_MS 1000 + +typedef enum { + SYSTICK_TIME_S = 0, + SYSTICK_TIME_MS = 1, + SYSTICK_TIME_US = 2, + + SYSTICK_TIME_MAX +} systick_time_t; + +uint64_t uapi_systick_get_time(systick_time_t time_type); +#endif + /** * @if Eng * @brief Get the base address of a specified systick. diff --git a/code/sdk/drivers/chips/brandy/porting/security/efuse/efuse_porting.c b/code/sdk/drivers/chips/brandy/porting/security/efuse/efuse_porting.c index 68258bf1e..00c4aaeb2 100644 --- a/code/sdk/drivers/chips/brandy/porting/security/efuse/efuse_porting.c +++ b/code/sdk/drivers/chips/brandy/porting/security/efuse/efuse_porting.c @@ -7,8 +7,8 @@ * 2022-10-20, Create file. \n */ #include "hal_efuse_v100.h" -#include "efuse_porting.h" #include "chip_io.h" +#include "efuse_porting.h" #define FUSE_CTL_RB_BASE 0x57028000 #define FUSE_CTL_MCU_RB_BASE 0x52082000 @@ -103,19 +103,10 @@ uint8_t efuse_port_get_en_switch(void) return get_efuse_en_switch_val(); } -// void efuse_port_set_clk_en(hal_efuse_region_t efuse_region, bool en) -// { - // uint32_t reg_addr[EFUSE_REGION_NUM] = { 0x57000084, 0x52000210, 0x52000210 }; - // uint32_t reg_clk_en_value[EFUSE_REGION_NUM] = { 0x7F08, 0xB, 0xD }; - // if (en) { - // writew(reg_addr[efuse_region], reg_clk_en_value[efuse_region]); - // } -// } - void efuse_port_set_clk_en(hal_efuse_region_t efuse_region, bool en) { unused(en); - switch(efuse_region) { + switch (efuse_region) { case HAL_EFUSE_REGION_1: writew(0x52000210, 0xB); break; @@ -127,7 +118,6 @@ void efuse_port_set_clk_en(hal_efuse_region_t efuse_region, bool en) } } - errcode_t efuse_port_read_buffer_by_reload(uint8_t *buffer, uint32_t byte_number, uint16_t length) { if ((length == 0) || (byte_number >= EFUSE_MAX_BYTES) || diff --git a/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c b/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c index e071e7dca..27ce6ab39 100644 --- a/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c +++ b/code/sdk/drivers/chips/brandy/porting/systick/systick_porting.c @@ -31,4 +31,41 @@ void systick_port_unregister_hal_funcs(void) void systick_port_cali_xclk(void) { writel(0x5702c028, 1); // XO: 32Khz, XCLK -} \ No newline at end of file +} + +#ifdef SUPPORT_RC_CALIBRATION +volatile uint64_t g_pre_systick_count = 0; +volatile uint64_t g_pre_systick_msec = 0; + +uint64_t uapi_systick_get_time(systick_time_t time_type) +{ + volatile uint64_t now_count = 0; + volatile uint64_t ret_time = 0; + volatile uint64_t cost_msec = 0; + + if (g_pre_systick_count == 0) { + g_pre_systick_count = uapi_systick_get_count(); + g_pre_systick_msec = (g_pre_systick_count * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; + } else { + now_count = uapi_systick_get_count(); + cost_msec = ((now_count - g_pre_systick_count) * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ; + + g_pre_systick_count = now_count; + g_pre_systick_msec = g_pre_systick_msec + cost_msec; + } + + switch (time_type) { + case SYSTICK_TIME_S: + ret_time = (uint64_t)(g_pre_systick_msec / OS_SYS_MS_PER_SECOND); + break; + case SYSTICK_TIME_US: + ret_time = (uint64_t)(g_pre_systick_msec * OS_SYS_US_PER_MS); + break; + default: + ret_time = (uint64_t)(g_pre_systick_msec); + break; + } + + return ret_time; +} +#endif \ No newline at end of file diff --git a/code/sdk/drivers/drivers/driver/audio/source/core/common/share_mem/core_msg.c b/code/sdk/drivers/drivers/driver/audio/source/core/common/share_mem/core_msg.c index f0a5ee78f..9de2ac143 100644 --- a/code/sdk/drivers/drivers/driver/audio/source/core/common/share_mem/core_msg.c +++ b/code/sdk/drivers/drivers/driver/audio/source/core/common/share_mem/core_msg.c @@ -280,6 +280,10 @@ static td_s32 msg_fifo_put_pkt(const core_msg_inst *msg_inst, core_msg_module ms msg_size = (td_u32)(sizeof(*msg_head) + sizeof(msg_data->cmd) + sizeof(msg_data->handle)); msg_size += msg_data->input_data_size + msg_data->output_data_size; msg_size = msg_pkt_align_up(msg_size); + if (msg_size > MSG_FIFO_TAIL_SIZE) { + sap_err_log_u32(msg_size); + return ERR_SYS_BUF_OVERFLOW; + } if (ring_buf_linear_query_free(msg_inst->shrb_buf.data_buf) < msg_size) { ring_buf_get_pos(msg_inst->shrb_buf.data_buf, &read_pos, &write_pos); sap_err_log_u32(read_pos); diff --git a/code/sdk/drivers/drivers/driver/audio/source/include/sea_struct.h b/code/sdk/drivers/drivers/driver/audio/source/include/sea_struct.h index 6489c08e5..f443d0b09 100644 --- a/code/sdk/drivers/drivers/driver/audio/source/include/sea_struct.h +++ b/code/sdk/drivers/drivers/driver/audio/source/include/sea_struct.h @@ -26,7 +26,7 @@ extern "C" { #define SEA_LIB_AAI_IND 1 #define SEA_RBUF_MAX_NUM 2 #define SEA_RBUF_DUR_MS 40 -#define SEA_PARAM_SIZE_MAX 1024 +#define SEA_PARAM_SIZE_MAX 512 #define SEA_FRAME_MIN_PER_SEC AUDIO_5MS_NUM_PER_SECOND #define SEA_FRAME_MAX_PER_SEC AUDIO_20MS_NUM_PER_SECOND diff --git a/code/sdk/drivers/drivers/driver/i2c/i2c.c b/code/sdk/drivers/drivers/driver/i2c/i2c.c index 7c3131efc..9d2d65797 100644 --- a/code/sdk/drivers/drivers/driver/i2c/i2c.c +++ b/code/sdk/drivers/drivers/driver/i2c/i2c.c @@ -415,7 +415,7 @@ static errcode_t i2c_transmit_dma(i2c_bus_t bus, hal_i2c_buffer_wrap_t *data_cfg static errcode_t i2c_transmit_read_cmd_by_dma(i2c_bus_t bus, hal_i2c_buffer_wrap_t *data_cfg) { uint8_t dma_ch; - uint16_t read_cmd = 0x100; + static uint16_t read_cmd = 0x100; dma_ch_user_peripheral_config_t user_cfg = {0}; i2c_write_by_dma_config(bus, &read_cmd, data_cfg->len, &user_cfg); diff --git a/code/sdk/drivers/drivers/driver/nand_flash/nand/hal_nandflash.c b/code/sdk/drivers/drivers/driver/nand_flash/nand/hal_nandflash.c index de66021f7..a4570e485 100644 --- a/code/sdk/drivers/drivers/driver/nand_flash/nand/hal_nandflash.c +++ b/code/sdk/drivers/drivers/driver/nand_flash/nand/hal_nandflash.c @@ -90,9 +90,9 @@ uint32_t read_cell_array(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); @@ -122,9 +122,9 @@ uint32_t program_execute(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); @@ -148,9 +148,9 @@ uint32_t block_erase(qspi_data_type_def *qspi_data) nand_qspi_enable(); writel(SER, 0x0); nand_qspi_write_data(qspi_data->instruction); - nand_qspi_write_data(DUMMY_CYCLE_BYTE); - nand_qspi_write_data(qspi_data->data_ptr[0]); - nand_qspi_write_data(qspi_data->data_ptr[1]); + nand_qspi_write_data(qspi_data->data_ptr[1]); /* 1: bit24~bit16 */ + nand_qspi_write_data(qspi_data->data_ptr[2]); /* 2: bit15~bit8 */ + nand_qspi_write_data(qspi_data->data_ptr[3]); /* 3: bit7~bit0 */ writel(SER, SER_SELECT); is_nandflash_working = false; osal_irq_restore(irq_sts); diff --git a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash.c b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash.c index bb8c5d750..d01f8dc1d 100644 --- a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash.c +++ b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash.c @@ -112,15 +112,15 @@ uint32_t mc_flash_read_page(uint32_t nand_page, uint8_t *data, uint32_t data_len { uapi_watchdog_kick(); NFPRINT("mc_flash_read_page nand_page = %d\r\n", nand_page); - uint16_t page_addr; + uint32_t page_addr; errno_t err_code; uint8_t error_cnt = 0; if (nand_page >= (get_nand_flash()->pages_per_block * get_nand_flash()->total_block)) { return MC_FAILURE; } mc_flash_busy_wait(); - page_addr = SWAP_U16(nand_page); - NFPRINT("page addr = %d \r\n", page_addr); + page_addr = SWAP_U32(nand_page); + NFPRINT("page addr = %u \r\n", page_addr); qspi_data_type_def qspi_data = {0}; qspi_data.data_ptr = (uint8_t *)&page_addr; qspi_data.instruction = 0x13; @@ -140,7 +140,7 @@ uint32_t mc_flash_write_page(uint32_t nand_page, uint8_t *data, uint32_t data_le { uapi_watchdog_kick(); uint32_t ret; - uint16_t page_addr; + uint32_t page_addr; uint8_t status_reg; write_cmd(CMD_FLASH_WREN); qspi_data_type_def p_load_qspi_data = {0}; @@ -149,7 +149,7 @@ uint32_t mc_flash_write_page(uint32_t nand_page, uint8_t *data, uint32_t data_le program_load(&p_load_qspi_data, data, data_len, oob, oob_len); qspi_data_type_def e_load_qspi_data = {0}; e_load_qspi_data.instruction = CMD_FLASH_PP_EXE; - page_addr = SWAP_U16(nand_page); + page_addr = SWAP_U32(nand_page); e_load_qspi_data.data_ptr = (uint8_t *)&page_addr; program_execute(&e_load_qspi_data); mc_flash_busy_wait(); @@ -169,9 +169,9 @@ uint32_t mc_flash_erase_block(uint32_t block_no) uapi_watchdog_kick(); NFPRINT("mc_flash_erase_block block_no = %d\r\n", block_no); uint32_t ret; - uint16_t page_addr; + uint32_t page_addr; uint8_t reg_status; - page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); write_cmd(CMD_FLASH_WREN); qspi_data_type_def erase_qspi_data = {0}; erase_qspi_data.data_ptr = (uint8_t *)&page_addr; @@ -202,7 +202,7 @@ uint32_t mc_flash_mark_bad_block(uint32_t block_no) mark_bad_block(&mark); qspi_data_type_def execute = {0}; execute.instruction = CMD_FLASH_PP_EXE; - uint16_t page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + uint32_t page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); execute.data_ptr = (uint8_t *)&page_addr; program_execute(&execute); mc_flash_busy_wait(); @@ -214,7 +214,7 @@ uint32_t mc_flash_check_bad_block(uint32_t block_no) { uapi_watchdog_kick(); uint32_t ret = NOT_BAD_BLOCK; - uint16_t page_addr = SWAP_U16(block_no * get_nand_flash()->pages_per_block); + uint32_t page_addr = SWAP_U32(block_no * get_nand_flash()->pages_per_block); qspi_data_type_def cell_read = {0}; cell_read.data_ptr = (uint8_t *)&page_addr; cell_read.instruction = CMD_FLASH_READ_PAGE; diff --git a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c index 53c138472..dbc64fcf2 100644 --- a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c +++ b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c @@ -54,6 +54,7 @@ uint32_t yf_volume_percent[YF_VOLUMES_NUM] = {100}; static const char * const g_volume_names[YF_VOLUMES_NUM] = { YF_NAME_STRS }; struct mtd_info nandflash_freertos_info; +bool get_exception_status(void); struct nand_driver_struct *get_nand_flash(void) { @@ -105,12 +106,15 @@ static int formate_filesystem(uint32_t total_block_num) return ret; } +/* ʹÓÃÔ¼Êø£ºÖжϺÍÒì³£ÖУ¬½ûÖ¹sync²Ù×÷ */ void nandflash_yaffs_sync(void) { - for (uint8_t index = 0; index < YF_VOLUMES_NUM; index++) { - int32_t ret = yaffs_sync(g_volume_names[index]); - if (ret != 0) { - PRINT("[%d] yaffs_sync fail, ret = %d", index, ret); + if (osal_in_interrupt() != true && get_exception_status() != true) { + for (uint8_t index = 0; index < YF_VOLUMES_NUM; index++) { + int32_t ret = yaffs_sync(g_volume_names[index]); + if (ret != 0) { + PRINT("[%d] yaffs_sync fail, ret = %d", index, ret); + } } } } diff --git a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_qspi.c b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_qspi.c index 1baac32c3..e6694133e 100644 --- a/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_qspi.c +++ b/code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_qspi.c @@ -76,8 +76,11 @@ void qspi_read_width_8(uint8_t *buffer, uint32_t length) return; } while (((readl(SR)) & 0x8) == 0x8) { - buffer[ul_loop] = ((uint8_t)readl(DR)); - ul_loop++; + if (ul_loop < length) { + buffer[ul_loop++] = ((uint8_t)readl(DR)); + } else { + (void)readl(DR); + } ul_recv_timeout = 0; } ul_recv_timeout++; @@ -100,8 +103,11 @@ void qspi_read_width_32(uint32_t *recvbuf, uint32_t length) return; } while (((readl(SR)) & 0x8) == 0x8) { - recvbuf[ul_loop] = ((uint32_t)readl(DR)); - ul_loop++; + if (ul_loop < length) { + recvbuf[ul_loop++] = ((uint32_t)readl(DR)); + } else { + (void)readl(DR); + } ul_recv_timeout = 0; } ul_recv_timeout++; diff --git a/code/sdk/drivers/drivers/driver/qspi_display/qspi_display.c b/code/sdk/drivers/drivers/driver/qspi_display/qspi_display.c index 53aa01b1f..810f7c136 100644 --- a/code/sdk/drivers/drivers/driver/qspi_display/qspi_display.c +++ b/code/sdk/drivers/drivers/driver/qspi_display/qspi_display.c @@ -62,7 +62,7 @@ #define S_MGPIO30_PAD_CTRL (S_MGPIO_PAD_CTRL_BASE + 0x278) #define QSPI_BUS_PRI5 (M_CTL_RB_BASE + 0xA14) -#define QSPI_M1_HIGHEST_PRI 0x33 +#define QSPI_M1_HIGHEST_PRI 0x22 #define QSPI_RESET_LCD_GPIO S_HGPIO0 diff --git a/code/sdk/drivers/drivers/driver/rtc_unified/rtc.c b/code/sdk/drivers/drivers/driver/rtc_unified/rtc.c index 6cc3253d2..f9ffcfc4e 100644 --- a/code/sdk/drivers/drivers/driver/rtc_unified/rtc.c +++ b/code/sdk/drivers/drivers/driver/rtc_unified/rtc.c @@ -41,6 +41,9 @@ #endif #endif +#define RTCS_TRIES_MAX 2000 +#define RTCS_LOAD_WAIT 120 + typedef enum rtc_flag { RTC_FLAG_NORMAL, RTC_FLAG_PERMANENT @@ -137,6 +140,8 @@ STATIC void rtc_load_cycle_with_mask(rtc_index_t index, uint64_t cycle_with_mask unused(cycle_deviation); #endif g_hal_rtc_func[index]->config_load(index, cycle_with_mask); + /* loadÍêºó£¬ÐèÒªµÈ´ý120us */ + uapi_tcxo_delay_us(RTCS_LOAD_WAIT); } /* Reduces the rtc left for all the rtcs by rtc us amount */ @@ -214,7 +219,16 @@ STATIC uint32_t rtc_get_next_rtc(rtc_index_t index) */ STATIC uint64_t rtc_get_rtc_till_interrupt(rtc_index_t index) { - uint64_t current_value = g_hal_rtc_func[index]->get_current_count(index); + uint64_t current_value = 0; + uint32_t tries = 0; + do { + current_value = g_hal_rtc_func[index]->get_current_count(index); + if (tries > RTCS_TRIES_MAX) { + break; + } + tries++; + } while (current_value >= g_rtcs_manager[index].last_rtc_load_cycle && + g_rtcs_manager[index].last_rtc_load_cycle != 0); if (current_value != 0) { return current_value; } diff --git a/code/sdk/drivers/drivers/driver/systick/systick.c b/code/sdk/drivers/drivers/driver/systick/systick.c index 5548821d2..5dd0ba0c9 100644 --- a/code/sdk/drivers/drivers/driver/systick/systick.c +++ b/code/sdk/drivers/drivers/driver/systick/systick.c @@ -82,17 +82,29 @@ uint64_t uapi_systick_get_count(void) uint64_t uapi_systick_get_s(void) { +#ifdef SUPPORT_RC_CALIBRATION + return uapi_systick_get_time(SYSTICK_TIME_S); +#else return convert_count_2_s(uapi_systick_get_count()); +#endif } uint64_t uapi_systick_get_ms(void) { +#ifdef SUPPORT_RC_CALIBRATION + return uapi_systick_get_time(SYSTICK_TIME_MS); +#else return convert_count_2_ms(uapi_systick_get_count()); +#endif } uint64_t uapi_systick_get_us(void) { +#ifdef SUPPORT_RC_CALIBRATION + return uapi_systick_get_time(SYSTICK_TIME_US); +#else return convert_count_2_us(uapi_systick_get_count()); +#endif } errcode_t uapi_systick_delay_count(uint64_t c_delay) diff --git a/code/sdk/drivers/drivers/driver/touch/tma525b_touch/tma525b_ctrl.c b/code/sdk/drivers/drivers/driver/touch/tma525b_touch/tma525b_ctrl.c index 6d36fb15e..ec0bb9af2 100644 --- a/code/sdk/drivers/drivers/driver/touch/tma525b_touch/tma525b_ctrl.c +++ b/code/sdk/drivers/drivers/driver/touch/tma525b_touch/tma525b_ctrl.c @@ -23,6 +23,8 @@ bool g_host_dev_init_flag = TD_FALSE; tma525b_ctrl_attr g_ctrl_attr; touch_callback g_tma525b_callback = NULL; +static uint8_t g_tp_send_buf[TMA525B_REG_WRITE_LEN] = {0}; +static uint8_t g_tp_recv_buf[TMA525B_INPUT_SIZE] = {0}; static void tma525b_gpio_isr_handle(pin_t pin, uintptr_t param) { @@ -103,7 +105,6 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l errcode_t ret; uint8_t retry; i2c_data_t data; - uint8_t tp_reg_addr[TMA525B_REG_BYTE_LEN]; ret = tp_i2c_rd_wr_param_check(data_buf, data_len); if (ret != EXT_ERR_SUCCESS) { @@ -111,15 +112,17 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l return ret; } - memset_s(data_buf, data_len, 0, data_len); - tp_reg_addr[TMA525B_I2C_SEND_INDEX0] = reg_addr & 0xff; - tp_reg_addr[TMA525B_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; + if (memset_s(g_tp_recv_buf, data_len, 0, data_len) != EOK) { + tp_err("tp read buff set fail! ret=0x%x", ret); + return EXT_ERR_FAILURE; + } + g_tp_send_buf[TMA525B_I2C_SEND_INDEX0] = reg_addr & 0xff; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; - data.send_buf = tp_reg_addr; + data.send_buf = g_tp_send_buf; data.send_len = TMA525B_CMD_SEND_LEN; - data.receive_buf = data_buf; + data.receive_buf = g_tp_recv_buf; data.receive_len = data_len; - for (retry = 0; retry < TMA525B_I2C_TIME_MAX; retry++) { ret = uapi_i2c_master_read(TMA525B_I2C_BUS, TMA525B_I2C_ADDR, &data); if (ret == ERRCODE_SUCC) { @@ -131,6 +134,12 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l return ret; } + ret = (uint32_t)memcpy_s(data_buf, data_len, g_tp_recv_buf, data_len); + if (ret != EOK) { + tp_err("tp data buf content copy fail! ret=0x%x", ret); + return ret; + } + return EXT_ERR_SUCCESS; } @@ -139,17 +148,16 @@ ext_errno tp_i2c_cmd_write(uint16_t cmd) errcode_t ret; uint8_t retry; i2c_data_t data; - uint8_t tp_reg_addr[TMA525B_CMD_SEND_LEN]; ret = tp_peripheral_init_status_check(); if (ret != EXT_ERR_SUCCESS) { tp_err("host peripheral not init! ret=0x%x", ret); return ret; } - tp_reg_addr[TMA525B_I2C_SEND_INDEX0] = cmd & 0xff; - tp_reg_addr[TMA525B_I2C_SEND_INDEX1] = (cmd >> OFFSET_8_BITS) & 0xff; - data.send_buf = tp_reg_addr; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX0] = cmd & 0xff; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX1] = (cmd >> OFFSET_8_BITS) & 0xff; + data.send_buf = g_tp_send_buf; data.send_len = TMA525B_CMD_SEND_LEN; data.receive_buf = NULL; data.receive_len = 0; @@ -172,7 +180,6 @@ ext_errno tp_i2c_reg_write(uint16_t reg_addr, uint16_t reg_cfg) errcode_t ret; uint8_t retry; i2c_data_t data; - uint8_t tp_reg_addr[TMA525B_REG_WRITE_LEN]; ret = tp_peripheral_init_status_check(); if (ret != EXT_ERR_SUCCESS) { @@ -180,12 +187,11 @@ ext_errno tp_i2c_reg_write(uint16_t reg_addr, uint16_t reg_cfg) return ret; } - tp_reg_addr[TMA525B_I2C_SEND_INDEX0] = reg_addr & 0xff; - tp_reg_addr[TMA525B_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; - tp_reg_addr[TMA525B_I2C_SEND_INDEX2] = reg_cfg & 0xff; - tp_reg_addr[TMA525B_I2C_SEND_INDEX3] = (reg_cfg >> OFFSET_8_BITS) & 0xff; - - data.send_buf = tp_reg_addr; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX0] = reg_addr & 0xff; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX2] = reg_cfg & 0xff; + g_tp_send_buf[TMA525B_I2C_SEND_INDEX3] = (reg_cfg >> OFFSET_8_BITS) & 0xff; + data.send_buf = g_tp_send_buf; data.send_len = TMA525B_REG_WRITE_LEN; data.receive_buf = NULL; data.receive_len = 0; @@ -231,6 +237,7 @@ ext_errno tp_i2c_data_write(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_ ret = (uint32_t)memcpy_s(write_data + sizeof(uint16_t), send_len - sizeof(uint16_t), data_buf, data_len); if (ret != EOK) { tp_err("tp send_buf content copy fail! ret=0x%x", ret); + osal_kfree(write_data); return ret; } @@ -247,10 +254,11 @@ ext_errno tp_i2c_data_write(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_ } if (ret != ERRCODE_SUCC) { tp_err("tp data write fail! ret=0x%x", ret); + osal_kfree(write_data); return ret; } - tp_mem_free(write_data); + osal_kfree(write_data); return EXT_ERR_SUCCESS; } diff --git a/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.c b/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.c index ec85d227c..927a5d756 100644 --- a/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.c +++ b/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.c @@ -23,6 +23,8 @@ bool g_host_dev_init_flag = TD_FALSE; ztw523_ctrl_attr g_ctrl_attr; touch_callback g_ztw523_callback = NULL; +static uint8_t g_tp_send_buf[ZTW523_REG_WRITE_LEN] = {0}; +static uint8_t g_tp_recv_buf[ZTW523_INPUT_SIZE] = {0}; static void ztw523_gpio_isr_handle(pin_t pin, uintptr_t param) { @@ -96,7 +98,6 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l errcode_t ret; uint32_t retry; i2c_data_t data; - uint8_t tp_reg_addr[ZTW523_REG_BYTE_LEN]; ret = tp_i2c_rd_wr_param_check(data_buf, data_len); if (ret != 0) { @@ -104,15 +105,17 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l return ret; } - memset_s(data_buf, data_len, 0, data_len); - tp_reg_addr[ZTW523_I2C_SEND_INDEX0] = reg_addr & 0xff; - tp_reg_addr[ZTW523_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; + if (memset_s(g_tp_recv_buf, data_len, 0, data_len) != EOK) { + tp_err("tp read buff set fail! ret=0x%x", ret); + return EXT_ERR_FAILURE; + } + g_tp_send_buf[ZTW523_I2C_SEND_INDEX0] = reg_addr & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; - data.send_buf = tp_reg_addr; + data.send_buf = g_tp_send_buf; data.send_len = ZTW523_CMD_SEND_LEN; - data.receive_buf = data_buf; + data.receive_buf = g_tp_recv_buf; data.receive_len = data_len; - for (retry = 0; retry < ZTW523_I2C_TIME_MAX; retry++) { ret = uapi_i2c_master_writeread(ZTW523_I2C_BUS, ZTW523_I2C_ADDR, &data); if (ret == EXT_ERR_SUCCESS) { @@ -124,6 +127,12 @@ ext_errno tp_i2c_data_read(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_l return ret; } + ret = (uint32_t)memcpy_s(data_buf, data_len, g_tp_recv_buf, data_len); + if (ret != EOK) { + tp_err("tp data buf content copy fail! ret=0x%x", ret); + return ret; + } + return EXT_ERR_SUCCESS; } @@ -132,17 +141,16 @@ ext_errno tp_i2c_cmd_write(uint16_t cmd) errcode_t ret; uint32_t retry; i2c_data_t data; - uint8_t tp_reg_addr[ZTW523_CMD_SEND_LEN]; ret = tp_peripheral_init_status_check(); if (ret != 0) { tp_err("host peripheral not init! ret=0x%x", ret); return ret; } - tp_reg_addr[ZTW523_I2C_SEND_INDEX0] = cmd & 0xff; - tp_reg_addr[ZTW523_I2C_SEND_INDEX1] = (cmd >> OFFSET_8_BITS) & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX0] = cmd & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX1] = (cmd >> OFFSET_8_BITS) & 0xff; - data.send_buf = tp_reg_addr; + data.send_buf = g_tp_send_buf; data.send_len = ZTW523_CMD_SEND_LEN; data.receive_buf = NULL; data.receive_len = 0; @@ -166,7 +174,6 @@ ext_errno tp_i2c_reg_write(uint16_t reg_addr, uint16_t reg_cfg) errcode_t ret; uint32_t retry; i2c_data_t data; - uint8_t tp_reg_addr[ZTW523_REG_WRITE_LEN]; ret = tp_peripheral_init_status_check(); if (ret != 0) { @@ -174,12 +181,12 @@ ext_errno tp_i2c_reg_write(uint16_t reg_addr, uint16_t reg_cfg) return ret; } - tp_reg_addr[ZTW523_I2C_SEND_INDEX0] = reg_addr & 0xff; - tp_reg_addr[ZTW523_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; - tp_reg_addr[ZTW523_I2C_SEND_INDEX2] = reg_cfg & 0xff; - tp_reg_addr[ZTW523_I2C_SEND_INDEX3] = (reg_cfg >> OFFSET_8_BITS) & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX0] = reg_addr & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX1] = (reg_addr >> OFFSET_8_BITS) & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX2] = reg_cfg & 0xff; + g_tp_send_buf[ZTW523_I2C_SEND_INDEX3] = (reg_cfg >> OFFSET_8_BITS) & 0xff; - data.send_buf = tp_reg_addr; + data.send_buf = g_tp_send_buf; data.send_len = ZTW523_REG_WRITE_LEN; data.receive_buf = NULL; data.receive_len = 0; @@ -225,6 +232,7 @@ ext_errno tp_i2c_data_write(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_ ret = (uint32_t)memcpy_s(write_data + sizeof(uint16_t), send_len - sizeof(uint16_t), data_buf, data_len); if (ret != EOK) { tp_err("tp send_buf content copy fail! ret=0x%x", ret); + osal_kfree(write_data); return ret; } @@ -241,10 +249,11 @@ ext_errno tp_i2c_data_write(uint16_t reg_addr, uint8_t *data_buf, uint32_t data_ } if (ret != EXT_ERR_SUCCESS) { tp_err("tp data write fail! ret=0x%x", ret); + osal_kfree(write_data); return ret; } - tp_mem_free(write_data); + osal_kfree(write_data); return EXT_ERR_SUCCESS; } diff --git a/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.h b/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.h index 55e014b73..9438a362b 100644 --- a/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.h +++ b/code/sdk/drivers/drivers/driver/touch/ztw523_touch/ztw523_ctrl.h @@ -25,7 +25,7 @@ #define ZTW523_CMD_SEND_LEN 2 #define ZTW523_REG_DATA_LEN 2 #define ZTW523_I2C_TIME_MAX 3 - +#define ZTW523_INPUT_SIZE 156 #define ZTW523_I2C_SEND_INDEX0 0 #define ZTW523_I2C_SEND_INDEX1 1 #define ZTW523_I2C_SEND_INDEX2 2 diff --git a/code/sdk/drivers/drivers/hal/ipc/hal_ipc_old/hal_ipc.h b/code/sdk/drivers/drivers/hal/ipc/hal_ipc_old/hal_ipc.h index 03a375877..d1034d474 100644 --- a/code/sdk/drivers/drivers/hal/ipc/hal_ipc_old/hal_ipc.h +++ b/code/sdk/drivers/drivers/hal/ipc/hal_ipc_old/hal_ipc.h @@ -25,8 +25,13 @@ #define MCPU_SOFT_INT_STS (*(volatile unsigned short *)(0x52000028)) #define MCPU_SOFT_INT_CLR_STS (*(volatile unsigned short *)(0x52000030)) #define M_TO_DSP_INT_OFFSET BIT(2) +#define M_TO_DSP_INT1_OFFSET BIT(3) #define M_TO_DSP_1_INT_OFFSET BIT(4) +#if CHIP_SOCMN1 #define M_TO_ALL_INT (M_TO_BCPU_INT_OFFSET | M_TO_DSP_INT_OFFSET | M_TO_DSP_1_INT_OFFSET) +#elif CHIP_BRANDY +#define M_TO_ALL_INT (M_TO_BCPU_INT_OFFSET | M_TO_DSP_INT_OFFSET | M_TO_DSP_INT1_OFFSET) +#endif #elif CHIP_LIBRA #define MCPU_SOFT_INT_EN (*(volatile unsigned short *)(0x52000020)) #define MCPU_SOFT_INT_SET (*(volatile unsigned short *)(0x52000034)) diff --git a/code/sdk/drivers/drivers/hal/security/efuse/v100/hal_efuse_v100.c b/code/sdk/drivers/drivers/hal/security/efuse/v100/hal_efuse_v100.c index 47d5669da..25dfcdfb7 100644 --- a/code/sdk/drivers/drivers/hal/security/efuse/v100/hal_efuse_v100.c +++ b/code/sdk/drivers/drivers/hal/security/efuse/v100/hal_efuse_v100.c @@ -67,17 +67,11 @@ static errcode_t hal_efuse_v100_init(void) if (hal_efuse_v100_regs_init() != 0) { return ERRCODE_EFUSE_REG_ADDR_INVALID; } - - for (uint32_t i = HAL_EFUSE_REGION_1; i < HAL_EFUSE_REGION_MAX; i++) { - if (hal_efuse_v100_refresh_read((hal_efuse_region_t)i) != 0) { - return ERRCODE_FAIL; - } + if (hal_efuse_v100_refresh_read(HAL_EFUSE_REGION_1) != 0) { + return ERRCODE_FAIL; } - #ifdef CONFIG_EFUSE_READ_TO_RAM - for (uint32_t i = HAL_EFUSE_REGION_1; i < HAL_EFUSE_REGION_MAX; i++) { - hal_efuse_v100_read_val_to_ram((hal_efuse_region_t)i); - } + hal_efuse_v100_read_val_to_ram(HAL_EFUSE_REGION_1); #endif return ERRCODE_SUCC; } diff --git a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a new file mode 100644 index 000000000..b899ff06f Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a differ diff --git a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a new file mode 100644 index 000000000..ca94c4c0b Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a differ diff --git a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a new file mode 100644 index 000000000..d5fda7d52 Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a differ diff --git a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a new file mode 100644 index 000000000..0b454273c Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a differ diff --git a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a new file mode 100644 index 000000000..99013258e Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a differ diff --git a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a new file mode 100644 index 000000000..f8ed54354 Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a differ diff --git a/code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a b/code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a new file mode 100644 index 000000000..4d47844c7 Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a differ diff --git a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a new file mode 100644 index 000000000..4bed39765 Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a differ diff --git a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a new file mode 100644 index 000000000..d428c232f Binary files /dev/null and b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a differ diff --git a/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h index 7df400f93..88b93444f 100644 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_app.h @@ -16,6 +16,7 @@ typedef enum { NATIVEABILITY_CPP, NATIVELAUNCHER_CPP, MAINVIEW_CPP, + MAINMODEL_CPP, ACTIVITYMODEL_CPP, ACTIVITYPRESENTER_CPP, ACTIVITYWEEKVIEW_CPP, @@ -195,6 +196,24 @@ typedef enum { SMART_VOICE_SERVICE_C, VOICE_ENGINE_HAL_C, OHOSFWK_AT_PROCESS_CPP, + SETCARDADAPTER_CPP, + SETCARDITEM_CPP, + SETCARDDELETEVIEW_CPP, + SETCARDVIEW_CPP, + SETCARDNOCARDVIEW_CPP, + SETCARDPRESENTER_CPP, + SETCARDMODEL_CPP, + ADDCARDPRESENTER_CPP, + ADDCARDADAPTER_CPP, + ADDCARDVIEW_CPP, + ADDCARDMODEL_CPP, + ADDCARDITEM_CPP, + SETDIALVIEW_CPP, + SETDIALMODEL_CPP, + SETDIALPRESENTER_CPP, + SETDESKTOPMODEL_CPP, + SETDESKTOPVIEW_CPP, + SETDESKTOPPRESENTER_CPP, APP_FILE_ID_MAX = 1024, } log_file_list_enum_app_t; diff --git a/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h index 0886e8c41..fd6ffc461 100644 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_gui.h @@ -419,6 +419,16 @@ typedef enum { UI_MENU_ITEM_CPP, UI_BARCODE_CPP, SCREENMODEL_CPP, + UI_HEXAGONS_LIST_CPP, + UI_CUSTOM_HEXAGONS_LIST_CPP, + UI_TEST_HEXAGONS_LIST_CPP, + UI_KALEIDOSCOPE_VIEW_CPP, + KALEIDOSCOPE_UTILS_CPP, + UI_COVERFLOW_VIEW_CPP, + UI_MAP_VIEW_CPP, + MAP_SVG_PARSER_CPP, + SLICETRANSITION_CPP, + TRANSITIONMANAGER_CPP, FILE_ID_MAX = 1024, } log_file_list_enum_gui_t; #endif diff --git a/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h b/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h index 2069373e8..bda3e3838 100644 --- a/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h +++ b/code/sdk/middleware/chips/brandy/dfx/include/log_def_ohos.h @@ -52,6 +52,8 @@ typedef enum { JS_ASYNC_WORK_CPP, MESSAGE_QUEUE_UTILS_CPP, ACE_LOG_CPP, + BAIDUMAP_CPP, + DISPLAY_CPP, ACE_MEM_BASE_CPP, ASYNC_TASK_MANAGER_CPP, // CACHE_MANAGER_CPP, @@ -168,6 +170,7 @@ typedef enum { APP_PROVISION_C, APP_VERIFY_C, MBEDTLS_PKCS7_C, + BAIDU_MAP_COMPONENT_CPP, } log_file_list_enum_ohos_e; #endif /* LOG_DEF_OHOS_H */ diff --git a/code/sdk/middleware/chips/brandy/exception/exception.h b/code/sdk/middleware/chips/brandy/exception/exception.h index ede22b684..77b5f48fd 100644 --- a/code/sdk/middleware/chips/brandy/exception/exception.h +++ b/code/sdk/middleware/chips/brandy/exception/exception.h @@ -519,6 +519,7 @@ errcode_t emmc_exc_info_write(void); #endif #endif void reset_deal_with_fs(void); +bool get_exception_status(void); /** * @} */ diff --git a/code/sdk/middleware/chips/brandy/exception/exception_riscv.c b/code/sdk/middleware/chips/brandy/exception/exception_riscv.c index 5d9652d52..d618a8a9c 100644 --- a/code/sdk/middleware/chips/brandy/exception/exception_riscv.c +++ b/code/sdk/middleware/chips/brandy/exception/exception_riscv.c @@ -114,7 +114,7 @@ exc_info_t g_exc_info; static exc_nmi_stat_t g_exc_nmi_store; // Check whether the exception is repeated #if (CORE == MASTER_BY_ALL) && (CORE != WIFI) -static bool g_is_repeat_exc = false; +bool g_is_repeat_exc = false; #endif #if defined SAVE_EXC_INFO /* ifdef LOSCFG_EXC_SIMPLE_INFO g_xregs_map start from X4(instead of X0) to X31 */ @@ -143,6 +143,12 @@ static volatile uint32_t g_bt_nmi_mask = 0; #define PM_MCU_SEND_IPC_WKUP_BT_REG 0x52000034 #define PM_MCU_SEND_IPC_WKUP_BT_BIT 0x1 #endif + +bool get_exception_status(void) +{ + return g_is_repeat_exc; +} + #if ((defined(BUILD_APPLICATION_STANDARD)) && (IS_MAIN_CORE == NO)) #include "ipc.h" @@ -953,7 +959,6 @@ void do_hard_fault_handler(exc_context_t *exc_buf_addr) cpu_utils_set_system_status_by_cause(reset_cause); #endif #endif - disable_watchdog(); hal_save_reg_info(exc_buf_addr); deal_with_exception(exc_buf_addr, exc_type, reset_cause); } @@ -998,6 +1003,8 @@ static void deal_with_exception(exc_context_t *exc_buf_addr, uint32_t exc_type, #ifndef BUILD_APPLICATION_SSB reset_deal_with_fs(); #endif + /* 关狗操作一定要在reset之前 */ + disable_watchdog(); #if (CORE == MASTER_BY_ALL) && (CORE != WIFI) cpu_utils_reset_chip_with_log((cores_t)MASTER_BY_ALL, reset_cause); #endif diff --git a/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/acore/app.json b/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/acore/app.json index 38006070c..e71b83266 100644 --- a/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/acore/app.json +++ b/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/acore/app.json @@ -69,12 +69,12 @@ "key_status": "alive", "structure_type": "audio_vqe_param_t", "attributions": 1, - "value": [48, [0, 0, 0, 0, 16843009, 33554689, 16000, 16000, - 1024, 100, 1985229328, 1985229328, 16843009, 257, 257, 256, - 16778116, 1280, 4, 0, 458824, 11796580, 327946, 196608005, - 65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, - 654734439, 1, 0, 0, 0, 0, 0, 10551292, 655336, 4286447619, 64536, - 500, 16384, 3277, 0, 66049, 0]] + "value": [48, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000, + 1024, 100, 0, 0, 16842753, 257, 257, 256, + 16778116, 16844032, 4, 0, 458824, 11796580, 327946, 1310720005, + 65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, 654734439, + 1, 0, 0, 0, 0, 0, 5308380, 655336, + 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0]] }, "audio_vqe_kws_param":{ "key_id": "0x320D", diff --git a/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h b/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h index ae3dd857d..83382192b 100644 --- a/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h +++ b/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h @@ -39,6 +39,7 @@ typedef enum { PM_ID_STORAGE, PM_ID_TOUCH, PM_ID_JPEG, + PM_ID_JS, PM_ID_MAX, } pm_id_t; diff --git a/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c b/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c index 2948a64cb..fffa3d341 100644 --- a/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c +++ b/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c @@ -128,6 +128,8 @@ void pm_core_suspend(void) g_frs_sleep_flag = 0; } display_suspend_power_off(); + hal_pmu1_dig_pg_l2m_gmmu_ret1_en(true); // The GMMU memory is set to the retention state. + hal_pmu1_dig_pg_l2m_gmmu_pwr_en(false); #endif storage_device_suspend(); opi_psram_suspend_tmp(); @@ -256,6 +258,8 @@ void pm_core_resume(void) uapi_dma_open(); storage_device_resume(); #if defined(ENABLE_UIKIT) || defined(ENABLE_LVGL) + hal_pmu1_dig_pg_l2m_gmmu_pwr_en(true); // The GMMU memory is set to the normal state. + hal_pmu1_dig_pg_l2m_gmmu_ret1_en(false); if (lcd_get_status() != 0) { display_resume_tmp(); } diff --git a/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_lp_stub.c b/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_lp_stub.c index e54d5438a..e0af7a89f 100644 --- a/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_lp_stub.c +++ b/code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_lp_stub.c @@ -48,9 +48,6 @@ #define PLL_CLK_VALUE 884736000 #define PM_SDIOM_CLK_REG 0x55000628 #define PM_EMMC_DIV_REG 0x52000120 -#define PM_DISPLAY_LOGIC_CRG_RESET 0x570000c0 -#define PM_DISPLAY_PWR_EN_CFG 0x57004034 -#define PM_DISPLAY_PWR_CLOSE_POWER 0x100 static uint32_t g_uart_h0_regs_tmp[UART_SUSPEND_REGS_NUM]; static uint32_t g_uart_h1_regs_tmp[UART_SUSPEND_REGS_NUM]; @@ -353,8 +350,6 @@ void display_suspend_tmp(void) pmu_ldo_power_on(PMU_LDO_AUXLDO3, TURN_OFF); hal_pmu_auxldo_enable_high_resistance(HAL_PMU_AUXLDO3, TURN_ON); #endif - writew(PM_DISPLAY_LOGIC_CRG_RESET, 0x0); // display logic crg reset - writew(PM_DISPLAY_PWR_EN_CFG, PM_DISPLAY_PWR_CLOSE_POWER); // display close power } void display_resume_tmp(void) diff --git a/code/sdk/middleware/services/gpu/api/jpeg/src/soc_jpeg_api.c b/code/sdk/middleware/services/gpu/api/jpeg/src/soc_jpeg_api.c index 5c1a5f393..a3a6a43a3 100644 --- a/code/sdk/middleware/services/gpu/api/jpeg/src/soc_jpeg_api.c +++ b/code/sdk/middleware/services/gpu/api/jpeg/src/soc_jpeg_api.c @@ -79,7 +79,7 @@ td_s32 uapi_jpeg_decomress_create(jpeg_decompress_ptr dinfo, jpeg_source_ptr src } jpeg_config_dinfo(dinfo, par); - + ret = jpeg_ioctl(par->dev_fd, DRV_JPEG_CMD_CREATE, TD_NULL); if (ret != EXT_SUCCESS) { jpeg_err("call ioctl create failure"); @@ -435,16 +435,15 @@ td_void uapi_jpeg_decompress_destroy(jpeg_decompress_ptr dinfo) jpeg_exif_deinit(par); - mem.vir_buf = (td_char *)dinfo->private_data; - jpeg_mem_free_small(&mem); - - dinfo->private_data = TD_NULL; - td_s32 ret = jpeg_ioctl(par->dev_fd, DRV_JPEG_CMD_DESTROY, TD_NULL); if (ret != EXT_SUCCESS) { jpeg_err("call ioctl destroy failure"); - return; } + mem.vir_buf = (td_char *)dinfo->private_data; + jpeg_mem_free_small(&mem); + + dinfo->private_data = TD_NULL; + return; } diff --git a/code/sdk/middleware/services/gpu/api/vau/draw/vau_draw.c b/code/sdk/middleware/services/gpu/api/vau/draw/vau_draw.c index 4185740d4..4f3fb54d6 100644 --- a/code/sdk/middleware/services/gpu/api/vau/draw/vau_draw.c +++ b/code/sdk/middleware/services/gpu/api/vau/draw/vau_draw.c @@ -184,6 +184,11 @@ static td_s32 vau_draw_make_path(const ext_vau_path *path, vau_hardware_node *no vau_err("path should start width move to abs, now:%u", path->cmds[0]); return EXT_ERR_GFX_INVALID_PARAM; } + if (uapi_is_byte_align((td_u32)(uintptr_t)path->datas, 4) != TD_TRUE) { // need 4 byte align + vau_err("path data addr align err"); + return EXT_ERR_GFX_INVALID_ADDR; + } + td_bool is_internal_buff = vau_mem_is_internal(VAU_MEM_TYPE_PATH_CMD, path->cmds); if (is_internal_buff == TD_TRUE) { vau_mem_ref_inc(VAU_MEM_TYPE_PATH_CMD, path->cmds); diff --git a/code/sdk/middleware/services/gpu/drv/dpu/intf/drv_dpu_intf.c b/code/sdk/middleware/services/gpu/drv/dpu/intf/drv_dpu_intf.c index f2991bfe9..910a65103 100644 --- a/code/sdk/middleware/services/gpu/drv/dpu/intf/drv_dpu_intf.c +++ b/code/sdk/middleware/services/gpu/drv/dpu/intf/drv_dpu_intf.c @@ -14,6 +14,7 @@ #include "dpu_qspi.h" static td_bool g_is_qspi = TD_FALSE; +static td_bool g_dpu_suspend_flag = TD_FALSE; #define DRV_DPU_IOCTL_CMD_NUM 20 @@ -45,6 +46,7 @@ td_s32 drv_dpu_suspend(td_void *private_data) dpu_dbg("dpu suspend start"); dpu_hal_deinit(); dpu_layer_suspend(); + g_dpu_suspend_flag = TD_TRUE; dpu_dbg("dpu suspend ok"); return EXT_SUCCESS; @@ -65,6 +67,7 @@ td_s32 drv_dpu_resume(td_void *private_data) dpu_hal_init(); dpu_layer_resume(); dpu_disp_chl_cfg(); + g_dpu_suspend_flag = TD_FALSE; dpu_dbg("dpu resume ok"); return EXT_SUCCESS; @@ -137,6 +140,11 @@ td_s32 dpu_ioctl(td_s32 module_idx, td_ulong ioctl_cmd, td_void *para) return EXT_FAILURE; } + if (g_dpu_suspend_flag == TD_TRUE) { + dpu_err("dpu is in suspend state!, suspend_flag = %u", g_dpu_suspend_flag); + return EXT_FAILURE; + } + if (g_is_qspi == TD_TRUE) { return dpu_qspi_ioctl(ioctl_cmd, para); } diff --git a/code/sdk/middleware/services/gpu/drv/dpu/layer/dpu_layer.c b/code/sdk/middleware/services/gpu/drv/dpu/layer/dpu_layer.c index f94c87b2c..b02f22877 100644 --- a/code/sdk/middleware/services/gpu/drv/dpu/layer/dpu_layer.c +++ b/code/sdk/middleware/services/gpu/drv/dpu/layer/dpu_layer.c @@ -91,8 +91,6 @@ static td_void dpu_layer_set_run_info(dpu_layer_run_info *run_info, const drv_dp run_info->global_alpha = 0xFF; run_info->width = layer_info->width; run_info->height = layer_info->height; - run_info->stride = 0; - run_info->current_addr = 0; run_info->fmt = layer_info->layer_fmt; run_info->premulti_en = 0; run_info->compress_mode = layer_info->compress_mode; @@ -180,6 +178,16 @@ static td_void dpu_layer_yuv_base_config(dpu_layer_dev *layer_dev) yuv_info.uv_stride = layer_dev->canvas_surface.uv_stride; yuv_info.uv_offset = layer_dev->canvas_surface.uv_offset; + /* soft support yuv crop */ + if (layer_dev->run_info.crop_rect.y != 0) { + yuv_info.y_addr += (td_u32)layer_dev->run_info.crop_rect.y * yuv_info.uv_stride; + yuv_info.uv_offset -= (td_u32)layer_dev->run_info.crop_rect.y * yuv_info.uv_stride / 2; /* 2:index */ + + layer_dev->run_info.crop_rect.y = 0; + dpu_hal_layer_set_crop_rect(layer_dev->layer_id, &layer_dev->run_info.crop_rect); + } + + dpu_hal_layer_set_addr(layer_dev->layer_id, yuv_info.y_addr); dpu_hal_layer_set_yuv_base_info(layer_dev->layer_id, &yuv_info); return; @@ -283,17 +291,14 @@ static td_void dpu_layer_calculate_gp_region(ext_rect *gp_region) td_s32 start_y = (td_s32)screen_height; for (td_u32 layer_id = 0; layer_id <= (td_u32)DRV_DPU_MAX_LAYER_ID; layer_id++) { - if (g_dpu_layer_dev[layer_id] == TD_NULL) { - continue; - } - - if (g_dpu_layer_dev[layer_id]->is_create != TD_TRUE) { + if ((g_dpu_layer_dev[layer_id] == TD_NULL) || (g_dpu_layer_dev[layer_id]->is_create != TD_TRUE)) { continue; } dpu_layer_run_info *run_info = &g_dpu_layer_dev[layer_id]->run_info; - /* if exists full screen layer, gp_reion is full */ - if ((run_info->update_region.width == screen_width) && (run_info->update_region.height == screen_height)) { + /* if exists full screen layer or g1, gp_reion is full */ + if (((run_info->update_region.width == screen_width) && (run_info->update_region.height == screen_height)) || + (layer_id == DRV_DPU_LAYER_ID2)) { gp_region->x = 0; gp_region->y = 0; gp_region->width = screen_width; diff --git a/code/sdk/middleware/services/gpu/drv/gmmu/intf/drv_gmmu_intf.c b/code/sdk/middleware/services/gpu/drv/gmmu/intf/drv_gmmu_intf.c index 408234f56..f5a72e786 100644 --- a/code/sdk/middleware/services/gpu/drv/gmmu/intf/drv_gmmu_intf.c +++ b/code/sdk/middleware/services/gpu/drv/gmmu/intf/drv_gmmu_intf.c @@ -119,6 +119,11 @@ td_s32 gmmu_ioctl(td_s32 module_idx, td_ulong ioctl_cmd, td_void *para) return EXT_FAILURE; } + if (g_gmmu_suspend_flag == TD_TRUE) { + gmmu_err("gmmu is in suspend state!, suspend_flag = %u", g_gmmu_suspend_flag); + return EXT_FAILURE; + } + if ((ioctl_cmd == DRV_GMMU_CMD_CONFIG) && (para != TD_NULL)) { g_gmmu_suspend_mgr = *(drv_gmmu_mgr *)para; } diff --git a/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.c b/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.c index 848bd8c03..2ba04ef1e 100644 --- a/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.c +++ b/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.c @@ -80,16 +80,14 @@ td_s32 jpeg_dev_close(td_void) return EXT_SUCCESS; } -td_s32 jpeg_suspend(td_void) +td_void jpeg_suspend(td_void) { jpeg_clock_reset(); jpeg_clock_close(); - return EXT_SUCCESS; } -td_s32 jpeg_resume(td_void) +td_void jpeg_resume(td_void) { jpeg_clock_open(); jpeg_clock_dereset(); - return EXT_SUCCESS; } diff --git a/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.h b/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.h index 80db2550e..e0f6adb87 100644 --- a/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.h +++ b/code/sdk/middleware/services/gpu/drv/jpeg/dev/jpeg_dev.h @@ -22,8 +22,8 @@ extern "C" { td_s32 jpeg_dev_open(td_void); td_s32 jpeg_dev_close(td_void); -td_s32 jpeg_suspend(td_void); -td_s32 jpeg_resume(td_void); +td_void jpeg_suspend(td_void); +td_void jpeg_resume(td_void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/middleware/services/gpu/drv/jpeg/intf/drv_jpeg_intf.c b/code/sdk/middleware/services/gpu/drv/jpeg/intf/drv_jpeg_intf.c index 00d4ca805..a3f8e7a6b 100644 --- a/code/sdk/middleware/services/gpu/drv/jpeg/intf/drv_jpeg_intf.c +++ b/code/sdk/middleware/services/gpu/drv/jpeg/intf/drv_jpeg_intf.c @@ -17,6 +17,7 @@ #define DRV_JPEG_IOCTL_CMD_NUM 5 +static td_bool g_jpeg_suspend_flag = TD_FALSE; /*-------------------------------- func declares ------------------------------------------*/ static td_s32 drv_jpeg_open(td_void *private_data); @@ -72,14 +73,18 @@ td_s32 drv_jpeg_suspend(td_void *private_data) { uapi_unused(private_data); - return jpeg_suspend(); + jpeg_suspend(); + g_jpeg_suspend_flag = TD_TRUE; + return EXT_SUCCESS; } td_s32 drv_jpeg_resume(td_void *private_data) { uapi_unused(private_data); - return jpeg_resume(); + jpeg_resume(); + g_jpeg_suspend_flag = TD_FALSE; + return EXT_SUCCESS; } td_s32 jpeg_open(const td_char *path_name, td_s32 flags, td_s32 mode) @@ -107,6 +112,11 @@ td_s32 jpeg_ioctl(td_s32 module_idx, td_ulong ioctl_cmd, td_void *para) return EXT_FAILURE; } + if (g_jpeg_suspend_flag == TD_TRUE) { + jpeg_err("jpeg is in suspend state!, suspend_flag = %u", g_jpeg_suspend_flag); + return EXT_FAILURE; + } + return (td_s32)g_jpeg_ioctl_cmd_list[ioctl_cmd].handler((td_u32)ioctl_cmd, para, TD_NULL); } diff --git a/code/sdk/middleware/services/gpu/drv/vau/intf/drv_vau_intf.c b/code/sdk/middleware/services/gpu/drv/vau/intf/drv_vau_intf.c index 5d9c2a12f..c8e99cb32 100644 --- a/code/sdk/middleware/services/gpu/drv/vau/intf/drv_vau_intf.c +++ b/code/sdk/middleware/services/gpu/drv/vau/intf/drv_vau_intf.c @@ -17,6 +17,8 @@ #define DRV_VAU_IOCTL_CMD_NUM 20 +static td_bool g_vau_suspend_flag = TD_FALSE; + static td_s32 drv_vau_open(td_void *private_data) { uapi_unused(private_data); @@ -40,6 +42,7 @@ td_s32 drv_vau_suspend(td_void *private_data) vau_dbg("vau suspend start"); vau_hal_suspend(); + g_vau_suspend_flag = TD_TRUE; vau_dbg("vau suspend ok"); return EXT_SUCCESS; @@ -60,6 +63,7 @@ td_s32 drv_vau_resume(td_void *private_data) #ifdef CONFIG_CLDO1PD_SUPPORT vau_mem_draw_pool_init(); #endif + g_vau_suspend_flag = TD_FALSE; vau_dbg("vau resume ok"); return EXT_SUCCESS; @@ -120,6 +124,11 @@ td_s32 vau_ioctl(td_s32 module_idx, td_ulong ioctl_cmd, td_void *para) return EXT_FAILURE; } + if (g_vau_suspend_flag == TD_TRUE) { + vau_err("vau is in suspend state!, suspend_flag = %u", g_vau_suspend_flag); + return EXT_FAILURE; + } + return (td_s32)g_vau_ioctl_cmd_list[ioctl_cmd].handler((td_u32)ioctl_cmd, para, TD_NULL); } diff --git a/code/sdk/middleware/services/gui/hal/common/include/graphic_hardware_config.h b/code/sdk/middleware/services/gui/hal/common/include/graphic_hardware_config.h index 59eb8428c..c37d62b8f 100644 --- a/code/sdk/middleware/services/gui/hal/common/include/graphic_hardware_config.h +++ b/code/sdk/middleware/services/gui/hal/common/include/graphic_hardware_config.h @@ -139,7 +139,7 @@ /** * @brief Memory pool define. */ -#define ALIGN_UP(x, a) ((((x) + ((a)-1)) / (a)) * (a)) +#define ALIGN_UP(x, a) ((((x) + ((a) - 1)) / (a)) * (a)) #ifndef CONFIG_PSRAM_SUPPORT // equal to MEMORY_MINI #define MEM_POOL_UI_POOL_SIZE 0x13c000 // 1408 - 144 = 1264k @@ -157,11 +157,7 @@ #else #define MEM_POOL_UI_POOL_SIZE PSRAM_GUI_MEM_POOL_SIZE #define MEM_POOL_UI_FONT PSRAM_GUI_MEM_POOL_ADDR -#if PSRAM_DENSITY_MB == 16 #define MEM_POOL_UI_FONT_SIZE 0x100000 -#else -#define MEM_POOL_UI_FONT_SIZE 0x380000 -#endif #ifdef SUPPORT_GPU_GMMU // FB(sram) is virtual addr, FB0:0x61240000 FB1:0x61a40000 #define MEM_POOL_UI_OTHER (MEM_POOL_UI_FONT + MEM_POOL_UI_FONT_SIZE) diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a index 5a1a1d1c1..5a5634b10 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a index 66994fb09..9f80e8f22 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target1/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a index 42abaaf86..d9221a38c 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target3/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a index c8e9fcb7a..6ce97393d 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-target5/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a index f0ca757e2..3707dea21 100644 Binary files a/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a and b/code/sdk/middleware/services/gui/hal/display/brandy-xts/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c b/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c index cf2f29084..c1508373c 100644 --- a/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c +++ b/code/sdk/middleware/services/gui/hal/display/src/display_gralloc.c @@ -147,7 +147,7 @@ static int32_t InitBufferHandle(BufferHandle *buffer, const AllocInfo *info) } else { const FormatInfo *fmtInfo = GetFormatInfo(info->format); if (fmtInfo == NULL) { - DISP_LOGE("%s: can not get format information : %d\n", __func__, buffer->format); + DISP_LOGE("%s: can not get format information : %d\n", __func__, info->format); return DISPLAY_FAILURE; } @@ -232,7 +232,6 @@ static int32_t AllocMem(const AllocInfo *info, BufferHandle **handle) uint8_t *addr = LosAllocMem(pool, (uint32_t)(buffer->size)); if (addr == NULL) { - DISP_LOGE("LosAllocMem failure\n"); ret = DISPLAY_FAILURE; goto END; } @@ -241,7 +240,6 @@ static int32_t AllocMem(const AllocInfo *info, BufferHandle **handle) END: if ((ret != DISPLAY_SUCCESS) && (buffer != NULL)) { - DISP_LOGE("AllocMem FAILED.\n"); free(buffer); buffer = NULL; } diff --git a/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a b/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a index 4e1c4b4ac..6bcb4a36a 100644 Binary files a/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a and b/code/sdk/middleware/services/gui/lvgl/brandy-target1/liblvgl_proprietary_mini.a differ diff --git a/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a b/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a index 729723d8a..3c0d6f99a 100644 Binary files a/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a and b/code/sdk/middleware/services/gui/lvgl/brandy-target5/liblvgl_proprietary.a differ diff --git a/code/sdk/middleware/services/gui/uikit/CMakeLists.txt b/code/sdk/middleware/services/gui/uikit/CMakeLists.txt index e3c1d6bc1..a3f07071f 100644 --- a/code/sdk/middleware/services/gui/uikit/CMakeLists.txt +++ b/code/sdk/middleware/services/gui/uikit/CMakeLists.txt @@ -206,9 +206,15 @@ set(COMPONENT_SRC ${PROP_UI_SRC}/components_ext/text_ext.cpp ${PROP_UI_SRC}/components_ext/ui_label_button_ext.cpp ${PROP_UI_SRC}/components_ext/image_cache_manager.cpp + ${PROP_UI_SRC}/components_ext/ui_hexagons_list.cpp ${PROP_UI_SRC}/components_ext/ui_canvas_ext.cpp ${PROP_UI_SRC}/components_ext/ui_card_container.cpp ${PROP_UI_SRC}/components_ext/ui_cross_view.cpp + ${PROP_UI_SRC}/components_ext/kaleidoscope_utils.cpp + ${PROP_UI_SRC}/components_ext/ui_kaleidoscope_view.cpp + ${PROP_UI_SRC}/components_ext/ui_map_view.cpp + ${PROP_UI_SRC}/components_ext/map_svg_parser.cpp + ${PROP_UI_SRC}/components_ext/ui_coverflow_view.cpp ) set(SOURCES diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a index 989d7e9b2..304b659c1 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-native-js/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a index efe481361..c3b85553a 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-target3/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a index 6a175b7fa..958bb08f9 100644 Binary files a/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a and b/code/sdk/middleware/services/gui/uikit/brandy-xts/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h index 38c5a15b0..e497fe0e2 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/common/image_cache_manager.h @@ -37,6 +37,7 @@ #include "gfx_utils/image_info.h" #include "gfx_utils/heap_base.h" #include "graphic_config.h" +#include "hals/gralloc_engines.h" #if ENABLE_IMAGE_PACKER namespace OHOS { @@ -103,16 +104,19 @@ public: */ void UpdateImageInfoIfNecessary(ImageInfo& info); + void* FreeAndGetBuf(const AllocInfo& info, GrallocBuffer& buffer); + private: struct ImageNode; struct MultiImageInfo { - uint32_t dirId; - uint32_t count; - uint32_t loadedCount; - bool isPath; - bool isSingle; + uint32_t dirId = 0; + uint32_t count = 0; + uint32_t loadedCount = 0; + uint32_t offset = 0; + bool isPath = false; + bool isSingle = false; std::string file; - ImageNode** node; + ImageNode** node = nullptr; }; struct ImageNode { @@ -149,7 +153,6 @@ private: ImageInfo* LoadSingleImgInfo(FILE* fp, MultiImageInfo& multiImgInfo, uint32_t imgIndex, int offset, bool isLongTerm); ImageInfo* LoadOneImgFromBuf(uint8_t* buf, MultiImageInfo& multiImgInfo, uint32_t imgIndex); - void* GetImgCacheBuffer(ImageInfo& info); ImageCacheManager::ImageNode* CreateImageNode(MultiImageInfo* multiImgInfo, uint32_t size, bool isLongTerm, uint32_t imgId); void DestoryImageNode(ImageNode*& node); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h index f86fd9e12..de6afb630 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/common/lite_surface.h @@ -286,6 +286,9 @@ public: */ void CancelBuffer(SurfaceBuffer* buffer) override; + void ClearBuffers(); + SurfaceBuffer* GetBackBuf(); + protected: void AddBuffer(); BufferItem* GetBufferItem(const SurfaceBuffer* buffer); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h index 9d19e86c4..535696cb8 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/card_swipe.h @@ -39,6 +39,8 @@ public: * @version 1.0 */ virtual void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) {} + + bool isNeedClip_ = false; }; } #endif diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h new file mode 100644 index 000000000..87ec4e93a --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/kaleidoscope_utils.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +/** + * @file kaleidoscope_utils.h + * + * @brief Declares a KaleidoscopeUtils. + */ + +#ifndef KALEIDOSCOPE_UTILS_H +#define KALEIDOSCOPE_UTILS_H + +#include "gfx_utils/heap_base.h" +#include "components/ui_canvas_ext.h" +#include "gfx_utils/image_info.h" + +namespace OHOS { + +struct ImageInfoExt { + ImageInfo info; + uint32_t stride; +}; + +class KaleidoscopeUtils : public HeapBase { +public: + + KaleidoscopeUtils() {}; + + virtual ~KaleidoscopeUtils(); + + /** + * @brief Init KaleidoscopeUtils. + * @param [in] src Pointer to a ImageInfo struct, which is the source img for kaleidoscope img. + * @param [in] dst Pointer to a ImageInfoExt struct, which will be used to store kaleidoscope data. + If it is NULL, it will be created and managed internally. + * @return Return true if init successfully; and false otherwise. + */ + bool Init(const ImageInfo* src, const ImageInfoExt* dst); + + /** + * @brief Update the kaleidoscope img by a rotate value. + * @param [in] rotate Rotate value. + * @return Return true if update successfully; and false otherwise. + */ + bool Rotate(float rotate); + + /** + * @brief Update the address of kaleidoscope data, when init with an externally managed ImageInfoExt. + * @param [in] addr Address of kaleidoscope data. + * @return Return true if update successfully; and false otherwise. + */ + bool UpdateKaleidoscopeImgInfo(const ImageInfoExt &imgInfo); + + /** + * @brief Obtain kaleidoscope img. + * @return Return pointer to ImageInfoExt struct. + */ + ImageInfoExt* GetKaleidoscopeInfo(); + +private: + ImageInfo* imgInfo_ = nullptr; + ImageInfoExt* kaleidoscopeInfo_ = nullptr; + ImageInfoExt* partialInfo_ = nullptr; + Path sectorPath_ = {0}; + Path imgPath_ = {0}; + float thetaVal_ = 0.0f; + float radius_ = 0.0f; + Point point_ = {0, 0}; + Point startPoint_ = {0, 0}; + bool isInternalMem_ = false; + + void UpdatePoint(float rotate); + bool ConstructPartial(); + bool ConstructKaleidoscope(); + Rect GetBoundingArea(const ImageHeader& header); + bool InitKaleidoscopeInfo(const ImageInfo* src, const ImageInfoExt* dst); + bool InitInnerPath(); + bool InitPartialInfo(); + void DeinitKaleidoscopeInfo(); + void DeInitPartialInfo(); + void DeinitInnerPath(); + void DeinitImgInfo(); + bool ConstructFirstQuadrant(BufferInfo& dstBufInfo); + bool ConstructRestQuadrant(BufferInfo& dstBufInfo); +}; +} +#endif +/** + * @} + */ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_barcode.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_barcode.h index 57cbacdf2..a9258e026 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_barcode.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_barcode.h @@ -51,7 +51,7 @@ public: * @since 3.0 * @version 5.0 */ - virtual ~UIBarcode(); + ~UIBarcode() override; /** * @brief Sets the bar code information. @@ -105,11 +105,11 @@ private: void ReMeasure() override; void RefreshBarcode(); bool FillImageInfo(); - void FillBarCodeColor(ImageInfo& imageInfo, int32_t actualLenght, uint8_t *destData, uint32_t offset); - void SetBarcodeVal(const char* val, uint32_t length); + void FillBarCodeColor(ImageInfo& imageInfo, int32_t actualLength, uint8_t *destData, uint32_t offset); + void SetBarcodeVal(const char* barcodeVal, uint32_t length); ImageInfo imageInfo_; - int16_t stride_; + int16_t stride_ = 0; bool needDraw_; ColorType barColor_; char* barcodeVal_; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_card_page.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_card_page.h index a51a2bd12..9e90eb04b 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_card_page.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_card_page.h @@ -49,7 +49,21 @@ public: * @since 1.0 * @version 1.0 */ - virtual ~UICardPage() {} + ~UICardPage() override {} + + /* * + * @brief This function is invoked when the function SetHorCurrentPage() is called. + * @since 1.0 + * @version 1.0 + */ + virtual void OnActive(void) {} + + /* * + * @brief This function is invoked when the function SetHorCurrentPage() is called. + * @since 1.0 + * @version 1.0 + */ + virtual void OnInactive(void) {} /* * * @brief Preload resource callback function, it will be called at the end of swipe animator or the function @@ -132,6 +146,13 @@ public: return UI_CARD_PAGE; } + /* * + * @brief Clear the image cache of this page. + * @since 1.0 + * @version 1.0 + */ + void ClearCache(void); + private: bool isCoverable_ = false; }; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h new file mode 100644 index 000000000..ee54206e2 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_coverflow_view.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ + +#ifndef UI_COVERFLOW_VIEW_H +#define UI_COVERFLOW_VIEW_H +#include +#include +#include "components/ui_image_view.h" +#include "components/ui_label.h" +#include "components/ui_swipe_view.h" + +namespace OHOS { +class UICoverflowView : public UISwipeView { +public: + explicit UICoverflowView(uint8_t mirrorOpa = 30, bool supportMirror = true); // 30: default mirror opacity + ~UICoverflowView() override; + + /** + * @brief Add a item to coverflow. + * + * @param id Indicates the pointer to the view ID. + * @param src point item show main image imageinfo. + */ + void Add(const char* id, const ImageInfo* src); + + /** + * @brief remove a item from coverflow. + * + * @param id Indicates the pointer to the view ID. + */ + void Remove(const char* id); + + /** + * @brief Set image size. + * + * @param width setting image width. + * @param height setting image height. + */ + void SetImgSize(uint16_t width, uint16_t height); + + /** + * @brief Set image direct interval. + * + * @param padding setting padding value. The interval between two images is twice the padding. + */ + void SetImgPadding(uint16_t padding); + + /** + * @brief Set rotate angle between the left and right items in static display mode. + * + * @param angle setting rotate angle. + */ + void SetRotateAngle(float angle); + + /** + * @brief Represents a listener for swipe of the coverflow view. + */ + class OnCoverflowScrollListener : public HeapBase { + public: + virtual bool OnScroll() = 0; + virtual ~OnCoverflowScrollListener() {} + }; + + /** + * @brief Sets the listener that contains a callback to be invoked upon a swipe event. + * + * @param onCoverflowListener Indicates the listener to set. + * @since 1.0 + * @version 1.0 + */ + void SetOnCoverflowListener(OnCoverflowScrollListener* onCoverflowListener) + { + coverflowListener_ = onCoverflowListener; + } + + void SetDirection(uint8_t direction) = delete; + uint8_t GetDirection() const = delete; +protected: + bool DragXInner(int16_t distance) override; + +private: + void UpdatePerspectiveMatrix(); + void ReMeasure(void) override; + void TransformImage(UIImageView* view); + void DeleteGroup(UIViewGroup* group); + + using UISwipeView::Add; + using UISwipeView::Remove; + + OnCoverflowScrollListener* coverflowListener_; + std::map> map_; + Matrix4 perspectiveMatrix_; + + uint16_t imgWidth_; + uint16_t imgHeight_; + uint16_t padding_; + float rotateAngle_; + uint8_t mirrorOpa_; + bool isShowMirrorImg_; + UIView* lastView_; +}; +} // namespace OHOS +#endif // UI_COVERFLOW_VIEW_H diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h index 0f05ee094..37229c75f 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_cross_view.h @@ -40,6 +40,9 @@ namespace OHOS { */ class UICrossView : public UIViewGroup, public UISwipeView::OnSwipeListener { public: + UICrossView(const UICrossView &) = delete; + UICrossView &operator=(const UICrossView &) = delete; + /* * * @brief Scale align mode. */ @@ -60,7 +63,7 @@ public: * @since 1.0 * @version 1.0 */ - virtual ~UICrossView() override; + ~UICrossView() override; /* * * @brief Get the static instance for UICrossView. @@ -89,7 +92,7 @@ public: void HorAdd(UICardPage* view); /* * - * @brief Insert view by horizontal direction. + * @brief Insert view by horizontal direction. set as first page if preview is nullptr * @since 1.0 * @version 1.0 */ @@ -178,6 +181,9 @@ public: void RegisterSwipeCallback(CardSwipe* callback) { horizontal_.RegisterSwipeCallback(callback); + if (callback != nullptr) { + isNeedClip_ = callback->isNeedClip_; + } } /* * @@ -203,18 +209,23 @@ public: } private: + void UpdateCardPageIndex(); + static constexpr uint16_t INVALID_VIEW_INDEX = 0xff; bool loop_ = false; bool enableScreenCap_ = false; - bool GaussianBlurEnable_ = false; + bool gaussianBlurEnable_ = false; int swipeDirect_ = 0; int pullIndex_ = 0; - int16_t hDragStartIndex_ = 0xff; - int16_t vBlankIndex_ = 0xff; - UIView* Vertblank_ = nullptr; + int16_t hDragStartIndex_ = INVALID_VIEW_INDEX; + int16_t vBlankIndex_ = INVALID_VIEW_INDEX; + UIView* vBlankView_ = nullptr; UISwipeView vertical_; HorSwipeView horizontal_; + UIView* tailView_ = nullptr; UISwipeView::OnSwipeListener *swipeListener_ = nullptr; + bool isNeedClip_ = false; + void RemoveAllInner(UISwipeView& view); void ProcessRes(void); void VertSetGausBlur(uint16_t direct); void HorHandleCardEvent(int16_t index, uint16_t scrollStage); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_custom_hexagons_list.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_custom_hexagons_list.h new file mode 100644 index 000000000..a17072cca --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_custom_hexagons_list.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#ifndef UI_HEXAGONS_LIST_EXT_H +#define UI_HEXAGONS_LIST_EXT_H +#include "components/ui_hexagons_list.h" + +namespace OHOS { +class UICustomHexagonsList : public UIHexagonsList { +public: + UICustomHexagonsList() {} + ~UICustomHexagonsList() override; + UICustomHexagonsList(const UICustomHexagonsList &) = delete; + UICustomHexagonsList &operator=(const UICustomHexagonsList &) = delete; + +#if ENABLE_ROTATE_INPUT + bool OnRotateStartEvent(const RotateEvent& event) override; + + bool OnRotateEvent(const RotateEvent& event) override; + + bool OnRotateEndEvent(const RotateEvent& event) override; +#endif + void StartRotateAnimator(uint8_t center, int16_t xDistance, int16_t yDistance, float startScale, float endScale); + void StopRotateAnimator(); + float GetScaleInSmallState() + { + return scaleInSmallState_; + } + +protected: + class RotateAnimatorCallback : public ListAnimatorCallback { + public: + RotateAnimatorCallback(); + ~RotateAnimatorCallback() override {} + RotateAnimatorCallback(const RotateAnimatorCallback &) = delete; + RotateAnimatorCallback &operator=(const RotateAnimatorCallback &) = delete; + + void SetDuration(uint16_t times) + { + totalTime_ = times; + } + + void SetCenterIndex(uint8_t center) + { + centerIndex_ = center; + } + + void SetRotateRange(int16_t xDistance, int16_t yDistance, float startScale, float endScale) + { + xDistance_ = xDistance; + yDistance_ = yDistance; + startScale_ = startScale; + endScale_ = endScale; + } + + void ResetCallback() + { + curTime_ = 0; + totalTime_ = 0; + xDistance_ = 0; + prevX_ = 0; + yDistance_ = 0; + prevY_ = 0; + startScale_ = 0.0f; + endScale_ = 0.0f; + centerIndex_ = 0; + } + + void Callback(UIView* view) override; + + private: + uint16_t curTime_; + uint16_t totalTime_; + int16_t xDistance_; + int16_t yDistance_; + int16_t prevX_; + int16_t prevY_; + float startScale_; + float endScale_; + uint8_t centerIndex_; + }; +private: + RotateAnimatorCallback rotateCallback_; + Animator* rotateAnimator_ = nullptr; + float scaleInSmallState_ = 0.42f; + uint8_t rotateCenterIndexInNormal_ = 0; +}; +} +#endif // UI_HEXAGONS_LIST_EXT_H \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h new file mode 100644 index 000000000..5a7e3d11d --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_hexagons_list.h @@ -0,0 +1,231 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#ifndef UI_HEXAGONS_LIST_H +#define UI_HEXAGONS_LIST_H + +#include "components/ui_view.h" +#include "components/ui_abstract_scroll.h" +#include "components/ui_scroll_view.h" +#include "gfx_utils/list.h" +#include "gfx_utils/vector.h" + +namespace OHOS { +class UIHexagonsList : public UIScrollView { +public: + UIHexagonsList(); + + ~UIHexagonsList() override {} + + /** + * @brief Set origin image distance between the center of the two adjacent images + * imageDistance = oriImgDistance * globalScale + * globalScale: refer to function Scale + * LayoutChildren(true) must be invoked mannualy after invoking this method. + * + * @param distance Indicates image distance to set when the image in the center region + */ + void SetImageDistance(uint16_t distance) + { + oriImgDistance_ = distance; + } + + /** + * @brief Set image size + * LayoutChildren(true) must be invoked mannualy after invoking this method. + * + * @param size Indicates size to set, when the image in the center + */ + void SetImageSizeInCenter(uint16_t size) + { + imgSizeInCenter_ = size; + } + + /** + * @brief Set origin image scale factor, scale strategy will follow the below rules + * if globalScale >= 1 + * scaleFactor = oriScaleFactor + * elif globalScale > scaleThreshold + * scaleFactor = oriScaleFactor * (globalScale - scaleThreshold) / (1 - scaleThrethold) + * else + * scaleFactor = 0 + * img size is inversely proportional to distance * scaleFactor + * + * oriScaleFactor: refer to function SetScaleFactorByDistance + * scaleThreshold: refer to function SetScaleThesholdOfZeroFactor + * globalScale: refer to function Scale + * + * @param factor Indicates scale factor to set, which will decide scale value together with distance + */ + void SetScaleFactorByDistance(float factor) + { + oriScaleFactor_ = factor; + } + + float GetScaleFactorByDistance() + { + return oriScaleFactor_; + } + + /** + * @brief Set scale threshold, scale factor will decrese to 0 if global scale equal and less than scaleThreshold, + * default value is 0.6, more information can refer to method SetScaleFactorByDistance + * + * @param threshold Indicates factor to set, the scale factor when the image is not in the center + */ + void SetScaleThesholdOfZeroFactor(float threshold) + { + scaleThresholdOfZeroFactor_ = threshold; + } + + float GetScaleThesholdOfZeroFactor() + { + return scaleThresholdOfZeroFactor_; + } + + /** + * @brief Adds a child image view whose resize mode will set to be UIImageView::COVER. + * LayoutChildren(true) should be invoked mannualy after invoking this method. + * Note: View index was set for children innner in order of addition, so you can + * get its index by call method GetViewIndex() + * + * @param view Indicates the pointer to the child view to add. + */ + void Add(UIView* view) override; + + /** + * @brief Inserts a child image view whose resize mode will set to be UIImageView::COVER. + * LayoutChildren(true) should be invoked mannualy after invoking this method. + * Note: View index was set for children innner in order of addition, so you can + * get its index by call method GetViewIndex() + * + * @param prevView Indicates the pointer to the child image view, previous to the new child image view. + * @param view Indicates the pointer to the new child image view to insert. + */ + void Insert(UIView* prevView, UIView* insertView) override; + + bool OnDragEvent(const DragEvent& event) override; + + /** + * @brief Lays out all children views according to the hexagons shape, it must be invoked after method: + * 1. Add(UIView* view) + * 2. Insert(UIView* prevView, UIView* insertView) + * 3. void SetImageSizeInCenter(uint16_t size) + * 4. void SetImageDistance(uint16_t distance) + * + * @param needInvalidate Specifies whether to refresh the invalidated area after the layout is complete. + * Value true means to refresh the invalidated area after the layout is complete, + * and false means the opposite. + */ + void LayoutChildren(bool needInvalidate = false) override; + + /** + * @brief Moves all child views. + * + * @param x Indicates the offset distance by which this view group is moved on the x-axis. + * @param y Indicates the offset distance by which this view group is moved on the y-axis. + */ + void MoveChildByOffset(int16_t offsetX, int16_t offsetY) override; + + /** + * @brief Set global scale, and image with centerIndex will be focused + * + * @param scale Indicates global scale value both for x- and y- axes. + * @param pivot Indicates index of scaling center. + */ + void Scale(float scale, uint8_t centerIndex); + + float GetGlobalScale() + { + return globalScale_; + } + + /** + * @brief Get the Index Of View object in this view group + * + * @param view, Indicates the view to search + * @return Returns the index, -1 if not exsit + */ + UIView* GetViewByIndex(uint8_t index); + + enum class ReboundMode : uint8_t { + NEAREST_IMG_ON_SCR_CENTER, + CENTER_IMG_ON_SCR_CENTER, + NORMAL, // same with UIScrollView + }; + + void SetReboundMode(ReboundMode mode) + { + reboundMode = mode; + } + + /** + * @brief Get index of focused image, default 0, changed by scale and scroll + * When scroll animator end, the index of image in the center screen will set to be focus index + * When start Scale(scale, index), scale center index will set to be focus index + * @return Returns index of focused image, -1 if rebound mode is NORMAL + */ + int8_t GetFocusedImgIndex() + { + if (reboundMode == ReboundMode::NORMAL) { + return -1; + } else { + return focusImgIndex_; + } + } + + /** + * @brief Get center position of the special(index) image + * Note: the position is not actual position, it is position in regular hexagon without futher adjustment + * which include adjusting the img zoom and distance in order to improve display experience + * + * @return Returns postion in regular hexagon + */ + Vector2 GetCurrentPosition(uint8_t index); + +protected: + bool DragXInner(int16_t distance) override; + bool DragYInner(int16_t distance) override; + void ReMeasure() override; + /** + * @brief Get center position of the special(index) image when scale and center image index in screen is specified + * + * @return Returns position + */ + Vector2 GetPositionWithCondition(uint8_t index, uint8_t centerIndex, float scale); + + float globalScale_{1.0f}; + float scaleThresholdOfZeroFactor_{0.75f}; + +private: + void InitParametersAndImgIndex(); + bool IsCenterInPolygons(const Vector2& offset = {0, 0}); + Rect GetChildrenRegion(); + void CalculateAdjustDistanceForRectScreen(Vector2& position, float& imgScaleRatio); + void AdjustViewByDistance(UIView& view, const Vector2& position); + void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) override; + void CalculateReboundDistanceForNormal(int16_t& dragDistanceX, int16_t& dragDistanceY); + void CalculateReboundDistanceForNearestOnCenter(int16_t& dragDistanceX, int16_t& dragDistanceY); + void CalculateNearestPointFromOutterPoint(const Vector2& outerPoint); + void UpdateNearestPointFromFixedPoint(const Vector2& fixedPoint, uint8_t index); + void CreatePolygons(uint16_t lap, int16_t angle); + Graphic::Vector> imgPoints_{64}; + uint16_t maxLap_ = 0; + uint16_t maxAngleInMaxLap_ = 0; + Graphic::Vector polygonPoints_{10}; + uint16_t imgDistance_{0}; + uint16_t oriImgDistance_{0}; + float oriScaleFactor_{0.23f}; + int16_t imgSizeInCenter_{0}; + uint32_t minDistancePow_{0xFFFFFFFF}; + uint8_t nearestIndex_{0}; + uint8_t focusImgIndex_{0}; + float oriImgRadius_{0.0f}; + float imgRadius_{0.0f}; + int16_t centerX_{0}; + int16_t centerY_{0}; + ReboundMode reboundMode{ReboundMode::NEAREST_IMG_ON_SCR_CENTER}; +}; +} +#endif // UI_HEXAGONS_LIST_H \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h new file mode 100644 index 000000000..885176967 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_kaleidoscope_view.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +/** + * @addtogroup UI_Components + * @{ + * + * @brief Defines UI components such as buttons, texts, images, lists, and progress bars. + */ + +/** + * @file ui_kaleidoscope_view.h + * + * @brief Declares a UIKaleidoscopeView. + */ + +#ifndef UI_KALEIDOSCOPE_VIEW_H +#define UI_KALEIDOSCOPE_VIEW_H + +#include "components/ui_view.h" +#include "gfx_utils/image_info.h" +#include "components/kaleidoscope_utils.h" +#include "hals/display_dev.h" + +namespace OHOS { +/** + * @brief It provide kaleidoscope view. + */ +class UIKaleidoscopeView : public UIView { +public: + UIKaleidoscopeView(const UIKaleidoscopeView &) = delete; + UIKaleidoscopeView &operator=(const UIKaleidoscopeView &) = delete; + + /** + * @brief A constructor used to create the UIKaleidoscopeView instance. + This view will directly modify the buffer, and it is the same size as the screen. + */ + UIKaleidoscopeView(); + + /** + * @brief A destructor used to delete the UIKaleidoscopeView instance. + */ + ~UIKaleidoscopeView() override; + + /** + * @brief Obtains the view type. + * @return Returns UI_KALEIDOSCOPE_VIEW, as defined in {@link UIViewType}. + */ + UIViewType GetViewType() const override + { + return UI_KALEIDOSCOPE_VIEW; + } + + /** + * @brief Set src img for kaleidoscope. + * @param [in] src Pointer to a ImageInfo struct, which is the source img for kaleidoscope img. + The size of img must match the size of screen. + * @return Return true if set successfully; and false otherwise. + */ + bool SetSrc(const ImageInfo* src); + + /** + * @brief Update the kaleidoscope by a rotate value. + * @param [in] rotate Rotate value. + */ + void Rotate(float rotate); + +#if ENABLE_ROTATE_INPUT + /** + * @brief Set rotate factor for rotate event. + */ + void SetRotateEventFactor(float factor); + + /** + * @brief Handle Rotate Event. Update the kaleidoscope by a rotate event. + * @param [in] event Rotate event. + */ + bool OnRotateEvent(const RotateEvent& event) override; +#endif + + /** + * @brief Set rotate value for rotate animator callback. + * @param [in] rotate Rotate value. + */ + void SetRotateAnimatorValue(float rotate); + + /** + * @brief Start rotate animator + */ + void StartRotateAnimator(); + + /** + * @brief Stop rotate animator + */ + void StopRotateAnimator(); + + void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override; +private: + class RotateCallback : public AnimatorCallback { + public: + RotateCallback() {} + ~RotateCallback() override {} + void SetRotateValue(float rotate); + void Callback(UIView* view) override; + private: + float rotate_ = 0.0f; + }; + +#if ENABLE_ROTATE_INPUT + float factor_ = 1.0f; +#endif + float rotate_ = 0.0f; + KaleidoscopeUtils kaleidoscope_; + RotateCallback callback_; + Animator* animator_ = nullptr; +}; +} +#endif +/** + * @} + */ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h index 4365bd935..352eedb94 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_lite_surface_view.h @@ -34,6 +34,7 @@ #include "common/ihardware_view.h" #include "common/lite_surface.h" +#include "common/image.h" #include "components/ui_view.h" #include "ibuffer_consumer_listener.h" #include "graphic_mutex.h" @@ -178,6 +179,13 @@ public: return isFirstFrameCome_; } + /** + * @brief Set preview image info. + * @since 1.0 + * @version 1.0 + */ + void SetPreview(ImageInfo* info); + private: UILiteSurfaceView(const UILiteSurfaceView&) = delete; UILiteSurfaceView &operator=(const UILiteSurfaceView&) = delete; @@ -192,12 +200,12 @@ private: GraphicMutex lock_; ColorType colorKey_ = Color::White(); Rect layerRect_; - - void PreHandleStatus(); + Image* preView_ = nullptr; #ifdef VERSION_IOT void BlitBitmapToFb(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea, ImageInfo& bitmap); #endif + void AdjustArea(Rect& rect); }; } // namespace OHOS #endif // GRAPHIC_LITE_UI_LITE_SURFACE_VIEW_H diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_map_view.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_map_view.h new file mode 100644 index 000000000..1b1310ab6 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/components/ui_map_view.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ + +/** + * @addtogroup UI_Components + * @{ + * + * @brief Defines UI components such as buttons, texts, images, lists, and progress bars. + * + * @since 1.0 + * @version 1.0 + */ + +/** + * @file ui_map_view.h + * + * @brief Defines the class to extend canvas/paint ability. + * + * @since 1.0 + * @version 1.0 + */ + +#ifndef GRAPHIC_LITE_UI_MAP_VIEW_H +#define GRAPHIC_LITE_UI_MAP_VIEW_H +#include "components_ext/map_svg_parser.h" +#include "components/ui_view_group.h" + +namespace OHOS { +#if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH +struct POIInfo { + ImageDetail* img = nullptr; + TextDetail* text[2] = {nullptr, nullptr}; + uint8_t tag = 0; + uint16_t rank = 0; + uint16_t id = 0; + Rect rect; + Point orignPos = {0, 0}; + bool visible = false; +}; + +struct RoadInfo { + TextDetail* text = nullptr; + Rect rect; + Point orignPos = {0, 0}; + bool visible = false; +}; + +class OnPOIClickListener : public HeapBase { +public: + /* * + * @brief Called when a POI is clicked. + * @since 1.0 + * @version 1.0 + */ + virtual bool OnClick(uint32_t index) + { + return false; + } + + /* * + * @brief A destructor used to delete the OnPOIClickListener instance. + * @since 1.0 + * @version 1.0 + */ + virtual ~OnPOIClickListener() {} +}; + +class UIMapView : public UIViewGroup, public UIView::OnClickListener { +public: + UIMapView(const UIMapView &) = delete; + UIMapView &operator=(const UIMapView &) = delete; + + /* * + * @brief A constructor used to create an UIMapView instance. + * + */ + UIMapView(); + + /* * + * @brief A destructor used to delete the UIMapView instance. + * + */ + ~UIMapView() override; + + /* * + * @brief Get current view type. + * + */ + UIViewType GetViewType() const override + { + return UI_MAP_VIEW; + } + + /* * + * @brief Set SVG src with file path. + * + */ + bool SetSVG(const char* path); + + /* * + * @brief Set SVG src with file buffer. + * + */ + bool SetSVG(uint8_t* data, uint32_t length); + + /* * + * @brief Set POI on cick listener. + * + */ + void SetOnPOIClickListener(OnPOIClickListener* listener); + + /* * + * @brief Enable cache. It will cache this tile immediately when enable is true, + * and free cache buffer immediately. We need to enable cache when setting svg, + * or after scale map finished, and disable cache before scale map. + * + */ + void EnableCache(bool enable); + + /* * + * @brief Used to scale map base the target point. + * + */ + void ScaleMap(float scale, const Vector2& pivot); + + /* * + * @brief Hide the POI by tag. + * + */ + void HidePOI(uint16_t tag, bool isHide = true); + void SetX(int16_t x) override; + void SetY(int16_t x) override; + +private: + POIInfo* pois_ = nullptr; + RoadInfo* roads_ = nullptr; + OnPOIClickListener* poiListener_ = nullptr; + bool cacheEnable_ = false; + bool needUpdate_ = false; + ImageInfo cacheInfo_ = {{0}}; + MapSVGParser parser_; + uint8_t* data_ = nullptr; + char* filePath_ = nullptr; + PathDetail* pathArray_ = nullptr; + uint8_t pathCount_ = 0; + RoadDetail* roadArray_ = nullptr; + uint8_t roadCount_ = 0; + POIDetail* poiArray_ = nullptr; + uint8_t poiCount_ = 0; + char* fontName_ = DEFAULT_VECTOR_FONT_FILENAME; + uint8_t fontId_ = 0xff; + uint8_t fontSize_ = 0; + uint32_t poiMask_ = 0; + float scale_ = 1.0f; + + void DrawPath(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea); + void DrawText(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea, TextDetail& info, Point offset = {0, 0}, + bool isPOIText = false); + Rect DrawImage(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea, ImageInfo& info, MapRect& rect); + void DrawPOIs(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea); + void DrawRoads(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea); + bool RenderMapToCache(void); + void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override; + bool OnClick(UIView& view, const ClickEvent& event) override; + void HandlePOICollision(); + void HandleRoadCollision(); + bool InitPOIInfo(int num); + bool InitRoadInfo(int num); + void ClearSVG(); +}; +#endif +} +#endif +/** + * @} + */ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/include/service/graphic_service_wrapper.h b/code/sdk/middleware/services/gui/uikit/proprietary/include/service/graphic_service_wrapper.h index d7f3dd6b9..a522c8dd5 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/include/service/graphic_service_wrapper.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/include/service/graphic_service_wrapper.h @@ -30,10 +30,15 @@ extern "C" { #endif /** - * @brief Set frequence for graphic. + * @brief Set frequence for graphic, cannot use PostGraphicEvent() to excute this method. */ void SetFrequence(int freq); +/** + * @brief Set frequence for graphic inner. + */ +void SetFrequenceInner(int freq); + /** * @brief Notify the Screen is on, for c language. */ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp index b75215441..f10692f3e 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp @@ -54,7 +54,7 @@ static void UikitRTCCallBack(uintptr_t data) GraphicService::GetInstance()->UpdateGraphicEvent(); } -void SetFrequence(int freq) +void SetFrequenceInner(int freq) { if (!g_isScreenOn) { return; @@ -79,6 +79,13 @@ void SetFrequence(int freq) } } +void SetFrequence(int freq) +{ + GraphicService::GetInstance()->PostGraphicEvent([=] { + SetFrequenceInner(freq); + }); +} + void NotifyScreenOn(void) { if (g_rtcHandle == nullptr) { diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp index ef6ae8e33..82c36b1e0 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/lite_surface.cpp @@ -25,6 +25,11 @@ LiteSurface::LiteSurface() : bufferCount_(0), queueSize_(0), size_(0), } LiteSurface::~LiteSurface() +{ + ClearBuffers(); +} + +void LiteSurface::ClearBuffers() { lock_.Lock(); freeList_.Clear(); @@ -42,6 +47,7 @@ LiteSurface::~LiteSurface() node = node->next_; } buffers_.Clear(); + bufferCount_ = 0; lock_.Unlock(); } @@ -312,4 +318,9 @@ void LiteSurface::CancelBuffer(SurfaceBuffer* buffer) { ReleaseBuffer(buffer); } + +SurfaceBuffer* LiteSurface::GetBackBuf() +{ + return dirtyList_.Back(); +} } // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/low_power_manager.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/low_power_manager.cpp index 1bf9a68a5..15eb859d3 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/low_power_manager.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/common/low_power_manager.cpp @@ -27,13 +27,13 @@ void LowPowerManager::TryToEnterLowPower() void LowPowerManager::EnterLowPower() { - SetFrequence(1); + SetFrequenceInner(1); } void LowPowerManager::ExitLowPower() { lastExitTime_ = HALTick::GetInstance().GetTime(); - SetFrequence(60); // 60: 60fps + SetFrequenceInner(60); // 60: 60fps } bool LowPowerManager::IsLiteSurfaceInRootView() @@ -57,8 +57,8 @@ bool LowPowerManager::CheckTaskState() if (period == 0) { return false; } else { - int freq = 1000 / period; // 1000: 1000ms per second - SetFrequence(freq); + int freq = 1000 / static_cast(period); // 1000: 1000ms per second + SetFrequenceInner(freq); return true; } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp new file mode 100644 index 000000000..2b578d746 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_custom_hexagons_list.cpp @@ -0,0 +1,192 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#include "components/ui_custom_hexagons_list.h" +#include "animator/easing_equation.h" + +namespace OHOS { +static const float TRASPANRENT_SCALE = 2.5f; +static const float ROTATE_SCALE_FACTOR = 0.02f; +static const float SCALE_SMALLEST_VALUE = 0.1f; +static const float ROTATE_ANIMATION_DURATION = 10; + +UICustomHexagonsList::~UICustomHexagonsList() +{ + if (rotateAnimator_ != nullptr) { + delete rotateAnimator_; + rotateAnimator_ = nullptr; + } +} + +UICustomHexagonsList::RotateAnimatorCallback::RotateAnimatorCallback() + : curTime_(0), + totalTime_(0), + xDistance_(0), + yDistance_(0), + prevX_(0), + prevY_(0), + startScale_(0.0f), + endScale_(0.0f), + centerIndex_(0) +{} + +void UICustomHexagonsList::RotateAnimatorCallback::Callback(UIView* view) +{ + UICustomHexagonsList* hexView = dynamic_cast(view); + if (hexView == nullptr) { + return; + } + curTime_++; + if (curTime_ > totalTime_) { + hexView->StopRotateAnimator(); + return; + } + float timeRatio = curTime_ * 1.0f / totalTime_; + if (!FloatEqual(xDistance_, 0)) { + if (!FloatEqual(prevX_, xDistance_)) { + int16_t curX = static_cast(timeRatio * xDistance_); + hexView->DragXInner(curX - prevX_); + prevX_ = curX; + } + } + if (!FloatEqual(yDistance_, 0)) { + if (!FloatEqual(prevY_, yDistance_)) { + int16_t curY = static_cast(timeRatio * yDistance_); + hexView->DragYInner(curY - prevY_); + prevY_ = curY; + } + } + float curScale = timeRatio * (endScale_ - startScale_) + startScale_; + if (FloatMoreEqual(curScale, 1.0f)) { + uint8_t opa = static_cast((1 - (curScale - 1.0f) / (TRASPANRENT_SCALE - 1.0f)) * OPA_OPAQUE); + UIView* curview = hexView->GetViewByIndex(centerIndex_); + if (curview != nullptr) { + curview->SetOpaScale(opa); + } + } + if ((FloatMore(startScale_, endScale_) && (curScale >= endScale_)) || + (FloatLess(startScale_, endScale_) || (curScale <= endScale_))) { + hexView->Scale(curScale, centerIndex_); + } + if (FloatEqual(curScale, endScale_)) { + hexView->StopRotateAnimator(); + } +} + +void UICustomHexagonsList::StartRotateAnimator(uint8_t center, int16_t xDistance, int16_t yDistance, + float startScale, float endScale) +{ + if (rotateAnimator_ == nullptr) { + rotateAnimator_ = new Animator(&rotateCallback_, this, 0, true); + } + rotateCallback_.ResetCallback(); + rotateCallback_.SetCenterIndex(center); + rotateCallback_.SetDuration(ROTATE_ANIMATION_DURATION); + rotateCallback_.SetRotateRange(xDistance, yDistance, startScale, endScale); + rotateAnimator_->Start(); +} + +void UICustomHexagonsList::StopRotateAnimator() +{ + if (rotateAnimator_ != nullptr) { + rotateAnimator_->Stop(); + rotateCallback_.ResetCallback(); + } +} + +#if ENABLE_ROTATE_INPUT +bool UICustomHexagonsList::OnRotateStartEvent(const RotateEvent& event) +{ + if (scrollAnimator_.GetState() != Animator::STOP) { + UIAbstractScroll::StopAnimator(); + } + if ((rotateAnimator_ != nullptr) && (rotateAnimator_->GetState() != Animator::STOP)) { + StopRotateAnimator(); + } + + // Record rotate center index when scale is large than 1.0f + if (FloatMoreEqual(GetGlobalScale(), 1.0f)) { + int8_t focusIndex = GetFocusedImgIndex(); + if (focusIndex < 0) { + GRAPHIC_LOGE("wrong focus index %d, force to be 0 !!", focusIndex); + rotateCenterIndexInNormal_ = 0; + } else { + rotateCenterIndexInNormal_ = static_cast(focusIndex); + } + } + return UIView::OnRotateStartEvent(event); +} + +bool UICustomHexagonsList::OnRotateEvent(const RotateEvent& event) +{ + float deltaScale = event.GetRotate() * ROTATE_SCALE_FACTOR; + float targetScale = globalScale_ + deltaScale; + Vector2 position = GetCurrentPosition(rotateCenterIndexInNormal_); + Vector2 deltaDistance; + // Current scale > Normal(1.0f), scale and change opaque + if (FloatMore(targetScale, 1.0f)) { + UIView* view = GetViewByIndex(rotateCenterIndexInNormal_); + uint8_t opa = static_cast((1 - (targetScale - 1.0f) / (TRASPANRENT_SCALE - 1.0f)) * OPA_OPAQUE); + if (view != nullptr) { + view->SetOpaScale(opa); + } + Scale(targetScale, rotateCenterIndexInNormal_); + // Current scale in [Equal-Threshold, Normal], only scale + } else if (FloatMoreEqual(targetScale, scaleThresholdOfZeroFactor_)) { + Scale(targetScale, rotateCenterIndexInNormal_); + // Current scale in [Small, Equal-Threshold), scale and scroll + } else if (FloatMore(targetScale, scaleInSmallState_)) { + if (deltaScale < 0) { + Vector2 targetPos = GetPositionWithCondition(rotateCenterIndexInNormal_, 0, scaleInSmallState_); + deltaDistance = targetPos - position; + float deltaScaleToSmallState = scaleInSmallState_ - globalScale_; + int16_t deltaX = static_cast(deltaDistance.x_ / deltaScaleToSmallState * deltaScale); + int16_t deltaY = static_cast(deltaDistance.y_ / deltaScaleToSmallState * deltaScale); + ScrollBy(deltaX, deltaY); + } else { + deltaDistance = Vector2(GetWidth() / 2, GetHeight() / 2) - position; // 2, center + float deltaScaleToSmallState = scaleThresholdOfZeroFactor_ - globalScale_; + int16_t deltaX = static_cast(deltaDistance.x_ / deltaScaleToSmallState * deltaScale); + int16_t deltaY = static_cast(deltaDistance.y_ / deltaScaleToSmallState * deltaScale); + ScrollBy(deltaX, deltaY); + } + Scale(targetScale, rotateCenterIndexInNormal_); + // Current scale in [Smallest, Small), only scale + } else if (FloatMore(targetScale, SCALE_SMALLEST_VALUE)) { + Vector2 centerImgPosition = GetCurrentPosition(0); + Vector2 targetPos(GetWidth() / 2, GetHeight() / 2); // 2, center + deltaDistance = targetPos - centerImgPosition; + ScrollBy(deltaDistance.x_, deltaDistance.y_); + Scale(targetScale, 0); + } + return UIView::OnRotateEvent(event); +} + +bool UICustomHexagonsList::OnRotateEndEvent(const RotateEvent& event) +{ + // Rotate end in (Normal, .), start animator to enter Normal State + if (FloatMore(globalScale_, 1.0f)) { + StartRotateAnimator(rotateCenterIndexInNormal_, 0, 0, globalScale_, 1.0f); + SetReboundMode(ReboundMode::NEAREST_IMG_ON_SCR_CENTER); + // Rotate end in (Equal-Threshold, Normal), start animator to enter Normal State + } else if (FloatMore(globalScale_, scaleThresholdOfZeroFactor_)) { + StartRotateAnimator(rotateCenterIndexInNormal_, 0, 0, globalScale_, 1.0f); + SetReboundMode(ReboundMode::NEAREST_IMG_ON_SCR_CENTER); + // Rotate end in (Small, Equal-Threshold), start animator to enter Small State + } else if (FloatMore(globalScale_, scaleInSmallState_)) { + Vector2 targetPos = GetPositionWithCondition(rotateCenterIndexInNormal_, 0, scaleInSmallState_); + Vector2 curPos = GetCurrentPosition(rotateCenterIndexInNormal_); + Vector2 delta = targetPos - curPos; + StartRotateAnimator(rotateCenterIndexInNormal_, delta.x_, delta.y_, globalScale_, scaleInSmallState_); + SetReboundMode(ReboundMode::CENTER_IMG_ON_SCR_CENTER); + // Rotate end in (., Small), start animator to enter Small State + } else { + StartRotateAnimator(0, 0, 0, globalScale_, scaleInSmallState_); + SetReboundMode(ReboundMode::CENTER_IMG_ON_SCR_CENTER); + } + + return UIView::OnRotateEndEvent(event); +} +#endif +} \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp index dc4ccb5f4..3484e4ad2 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/ui_lite_surface_view.cpp @@ -36,8 +36,6 @@ UILiteSurfaceView::UILiteSurfaceView() : isLayerInit_(false), flushCount_(0) return; } surface_->RegisterConsumerListener(*this); - LiteMGfxEngine::GetInstance()->AddHardwareLayer(this); - GraphicService::GetInstance()->EnableAsyncMode(false); LowPowerManager::GetInstance()->PowerLock(); } @@ -116,10 +114,7 @@ void UILiteSurfaceView::Flush() --flushCount_; lock_.Unlock(); currentBuffer_ = surface_->AcquireBuffer(); - PreHandleStatus(); if (currentBuffer_ == nullptr) { - surface_->ReleaseBuffer(lastFlushedBuffer_); - lastFlushedBuffer_ = nullptr; return; } @@ -145,25 +140,6 @@ void UILiteSurfaceView::Flush() } } -void UILiteSurfaceView::PreHandleStatus() -{ - if (currentBuffer_ == nullptr) { - return; - } - - if (currentBuffer_->format == PIXEL_FMT_BUTT) { - DisplayDev::GetInstance()->SetLayerColorKey(LAYER_0, false, 0); - currentBuffer_->format = PIXEL_FMT_YCBCR_420_SP; - surface_->ReleaseBuffer(currentBuffer_); - currentBuffer_ = nullptr; - isStopped_ = true; - isFirstFrameCome_ = false; - } else if (currentBuffer_->format != PIXEL_FMT_BUTT && isStopped_) { - DisplayDev::GetInstance()->SetLayerColorKey(LAYER_0, true, colorKey_.full); - isStopped_ = false; - } -} - void UILiteSurfaceView::PostFlush() { if (currentBuffer_ != nullptr) { @@ -210,21 +186,31 @@ void UILiteSurfaceView::InitLayer() #ifdef VERSION_IOT bool UILiteSurfaceView::GetBitmap(ImageInfo& bitmap) { - if (lastFlushedBuffer_ == nullptr) { + if (!isFirstFrameCome_) { UIView::GetBitmap(bitmap); } else { + SurfaceBuffer* buff; + if (lastFlushedBuffer_ != nullptr) { + buff = lastFlushedBuffer_; + } else { + buff = surface_->GetBackBuf(); + } + + if (buff == nullptr) { + GRAPHIC_LOGE("buff is null!\n"); + return false; + } CscYuvBuf yuv = {0}; - yuv.yAddr = (uint8_t*)lastFlushedBuffer_->addr; - yuv.uvAddr = (uint8_t*)yuv.yAddr + ALIGN_BYTE(lastFlushedBuffer_->width, YUV_WIDTH_ALIGNMENT) * - lastFlushedBuffer_->height; - yuv.width = lastFlushedBuffer_->width; - yuv.height = lastFlushedBuffer_->height; - yuv.yStride = ALIGN_BYTE(lastFlushedBuffer_->width, YUV_WIDTH_ALIGNMENT); - yuv.uvStride = ALIGN_BYTE(lastFlushedBuffer_->width, YUV_WIDTH_ALIGNMENT); + yuv.yAddr = reinterpret_cast(buff->addr); + yuv.uvAddr = static_cast(yuv.yAddr) + ALIGN_BYTE(buff->width, YUV_WIDTH_ALIGNMENT) * buff->height; + yuv.width = buff->width; + yuv.height = buff->height; + yuv.yStride = ALIGN_BYTE(buff->width, YUV_WIDTH_ALIGNMENT); + yuv.uvStride = ALIGN_BYTE(buff->width, YUV_WIDTH_ALIGNMENT); CscRgbBuf rgb = {0}; - rgb.width = lastFlushedBuffer_->width; - rgb.height = lastFlushedBuffer_->height; + rgb.width = buff->width; + rgb.height = buff->height; rgb.stride = ALIGN_BYTE(rgb.width, BYTE_ALIGNMENT) * 3; // 3: 3 bytes for rgb888 bitmap.header.colorMode = RGB888; @@ -234,7 +220,11 @@ bool UILiteSurfaceView::GetBitmap(ImageInfo& bitmap) bitmap.header.compressMode = 0; bitmap.header.reserved = 0; rgb.addr = reinterpret_cast(ImageCacheMalloc(bitmap)); - CscConvertYuvToRgb(&rgb, &yuv); + if (rgb.addr != nullptr) { + CscConvertYuvToRgb(&rgb, &yuv); + } else { + GRAPHIC_LOGE("UILiteSurfaceView::GetBitmap img alloc failed! size: 0x%x\n", bitmap.dataSize); + } } return true; } @@ -262,6 +252,25 @@ void UILiteSurfaceView::BlitBitmapToFb(BufferInfo& gfxDstBuffer, const Rect& inv } #endif +void UILiteSurfaceView::AdjustArea(Rect& rect) +{ + if (rect.GetX() % 2 != 0) { // 2: mod + if (rect.GetX() < 0) { + rect.SetX(rect.GetX() + 1); + } else { + rect.SetX(rect.GetX() - 1); + } + } + + if (rect.GetY() % 2 != 0) { // 2: mod + if (rect.GetY() < 0) { + rect.SetY(rect.GetY() + 1); + } else { + rect.SetY(rect.GetY() - 1); + } + } +} + void UILiteSurfaceView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) { if (surface_ == nullptr) { @@ -269,8 +278,15 @@ void UILiteSurfaceView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidated return; } + if (!isFirstFrameCome_ && preView_ != nullptr) { + const ImageInfo* info = preView_->GetImageInfo(); + Rect coords(GetX(), GetY(), GetX() + info->header.width - 1, GetY() + info->header.height - 1); + preView_->DrawImage(gfxDstBuffer, coords, invalidatedArea, *style_, opaScale_); + return; + } + #ifdef VERSION_IOT - if (lastFlushedBuffer_ != nullptr && RootView::GetInstance()->GetSnapshotFlag()) { + if (isFirstFrameCome_ && RootView::GetInstance()->GetSnapshotFlag()) { ImageInfo bitmap; GetBitmap(bitmap); BlitBitmapToFb(gfxDstBuffer, invalidatedArea, bitmap); @@ -286,6 +302,7 @@ void UILiteSurfaceView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidated if (!(layerRect_ == GetRect())) { layerRect_ = GetRect(); + AdjustArea(layerRect_); Rect dirtyRect(0, 0, layerRect_.GetWidth() - 1, layerRect_.GetHeight() - 1); DisplayDev::GetInstance()->SetLayerPositon(LAYER_1, layerRect_.GetX(), layerRect_.GetY()); DisplayDev::GetInstance()->SetLayerDirtyRegion(LAYER_1, dirtyRect); @@ -296,18 +313,55 @@ void UILiteSurfaceView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidated void UILiteSurfaceView::OnBufferAvailable() { lock_.Lock(); - ++flushCount_; - lock_.Unlock(); - if (!isFirstFrameCome_) { - isFirstFrameCome_ = true; + SurfaceBuffer* back = surface_->GetBackBuf(); + bool isLastFrame = (back->format == PIXEL_FMT_BUTT); + if (isLastFrame) { + back->format = PIXEL_FMT_YCBCR_420_SP; + isFirstFrameCome_ = false; + flushCount_ = 0; + } else { + ++flushCount_; } - if (!isLayerInit_) { - InitLayer(); + lock_.Unlock(); + + if (isLastFrame) { + GraphicService::GetInstance()->PostGraphicEvent( + [&] { + if (surface_ != nullptr) { + isStopped_ = true; + DisplayDev::GetInstance()->SetLayerColorKey(LAYER_0, false, 0); + LiteMGfxEngine::GetInstance()->ClearHardwareLayer(); + LiteMGfxEngine::GetInstance()->EnableAsyncMode(true); + surface_->ClearBuffers(); + currentBuffer_ = nullptr; + lastFlushedBuffer_ = nullptr; + } + }); + } else if (!isFirstFrameCome_) { + GraphicService::GetInstance()->PostGraphicEvent( + [&] { + LiteMGfxEngine::GetInstance()->EnableAsyncMode(false); + LiteMGfxEngine::GetInstance()->AddHardwareLayer(this); + DisplayDev::GetInstance()->SetLayerColorKey(LAYER_0, true, colorKey_.full); + InitLayer(); + isStopped_ = false; + isFirstFrameCome_ = true; + }); } - OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent( + + GraphicService::GetInstance()->PostGraphicEvent( [] { RootView::GetInstance()->Invalidate(); - }, - false); + }); +} + +void UILiteSurfaceView::SetPreview(ImageInfo* info) +{ + if (preView_ == nullptr) { + preView_ = new Image(); + } + if (preView_ != nullptr) { + preView_->SetSrc(info); + } } } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/map_svg_parser.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/map_svg_parser.h new file mode 100644 index 000000000..e7473193d --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/map_svg_parser.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ +#ifndef GRAPHIC_LITE_MAP_SVG_PARSER_H +#define GRAPHIC_LITE_MAP_SVG_PARSER_H +#include +#include "gfx_utils/color.h" + +namespace OHOS { +struct MapRect { + int16_t x; + int16_t y; + int16_t width; + int16_t height; +}; + +struct PathStyle { + uint8_t strokeCap : 4; + uint8_t strokeJoin : 4; + Color24 strokeColor; + Color24 fillColor; + float strokeWidth; +}; + +struct MapPathBase { + uint8_t type; + uint8_t pathStyleIndex; + uint16_t cmdNum; + uint16_t dataNum; +}; + +struct PathDetail { + MapPathBase base; + uint8_t* cmd; + float* data; +}; + +struct ImageBase { + uint8_t id; + MapRect rect; +}; + +struct ImageDetail { + ImageBase base; + ImageInfo* info; +}; + +struct MapTextBase { + uint8_t fontSize; + Color24 fontColor; + Color24 strokeColor; + float strokeWidth; + MapRect rect; + uint16_t charLen; +}; + +struct TextDetail { + MapTextBase base; + char* text; + Point* offset; +}; + +struct POIDetail { + int8_t imgIndex; + int8_t textIndex[2]; + uint8_t tag; + uint16_t rank; + uint16_t id; +}; + +struct RoadDetail { + int8_t textIndex; +}; + +class MapSVGParser { +public: + MapSVGParser(void); + virtual ~MapSVGParser(void); + + bool SetSVG(uint8_t* data, uint32_t length); + Color24 GetBackGroundColor(void); + uint32_t GetImageOffset(void); + void GetSize(int16_t& width, int16_t& height); + + uint8_t GetPaths(PathDetail*& pathList); + uint8_t GetPOIs(POIDetail*& poiList); + uint8_t GetRoads(RoadDetail*& roadList); + + PathStyle* GetPathStyleByIndex(uint8_t index); + TextDetail* GetTextByIndex(uint8_t index); + ImageDetail* GetImageByIndex(uint8_t index); + void ClearSVG(); + +private: + struct MapHeader { + Color24 bgColor; + uint8_t nodeNum; + uint8_t pathStyleNum; + int16_t width; + int16_t height; + uint32_t imgDataOffset; + }; + + struct MapNode { + uint8_t type; + uint8_t count; + uint32_t offset; + }; + + static constexpr uint8_t PARSER_TYPE_NUM = 5; + using MapTypeParserInit = uint32_t (MapSVGParser::*)( + uint8_t *data, uint32_t length, uint32_t offset, uint8_t count); + using MapTypeParserDeinit = void (MapSVGParser::*)(uint8_t count); + + uint32_t ReadMapNode(uint8_t* data, uint32_t length, uint32_t offset); + uint32_t ReadPathStyle(uint8_t* data, uint32_t length, uint32_t offset); + uint32_t ReadMapPath(uint8_t* data, uint32_t length, uint32_t offset, uint8_t count); + uint32_t ReadMapText(uint8_t* data, uint32_t length, uint32_t offset, uint8_t count); + uint32_t ReadMapImg(uint8_t* data, uint32_t length, uint32_t offset, uint8_t count); + uint32_t ReadMapRoad(uint8_t* data, uint32_t length, uint32_t offset, uint8_t count); + uint32_t ReadMapPOI(uint8_t* data, uint32_t length, uint32_t offset, uint8_t count); + uint32_t ReadImage(uint8_t* data, uint32_t length, uint32_t offset); + + void ReleaseMapPath(uint8_t count); + void ReleaseMapText(uint8_t count); + void ReleaseMapImg(uint8_t count); + void ReleaseMapRoad(uint8_t count); + void ReleaseMapPOI(uint8_t count); + void ReleaseResource(void); + bool AllocPath(PathDetail& path, uint32_t cmdNum, uint32_t dataNum); + + MapTypeParserInit parserInitFunc[PARSER_TYPE_NUM] = { &MapSVGParser::ReadMapPath, &MapSVGParser::ReadMapText, + &MapSVGParser::ReadMapImg, &MapSVGParser::ReadMapRoad, + &MapSVGParser::ReadMapPOI }; + MapTypeParserDeinit parserDeinitFunc[PARSER_TYPE_NUM] = { + &MapSVGParser::ReleaseMapPath, &MapSVGParser::ReleaseMapText, &MapSVGParser::ReleaseMapImg, + &MapSVGParser::ReleaseMapRoad, &MapSVGParser::ReleaseMapPOI + }; + + MapHeader mapHeader_ = {0}; + MapNode* nodeArray_ = nullptr; + PathStyle* pathStyleArray_ = nullptr; + PathDetail* pathArray_ = nullptr; + uint8_t pathCount_ = 0; + TextDetail* textArray_ = nullptr; + uint8_t textCount_ = 0; + ImageDetail* imageArray_ = nullptr; + uint8_t imageCount_ = 0; + RoadDetail* roadArray_ = nullptr; + uint8_t roadCount_ = 0; + POIDetail* poiArray_ = nullptr; + uint8_t poiCount_ = 0; + uint8_t* data_ = nullptr; +}; +} +#endif // GRAPHIC_LITE_MAP_SVG_PARSER_H diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/triangular_plane.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/triangular_plane.h new file mode 100644 index 000000000..74218512d --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/triangular_plane.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ + +#ifndef TRIANGULAR_PLANE_H +#define TRIANGULAR_PLANE_H + +#include "gfx_utils/graphic_math.h" +namespace OHOS { +class TriangularPlane : public HeapBase { +public: + TriangularPlane() {} + virtual ~TriangularPlane() {} + + void SetVertex(Vector3vertex1, Vector3vertex2, Vector3vertex3) + { + vertexes_[0] = vertex1; + vertexes_[1] = vertex2; + vertexes_[2] = vertex3; // 2:index + } + + void SetMatrix(Matrix4 matrix) + { + matrix_ = matrix; + } + + Matrix4 GetMatrix() + { + return matrix_; + } + + const Vector4 GetNormal() + { + float nx = (vertexes_[1].y_ - vertexes_[0].y_) * (vertexes_[2].z_ - vertexes_[0].z_) - // 2: vertex index + (vertexes_[1].z_ - vertexes_[0].z_) * (vertexes_[2].y_ - vertexes_[0].y_); // 2: vertex index + float ny = (vertexes_[1].z_ - vertexes_[0].z_) * (vertexes_[2].x_ - vertexes_[0].x_) - // 2: vertex index + (vertexes_[1].x_ - vertexes_[0].x_) * (vertexes_[2].z_ - vertexes_[0].z_); // 2: vertex index + float nz = (vertexes_[1].x_ - vertexes_[0].x_) * (vertexes_[2].y_ - vertexes_[0].y_) - // 2: vertex index + (vertexes_[1].y_ - vertexes_[0].y_) * (vertexes_[2].x_ - vertexes_[0].x_); // 2: vertex index + return Vector4(nx, ny, nz, 0); + } + + Vector3& operator[](uint8_t index) + { + return vertexes_[index]; + } + + const Vector3 operator[](uint8_t index) const + { + return vertexes_[index]; + } + +private: + static constexpr uint8_t MAX_VERTEX_NUM = 3; // 3: triangular vertex number + Vector3 vertexes_[MAX_VERTEX_NUM]; // the vertexes of polygon + Matrix4 matrix_; +}; +} +#endif // TRIANGULAR_PLANE_H \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/ui_card_container.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/ui_card_container.h index 0ada8aa61..7f572ff1b 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/ui_card_container.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext/ui_card_container.h @@ -15,13 +15,16 @@ namespace OHOS { class UICardContainer : public UIViewGroup { public: UICardContainer(); - virtual ~UICardContainer() override; - void SwitchCardToBitmap(bool bitMapFromFB = false); + ~UICardContainer() override; + UICardContainer(const UICardContainer &) = delete; + UICardContainer &operator=(const UICardContainer &) = delete; + void SwitchCardToBitmap(bool isNeedClip, bool bitMapFromFB = false); void SwitchBitmapToCard(void); void SetCardPage(UICardPage* page) { cardPage_ = page; + Add(cardPage_); Resize(page->GetWidth(), page->GetHeight()); } @@ -30,10 +33,10 @@ public: return cardPage_; } - UIImageView* GetCardimg(void) + UIImageView* GetCardimg(bool isNeedClip) { if (!isBitMapExist_) { - SwitchCardToBitmap(); + SwitchCardToBitmap(isNeedClip); } return imgView_; } @@ -51,7 +54,14 @@ private: bool OnDragStartEvent(const DragEvent& event) override; bool OnDragEvent(const DragEvent& event) override; bool OnDragEndEvent(const DragEvent& event) override; - bool IsVideoContained(UIView* view); + bool OnLongPressEvent(const LongPressEvent& event) override; + bool OnClickEvent(const ClickEvent& event) override; + bool OnPressEvent(const PressEvent& event) override; + bool OnReleaseEvent(const ReleaseEvent& event) override; + bool OnCancelEvent(const CancelEvent& event) override; +#if ENABLE_ROTATE_INPUT + bool OnRotateEvent(const RotateEvent& event) override; +#endif }; } #endif diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.cpp index 960e76139..ca7d64cc4 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.cpp @@ -44,11 +44,10 @@ void ClipImg::ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, const Path* uintptr_t handle = LiteMGfxEngine::GetInstance()->InitPath(true); LiteMGfxEngine::GetInstance()->SetPathData(handle, path->cmdNum, path->cmds, path->dataNum, path->data); LiteMGfxEngine::GetInstance()->ClipImgByPath(dstInfo, srcInfo, handle, srcImgArea, pathMatrix, imgMatrix); - LiteMGfxEngine::GetInstance()->SyncHwDraw(); } -ImageInfo ClipImg::ClipImgByCircle(ImageInfo& srcInfo, Rect* srcImgArea, Point center, int16_t radius, - ColorMode mode) +ImageInfo ClipImg::ClipImgByCircle(ImageInfo& srcInfo, Point center, int16_t radius, + ColorMode mode, bool immediatelySync) { ImageInfo dstInfo = {{0}}; Path path = {0}; @@ -63,6 +62,9 @@ ImageInfo ClipImg::ClipImgByCircle(ImageInfo& srcInfo, Rect* srcImgArea, Point c } ClipImgByPath(dstInfo, srcInfo, &path, nullptr, nullptr, nullptr); + if (immediatelySync) { + LiteMGfxEngine::GetInstance()->SyncHwDraw(); + } ClearPath(&path); return dstInfo; } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h index 222a00ab9..f16b708b2 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/clip_img.h @@ -20,8 +20,8 @@ class ClipImg : public HeapBase { public: static void ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, const Path* path, Rect* srcImgArea, const Matrix4* pathMatrix, const Matrix4* imgMatrix); - static ImageInfo ClipImgByCircle(ImageInfo& srcInfo, Rect* srcImgArea, Point center, int16_t radius, - ColorMode mode = RGB888); + static ImageInfo ClipImgByCircle(ImageInfo& srcInfo, Point center, int16_t radius, + ColorMode mode = RGB888, bool immediatelySync = false); static ImageInfo ClipImgByRect(ImageInfo& srcInfo, Rect* srcImgArea, Rect clipArea, ColorMode mode = RGB888); }; } // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp index 3d848f687..72db48c0b 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.cpp @@ -98,6 +98,37 @@ int8_t HWDrawUtils::GetArcData(float* arcData, const Point& center, return bezierSegmentCount; } +void HWDrawUtils::Obtain30DegSectorPath(const ArcInfo& arc, uint8_t* cmd, float* data) +{ + float startAngle = arc.startAngle; + float endAngle = arc.endAngle; + float angleExtend = endAngle - startAngle; + float neg = (startAngle < endAngle) ? 1 : -1; + + ConvertCircularDegree(startAngle); + float startAngleRad = startAngle / RADIAN_TO_ANGLE; + float extendRad = static_cast(angleExtend) / RADIAN_TO_ANGLE; + float endAngleRad = startAngleRad + extendRad; + + cmd[0] = CMD_MOVE_TO; + cmd[1] = CMD_LINE_TO; + cmd[2] = CMD_CUBIC_TO; // 2: index + cmd[3] = CMD_CLOSE; // 3: index + + float a = startAngleRad + neg * RAD_90_DEG; + a = RAD_90_DEG - (a - endAngleRad) * neg; + + data[0] = arc.center.x; + data[1] = arc.center.y; + data[2] = arc.center.x + arc.radius * cos(startAngleRad); // 2: index + data[3] = arc.center.y + arc.radius * sin(startAngleRad); // 3: index + data[8] = arc.center.x + arc.radius * cos(endAngleRad); // 8: index + data[9] = arc.center.y + arc.radius * sin(endAngleRad); // 9: index + + float magicNum = 4.0f / 3.0f * (1 - cos(a / 2)) / sin(a / 2); // 2: divisor + GetArcControlPoint(&data[2], arc.center, magicNum, neg); // 2: index +} + bool HWDrawUtils::ObtainArcPath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data) { float startAngle = arc.startAngle; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.h index 2136aab96..1284abfd7 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/draw/hw_draw_utils.h @@ -31,6 +31,7 @@ public: bool ObtainArcPath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data); bool ObtainCirclePath(const ArcInfo& arc, uint32_t& cmdNum, uint8_t*& cmds, uint32_t& dataNum, float*& data); bool AllocBufferForData(uint16_t dataNum, float*& addr); + void Obtain30DegSectorPath(const ArcInfo& arc, uint8_t* cmd, float* data); private: HWDrawUtils() {} diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h index b3b57512d..43de3905c 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/engines/gfx/lite_m_gfx_engine.h @@ -124,7 +124,7 @@ public: void RenderPath(BufferInfo& dst, uintptr_t path, const Rect& mask, VGUStrokeAttr* strokeAttr, VGUFillAttr* fillAttr, VGUMatrix3* matrix); - void ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, uintptr_t path, Rect* srcArea, + void ClipImgByPath(ImageInfo& dstInfo, ImageInfo& srcInfo, uintptr_t path, Rect* srcImgArea, const Matrix4* pathMatrix, const Matrix4* imgMatrix); bool Convert2VGUFormat(const ColorMode& colorMode, VGUPixelFormat& dstColorFmt) const; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h index 5ee348f0f..b05514280 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/ui/frameworks/swipe_effect/turn_page_effect.h @@ -12,7 +12,10 @@ namespace OHOS { class TurnPageEffect : public CardSwipe, public UISwipeView::OnSwipeListener { public: - TurnPageEffect(void) {} + TurnPageEffect(void) + { + isNeedClip_ = true; + } ~TurnPageEffect() override {} void CardSwipeAlg(UICardPage* leftCard, UICardPage* rightCard, int16_t xOffset) override; void CardSwipeAlg(UIImageView* leftCard, UIImageView* rightCard, int16_t xOffset) override; diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp index bc2163186..b173f99fc 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/display_dev.cpp @@ -43,7 +43,7 @@ void DisplayDev::LcdFlush(uint8_t layerId) } if (layerFuncs_->Flush != nullptr) { if (layerId == LAYER_MAX) { - if (layerFuncs_->Flush(0, 0, NULL) != DISPLAY_SUCCESS) { + if (layerFuncs_->Flush(0, 0, nullptr) != DISPLAY_SUCCESS) { GRAPHIC_LOGE("flush failed."); } return; @@ -159,7 +159,7 @@ bool DisplayDev::OpenLayer(uint8_t layerId, const LayerInfo& info, uint8_t buffe } if (layer_[layerId].bufferCount != 0) { - GRAPHIC_LOGE("layer[%u] is already opened with BufferNo[%u].", layerId, layer_[layerId].bufferCount); + GRAPHIC_LOGD("layer[%u] is already opened with bufferCount[%u].", layerId, layer_[layerId].bufferCount); return false; } @@ -394,7 +394,7 @@ void DisplayDev::SetLayerZOrder(uint8_t layerId, uint8_t order) } } -void DisplayDev::SetLayerPositon(uint8_t layerId, uint8_t x, uint8_t y) +void DisplayDev::SetLayerPositon(uint8_t layerId, int16_t x, int16_t y) { if (layerId < LAYER_0 || layerId >= LAYER_MAX) { GRAPHIC_LOGE("Invalid layerId[%u].", layerId); diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp index b14181307..2ff3022db 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/hals/gralloc_engines.cpp @@ -13,11 +13,15 @@ * limitations under the License. */ -#include "hals/gralloc_engines.h" #include +#ifdef __LITEOS__ +#include "los_memory_pri.h" +#endif #include "display_type.h" #include "gfx_utils/graphic_log.h" #include "securec.h" +#include "common/image_cache_manager.h" +#include "hals/gralloc_engines.h" namespace OHOS { static std::unordered_map g_buffers; @@ -40,14 +44,14 @@ bool GrallocEngines::Init() return true; } -bool GrallocEngines::AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer) +bool GrallocEngines::AllocBufferOnce(const AllocInfo& info, GrallocBuffer& buffer) { if (grallocFuncs_ == nullptr) { GRAPHIC_LOGE("GrallocEngines not init!"); return false; } BufferHandle* bufferHandle = nullptr; - if (grallocFuncs_->AllocMem(&info, &bufferHandle) != DISPLAY_SUCCESS) { + if (grallocFuncs_->AllocMem(&info, &bufferHandle) != DISPLAY_SUCCESS || bufferHandle == nullptr) { return false; } g_buffers.insert(std::make_pair(reinterpret_cast(bufferHandle->virAddr), bufferHandle)); @@ -59,6 +63,32 @@ bool GrallocEngines::AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer) return true; } +bool GrallocEngines::AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer) +{ + if (grallocFuncs_ == nullptr && info.expectedSize == 0) { + GRAPHIC_LOGE("alloc failed!!, size: %u", info.expectedSize); + return false; + } + + if (!AllocBufferOnce(info, buffer)) { + GRAPHIC_LOGE("GrallocEngines::AllocBuffer realloc size: %u", info.expectedSize); + if (ImageCacheManager::GetInstance().FreeAndGetBuf(info, buffer) == nullptr) { + DumpMem(); +#ifdef __LITEOS__ + OsMemInfoPrint(reinterpret_cast(MEM_POOL_UI_OTHER)); +#endif + return false; + } + } + if ((info.usage & HBM_USE_MEM_YUV) == HBM_USE_MEM_YUV) { + yuvBufCnt_++; + if (yuvBufCnt_ > 3) { // 3: yuv buf cnt + GRAPHIC_LOGW("Count of yuv buffer is %d. It should not be greater than 3.", yuvBufCnt_); + } + } + return true; +} + void GrallocEngines::FreeBuffer(uint8_t* virAddr) { if (grallocFuncs_ == nullptr) { @@ -75,6 +105,9 @@ void GrallocEngines::FreeBuffer(uint8_t* virAddr) if (iter != g_buffers.end()) { BufferHandle* handle = iter->second; if (handle != nullptr) { + if ((handle->usage & HBM_USE_MEM_YUV) == HBM_USE_MEM_YUV) { + yuvBufCnt_--; + } g_buffers.erase(iter); grallocFuncs_->FreeMem(handle); } diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h index ef30654de..7d4094d31 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/display_dev.h @@ -97,7 +97,7 @@ public: /** * @brief set layer position. */ - void SetLayerPositon(uint8_t layerId, uint8_t x, uint8_t y); + void SetLayerPositon(uint8_t layerId, int16_t x, int16_t y); /** * @brief set layer visible state. diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h index af7a4c05b..960ee09e9 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h @@ -39,6 +39,7 @@ public: bool Init(); bool AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer); + bool AllocBufferOnce(const AllocInfo& info, GrallocBuffer& buffer); void FreeBuffer(uint8_t* virAddr); #if ENABLE_MEMORY_CHECK void DumpMem(); @@ -46,6 +47,7 @@ public: private: GrallocEngines() : grallocFuncs_(nullptr) {} ~GrallocEngines() {} + uint8_t yuvBufCnt_ = 0; GrallocFuncs* grallocFuncs_; }; } // end namespace diff --git a/code/sdk/middleware/services/gui/uikit/res/hexagons.bin b/code/sdk/middleware/services/gui/uikit/res/hexagons.bin new file mode 100644 index 000000000..f3dc2e88b Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/hexagons.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_dial.bin b/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_dial.bin new file mode 100644 index 000000000..4c1cfd090 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/kaleidoscope_dial.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/res/map.bin b/code/sdk/middleware/services/gui/uikit/res/map.bin new file mode 100644 index 000000000..1aa3a3ad2 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/map.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/res/panda_first.bin b/code/sdk/middleware/services/gui/uikit/res/panda_first.bin new file mode 100644 index 000000000..a22abc5e8 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/panda_first.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/res/regular_hexagon.bin b/code/sdk/middleware/services/gui/uikit/res/regular_hexagon.bin new file mode 100644 index 000000000..b2174b487 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/regular_hexagon.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/res/regular_hexagon_inverse.bin b/code/sdk/middleware/services/gui/uikit/res/regular_hexagon_inverse.bin new file mode 100644 index 000000000..7d8eeba27 Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/res/regular_hexagon_inverse.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp new file mode 100644 index 000000000..6e9ce0650 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.cpp @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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 "ui_test_coverflow.h" +#include "common/screen.h" +#include "font/ui_font.h" +#include "gfx_utils/graphic_math.h" +#include "gfx_utils/rect.h" +#include "common/image_cache_manager.h" + +namespace OHOS { +namespace { +struct FaceInfo { + const char* name; + const char* path; +} ; + +static constexpr uint8_t COVERFLOW_MAX_PAGE_NUM = 6; +static FaceInfo g_faceInfo[COVERFLOW_MAX_PAGE_NUM] = { + {"1 rainbow", RES_PATH"/rainbow.bin"}, + {"2 kaleidoscope", RES_PATH"/kaleidoscope.bin"}, + {"3 planet", RES_PATH"/planet.bin"}, + {"4 rainbow", RES_PATH"/rainbow.bin"}, + {"5 kaleidoscope", RES_PATH"/kaleidoscope.bin"}, + {"6 planet", RES_PATH"/planet.bin"} +}; + +static constexpr uint8_t COVERFLOW_PRELOAD_PAGE_NUM = 3; +static constexpr int16_t LABEL_FONT_SIZE = 30; +static constexpr uint8_t DEFAULT_STEP = 10; +static constexpr uint16_t BUTTON_WIDTH = 60; +static constexpr uint16_t BUTTON_HEIGHT = 40; +static constexpr uint16_t BUTTON_GROUP_WIDTH = 300; +static constexpr uint16_t BUTTON_GROUP_HEIGHT = 80; +static constexpr uint8_t DIVISOR_TWO = 2; +} // namespace + +void UITestCoverflow::SetUp() +{ + if (container_ == nullptr) { + container_ = new UIScrollView(); + container_->SetThrowDrag(true); + container_->SetHorizontalScrollState(false); + container_->Resize(Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + } +} + +void UITestCoverflow::TearDown() +{ + container_->Remove(coverflow_); + DeleteChildren(container_); + if (container_ != nullptr) { + container_ = nullptr; + } + delete coverflow_; + coverflow_ = nullptr; + + label_ = nullptr; + lastIndex_ = 0; + showBtn_ = nullptr; + isShowBtnGrp_ = false; + btnGrp_ = nullptr; + loadNum_ = 0; + + addBtn_ = nullptr; + removeBtn_ = nullptr; + imgWidthAddBtn_ = nullptr; + imgWidthSubBtn_ = nullptr; + imgPaddingAddBtn_ = nullptr; + imgPaddingSubBtn_ = nullptr; + maxAngleAddBtn_ = nullptr; + maxAngleSubBtn_ = nullptr; + loopBtn_ = nullptr; + + imgWidth_ = 200; // 200: default value + imgPadding_ = 50; // 50: default value + mirrorOpa_ = 30; // 30: default value + rotateAngle_ = 70.0f; // 70: default value +} + +const UIView* UITestCoverflow::GetTestView() +{ + UITestCoverflowView001(); + return container_; +} + + +void UITestCoverflow::CreateLabelButton(UILabelButton** btn, const char* tile, int16_t x, int16_t y) +{ + UILabelButton* tempBtn = nullptr; + if (tempBtn == nullptr) { + tempBtn = new UILabelButton(); + } + tempBtn->SetPosition(x, y, BUTTON_WIDTH, BUTTON_HEIGHT); + tempBtn->SetText(tile); + tempBtn->SetOnClickListener(this); + btnGrp_->Add(tempBtn); + *btn = tempBtn; +} + +void UITestCoverflow::InitButtonGroup() +{ + if (showBtn_ == nullptr) { + showBtn_ = new UIButton(); + showBtn_->SetPosition(202, 10, BUTTON_WIDTH, BUTTON_HEIGHT); // 202: x position 10: y position + showBtn_->SetStyleForState(STYLE_BACKGROUND_OPA, 0, UIButton::ButtonState::RELEASED); + showBtn_->SetStyleForState(STYLE_BACKGROUND_OPA, 0, UIButton::ButtonState::PRESSED); + showBtn_->SetOnClickListener(this); + container_->Add(showBtn_); + } + if (btnGrp_ == nullptr) { + btnGrp_ = new UIViewGroup(); + btnGrp_->SetPosition(77, 40, BUTTON_GROUP_WIDTH, BUTTON_GROUP_HEIGHT); // 77: x position 40: y position + btnGrp_->SetStyle(STYLE_BACKGROUND_OPA, 0); + btnGrp_->SetVisible(false); + container_->Add(btnGrp_); + } + CreateLabelButton(&imgWidthAddBtn_, "wid+", 0, 0); + CreateLabelButton(&imgWidthSubBtn_, "wid-", 60, 0); // 60: x position + CreateLabelButton(&maxAngleAddBtn_, "ang+", 120, 0); // 120: x position + CreateLabelButton(&maxAngleSubBtn_, "ang-", 180, 0); // 180: x position + CreateLabelButton(&addBtn_, "add", 0, 40); // 40: y position + CreateLabelButton(&removeBtn_, "sub", 60, 40); // 60: x position 40: y position + CreateLabelButton(&loopBtn_, "loop", 120, 40); // 120: x position 40: y position + CreateLabelButton(&imgPaddingAddBtn_, "pad+", 180, 40); // 180: x position 40: y position + CreateLabelButton(&imgPaddingSubBtn_, "pad-", 240, 40); // 240: x position 40: y position +} + +void UITestCoverflow::UITestCoverflowView001() +{ + if (container_ != nullptr) { + if (coverflow_ == nullptr) { + coverflow_ = new UICoverflowView(); + } + coverflow_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + coverflow_->SetIntercept(true); + for (uint8_t i = 0; i < COVERFLOW_PRELOAD_PAGE_NUM; i++) { + ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(g_faceInfo[i].path)); + coverflow_->Add(g_faceInfo[i].name, src); + loadNum_++; + } + + if (label_ == nullptr) { + label_ = new UILabel(); + } + label_->SetPosition(127, 50, 200, 50); // 127 50 200 50: label position + label_->SetTextColor(Color::White()); + label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + lastIndex_ = coverflow_->GetCurrentPage(); + label_->SetText(g_faceInfo[lastIndex_].name); + label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_FONT_SIZE); + + coverflow_->SetOnCoverflowListener(this); + container_->Add(coverflow_); + container_->Add(label_); + InitButtonGroup(); + } +} + +bool UITestCoverflow::OnScroll() +{ + int16_t contMidX = static_cast(Screen::GetInstance().GetWidth() / DIVISOR_TWO); + int16_t minOffset = contMidX; + uint8_t newCenterIndex = lastIndex_; + for (uint8_t i = 0; i < coverflow_->GetChildrenNumber(); i++) { + Rect rect = coverflow_->GetViewByIndex(i)->GetOrigRect(); + int16_t x = rect.GetLeft(); + int16_t x1 = rect.GetRight(); + int16_t xMid = static_cast(x + (x1 - x + 1) / DIVISOR_TWO); + int16_t distance = MATH_ABS(xMid - contMidX); + if (distance < minOffset) { + newCenterIndex = i; + minOffset = distance; + } + } + if (newCenterIndex != lastIndex_) { + lastIndex_ = newCenterIndex; + label_->SetText(coverflow_->GetViewByIndex(lastIndex_)->GetViewId()); + } + + Rect curViewRect = coverflow_->GetViewByIndex(lastIndex_)->GetOrigRect(); + int16_t centerMid = curViewRect.GetLeft() + curViewRect.GetWidth() / DIVISOR_TWO; + int16_t offset = MATH_ABS(contMidX - centerMid); + if (offset > curViewRect.GetWidth() / DIVISOR_TWO) { + label_->SetStyle(STYLE_TEXT_OPA, 0); + } else { + uint8_t alpha = (uint8_t)((1.0f - ((float)offset / (curViewRect.GetWidth() / DIVISOR_TWO))) * OPA_OPAQUE); + label_->SetStyle(STYLE_TEXT_OPA, alpha); + } + return true; +} + +bool UITestCoverflow::OnClick(UIView& view, const ClickEvent& event) +{ + if (&view == showBtn_) { + btnGrp_->SetVisible(!btnGrp_->IsVisible()); + } else if (&view == loopBtn_) { + coverflow_->SetLoopState(true); + loopBtn_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Yellow().full); + } else if (&view == imgWidthAddBtn_) { + imgWidth_ += DEFAULT_STEP; + coverflow_->SetImgSize(imgWidth_, imgWidth_); + } else if (&view == imgWidthSubBtn_) { + imgWidth_ -= DEFAULT_STEP; + coverflow_->SetImgSize(imgWidth_, imgWidth_); + } else if (&view == imgPaddingAddBtn_) { + imgPadding_ += DEFAULT_STEP; + coverflow_->SetImgPadding(imgPadding_); + } else if (&view == imgPaddingSubBtn_) { + imgPadding_ -= DEFAULT_STEP; + coverflow_->SetImgPadding(imgPadding_); + } else if (&view == addBtn_) { + if (loadNum_ >= COVERFLOW_MAX_PAGE_NUM) { + return true; + } + ImageInfo* src = ImageCacheManager::GetInstance().LoadSingleRes(std::string(g_faceInfo[loadNum_].path)); + coverflow_->Add(g_faceInfo[loadNum_++].name, src); + } else if (&view == removeBtn_) { + if (loadNum_ > 0) { + coverflow_->Remove(g_faceInfo[--loadNum_].name); + } + } else if (&view == maxAngleAddBtn_) { + rotateAngle_ += 2.0; // 2.0 variables per click + coverflow_->SetRotateAngle(rotateAngle_); + } else if (&view == maxAngleSubBtn_) { + rotateAngle_ -= 2.0; // 2.0 variables per click + coverflow_->SetRotateAngle(rotateAngle_); + } + coverflow_->Invalidate(); + return true; +} +} // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h new file mode 100644 index 000000000..c62d78dcb --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_coverflow/ui_test_coverflow.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ + +#ifndef UI_TEST_COVERFLOW_VIEW_H +#define UI_TEST_COVERFLOW_VIEW_H + +#include "components/ui_coverflow_view.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label_button.h" +#include "animator/animator.h" +#include "ui_test.h" + +namespace OHOS { +class UITestCoverflow : public UITest, + public UICoverflowView::OnCoverflowScrollListener, public UIView::OnClickListener { +public: + UITestCoverflow() {} + ~UITestCoverflow() override {} + void SetUp() override; + void TearDown() override; + const UIView* GetTestView() override; + /** + * @brief Test display UICoverflow + */ + void UITestCoverflowView001(); + + bool OnScroll(); + + bool OnClick(UIView& view, const ClickEvent& event); +private: + void InitButtonGroup(); + void CreateLabelButton(UILabelButton** btn, const char* tile, int16_t x, int16_t y); + + UIScrollView* container_ = nullptr; + UICoverflowView* coverflow_ = nullptr; + UILabel* label_ = nullptr; + uint16_t lastIndex_ = 0; + UIButton* showBtn_ = nullptr; + bool isShowBtnGrp_ = false; + UIViewGroup* btnGrp_ = nullptr; + uint8_t loadNum_ = 0; + UILabelButton* addBtn_ = nullptr; + UILabelButton* removeBtn_ = nullptr; + UILabelButton* imgWidthAddBtn_ = nullptr; + UILabelButton* imgWidthSubBtn_ = nullptr; + UILabelButton* imgPaddingAddBtn_ = nullptr; + UILabelButton* imgPaddingSubBtn_ = nullptr; + UILabelButton* maxAngleAddBtn_ = nullptr; + UILabelButton* maxAngleSubBtn_ = nullptr; + UILabelButton* loopBtn_ = nullptr; + uint16_t imgWidth_ = 200; // 200: default value + uint16_t imgPadding_ = 50; // 50: default value + uint8_t mirrorOpa_ = 30; // 30: default value + float rotateAngle_ = 70.0f; // 70: default value +}; +} // namespace OHOS +#endif // UI_TEST_QRCODE_H diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp index 4a6bf3b75..dfbba8eee 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_cross/ui_test_cross.cpp @@ -23,7 +23,7 @@ static constexpr int16_t VIDEO_WIDTH = 454; static constexpr int16_t VIDEO_HEIGHT = 454; static constexpr int16_t CAMERA_DISTANCE = 600; static constexpr int16_t EASE_RANGE = 100; -static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 64; +static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 128; static constexpr int16_t BUFFER_QUEUE_SIZE = 2; static constexpr int16_t JPEG_HEIGHT_DIVISOR = 2; static constexpr int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128; @@ -58,11 +58,11 @@ static void ScreenStatusNotify(ScreenStatus status) static void GetTime(char* buf, int len) { struct timeval tv; - gettimeofday(&tv, NULL); - uint32_t second = tv.tv_sec % TIME_CONVERT; - uint32_t minute = tv.tv_sec / TIME_CONVERT; - uint32_t hour = (minute / TIME_CONVERT) % 24; // 24: 24 hours per day - uint32_t realMilliSecond = tv.tv_usec / USEC_TO_MILLI; + gettimeofday(&tv, nullptr); + int32_t second = tv.tv_sec % TIME_CONVERT; + int32_t minute = tv.tv_sec / TIME_CONVERT; + int32_t hour = (minute / TIME_CONVERT) % 24; // 24: 24 hours per day + int32_t realMilliSecond = tv.tv_usec / USEC_TO_MILLI; minute = minute % TIME_CONVERT; sprintf_s(buf, len, "%02d : %02d : %02d : %03d", hour, minute, second, realMilliSecond); diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp new file mode 100644 index 000000000..5cb89642e --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.cpp @@ -0,0 +1,236 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#include "ui_test_hexagons_list/ui_test_hexagons_list.h" +#include "components/root_view.h" +#include "components/ui_image_view.h" +#include "common/image_cache_manager.h" +#include "common/screen.h" +#include "ui_test_list_fps/ui_list_fps_res.h" +#include "dock/focus_manager.h" + +namespace OHOS { +const uint8_t IMG_COUNT = 45; +const uint8_t IMG_DISTANCE_DELTA = 1; +const uint8_t IMG_SIZE_DELTA = 1; +const int16_t BUTTON_SIZE = 60; +const float IMG_SCALE_FACTOR_DELTA = 0.01f; +const int16_t MARGIN_DELTA = 1; +const int16_t BORDER_RADIUS_DELTA = 1; +const float GLOBAL_SCALE = 1.0f; +const float GLOBAL_SCALE_DELTA = 0.02f; +const float CLICK_SCALE_TARGET_IN_NORMAL = 2.0f; + +void UITestHexagonsList::ConfigButtonAttr(UIView& view, int16_t x, int16_t y, int16_t width, int16_t height) +{ + view.SetOpaScale(OPA_TRANSPARENT); + view.SetOnClickListener(this); + view.SetOnLongPressListener(this); + view.SetPosition(x, y, width, height); + container_->Add(&view); +} + +void UITestHexagonsList::SetUpButtons(int16_t xEnd, int16_t yEnd, int16_t xMiddle, int16_t yMiddle) +{ + if (modifyImgSizeButton_ == nullptr) { + modifyImgSizeButton_ = new UIButton(); + ConfigButtonAttr(*modifyImgSizeButton_, xMiddle - BUTTON_SIZE, 0, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyImgDistanceButton_ == nullptr) { + modifyImgDistanceButton_ = new UIButton(); + ConfigButtonAttr(*modifyImgDistanceButton_, xMiddle, 0, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyScaleFatorButton_ == nullptr) { + modifyScaleFatorButton_ = new UIButton(); + ConfigButtonAttr(*modifyScaleFatorButton_, xEnd - BUTTON_SIZE, yMiddle - BUTTON_SIZE, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyGlobalScaleButton_ == nullptr) { + modifyGlobalScaleButton_ = new UIButton(); + ConfigButtonAttr(*modifyGlobalScaleButton_, xEnd - BUTTON_SIZE, yMiddle, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyHorMarginButton_ == nullptr) { + modifyHorMarginButton_ = new UIButton(); + ConfigButtonAttr(*modifyHorMarginButton_, xMiddle - BUTTON_SIZE, yEnd - BUTTON_SIZE, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyVerMarginButton_ == nullptr) { + modifyVerMarginButton_ = new UIButton(); + ConfigButtonAttr(*modifyVerMarginButton_, xMiddle, yEnd - BUTTON_SIZE, BUTTON_SIZE, BUTTON_SIZE); + } + if (modifyBorderRadiusButton_ == nullptr) { + modifyBorderRadiusButton_ = new UIButton(); + ConfigButtonAttr(*modifyBorderRadiusButton_, xMiddle - BUTTON_SIZE, yMiddle, BUTTON_SIZE, BUTTON_SIZE); + } +} + +void UITestHexagonsList::SetUp() +{ + if (container_ == nullptr) { + container_ = new UIViewGroup(); + } + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + if (hexagonsList_ == nullptr) { + hexagonsList_ = new UICustomHexagonsList(); + } + container_->Add(hexagonsList_); + + if (Screen::GetInstance().GetScreenShape() == RECTANGLE) { + borderRadius_ = Screen::GetInstance().GetWidth() * 0.336; // 0.336, empirical coefficient + hexagonsList_->SetStyle(STYLE_BORDER_RADIUS, borderRadius_); + // STYLE_BORDER_WIDTH was used to debug, it should be removed in the actual running content + hexagonsList_->SetStyle(STYLE_BORDER_WIDTH, 1); + hexagonsList_->SetStyle(STYLE_MARGIN_LEFT, horMargin_); + hexagonsList_->SetStyle(STYLE_MARGIN_RIGHT, horMargin_); + hexagonsList_->SetStyle(STYLE_MARGIN_TOP, verMargin_); + hexagonsList_->SetStyle(STYLE_MARGIN_BOTTOM, verMargin_); + hexagonsList_->SetStyle(STYLE_BORDER_COLOR, Color::Red().full); + imgDistance_ = container_->GetWidth() * 0.31; // 0.31, empirical coefficient + imgSize_ = container_->GetWidth() * 0.27; // 0.27, empirical coefficient + } else { + imgDistance_ = container_->GetWidth() * 0.25991; // 0.25991, empirical coefficient + imgSize_ = container_->GetWidth() * 0.23348; // 0.23348, empirical coefficient + } + hexagonsList_->SetPosition(0, 0, + container_->GetWidth() - 2 * (horMargin_ + 1), container_->GetHeight() - 2 * (verMargin_ + 1)); // 2, two + + ImageInfo* info = ImageCacheManager::GetInstance().LoadSingleRes(RES_PATH"hexagons.bin"); + for (int16_t i = 0; i < IMG_COUNT; i++) { + UIImageView* img = new UIImageView(); + img->SetSrc(info); + img->SetTouchable(true); + img->SetOnClickListener(this); + hexagonsList_->Add(img); + } + imgScaleFactor_ = hexagonsList_->GetScaleFactorByDistance(); + globalScale_ = hexagonsList_->GetGlobalScale(); + hexagonsList_->SetImageDistance(imgDistance_); + hexagonsList_->SetImageSizeInCenter(imgSize_); + int16_t blankSize = hexagonsList_->GetRelativeRect().GetWidth() > hexagonsList_->GetRelativeRect().GetHeight() ? + hexagonsList_->GetRelativeRect().GetWidth() / 2 : hexagonsList_->GetRelativeRect().GetHeight() / 2; // 2, half + hexagonsList_->SetScrollBlankSize(blankSize); + hexagonsList_->SetReboundSize(blankSize); + hexagonsList_->SetThrowDrag(true); + hexagonsList_->LayoutChildren(true); + SetUpButtons(container_->GetWidth() - 1, container_->GetHeight() - 1, + container_->GetWidth() / 2, container_->GetHeight() / 2); // 2, half size + FocusManager::GetInstance()->RequestFocus(hexagonsList_); +} + +void UITestHexagonsList::TearDown() +{ + FocusManager::GetInstance()->ClearFocus(); + DeleteChildren(container_); + container_ = nullptr; + hexagonsList_ = nullptr; + modifyImgSizeButton_ = nullptr; + modifyImgDistanceButton_ = nullptr; + modifyScaleFatorButton_ = nullptr; + modifyGlobalScaleButton_ = nullptr; + modifyHorMarginButton_ = nullptr; + modifyVerMarginButton_ = nullptr; + modifyBorderRadiusButton_ = nullptr; +} + +void UITestHexagonsList::HandleClickEventForRectScreen(const UIView& view) +{ + if (modifyHorMarginButton_ == &view) { + horMargin_ += isIncreaseHorMargin_ ? MARGIN_DELTA : -MARGIN_DELTA; + horMargin_ = horMargin_ < 0 ? 0 : horMargin_; + hexagonsList_->SetPosition(horMargin_, verMargin_, + container_->GetWidth() - 2 * (horMargin_ + 1), container_->GetHeight() - 2 * (verMargin_ + 1)); // 2, two + hexagonsList_->LayoutChildren(true); + } else if (modifyVerMarginButton_ == &view) { + verMargin_ += isIncreaseVerMargin_ ? MARGIN_DELTA : -MARGIN_DELTA; + verMargin_ = verMargin_ < 0 ? 0 : verMargin_; + hexagonsList_->SetPosition(horMargin_, verMargin_, + container_->GetWidth() - 2 * (horMargin_ + 1), container_->GetHeight() - 2 * (verMargin_ + 1)); // 2, two + hexagonsList_->LayoutChildren(true); + } else if (modifyBorderRadiusButton_ == &view) { + borderRadius_ += isIncreaseBorderRadius_ ? BORDER_RADIUS_DELTA : -BORDER_RADIUS_DELTA; + borderRadius_ = borderRadius_ < 0 ? 0 : borderRadius_; + int8_t index = hexagonsList_->GetFocusedImgIndex(); + hexagonsList_->SetStyle(STYLE_BORDER_RADIUS, borderRadius_); + } + container_->Invalidate(); +} + +bool UITestHexagonsList::OnClick(UIView& view, const ClickEvent& event) +{ + // Handle content click for image view + if (view.GetViewType() == UI_IMAGE_VIEW) { + uint8_t index = static_cast(view.GetViewIndex()); + float scaleInSmall = hexagonsList_->GetScaleInSmallState(); + Vector2 center(hexagonsList_->GetWidth() / 2, hexagonsList_->GetHeight() / 2); // 2, center + Vector2 delta = center - hexagonsList_->GetCurrentPosition(index); + if (FloatEqual(hexagonsList_->GetGlobalScale(), scaleInSmall)) { + hexagonsList_->StartRotateAnimator(index, delta.x_, delta.y_, scaleInSmall, 1.0f); + } else if (FloatEqual(hexagonsList_->GetGlobalScale(), 1.0f)) { + hexagonsList_->StartRotateAnimator(index, delta.x_, delta.y_, 1.0f, CLICK_SCALE_TARGET_IN_NORMAL); + } else if (FloatEqual(hexagonsList_->GetGlobalScale(), CLICK_SCALE_TARGET_IN_NORMAL)) { + hexagonsList_->StartRotateAnimator(index, delta.x_, delta.y_, CLICK_SCALE_TARGET_IN_NORMAL, 1.0f); + } + } + + if (modifyImgSizeButton_ == &view) { + imgSize_ += isIncreaseImgSize_ ? IMG_SIZE_DELTA : -IMG_SIZE_DELTA; + hexagonsList_->SetImageSizeInCenter(imgSize_); + hexagonsList_->LayoutChildren(true); + } else if (modifyImgDistanceButton_ == &view) { + imgDistance_ += isIncreaseImgDistance_ ? IMG_DISTANCE_DELTA : -IMG_DISTANCE_DELTA; + hexagonsList_->SetImageDistance(imgDistance_); + hexagonsList_->LayoutChildren(true); + } else if (modifyScaleFatorButton_ == &view) { + imgScaleFactor_ += isIncreaseScaleFactor_ ? IMG_SCALE_FACTOR_DELTA : -IMG_SCALE_FACTOR_DELTA; + hexagonsList_->SetScaleFactorByDistance(imgScaleFactor_); + hexagonsList_->LayoutChildren(true); + } else if (modifyGlobalScaleButton_ == &view) { + globalScale_ += isIncreaseGlobalScale_ ? GLOBAL_SCALE_DELTA : -GLOBAL_SCALE_DELTA; + int8_t index = hexagonsList_->GetFocusedImgIndex(); + if (index >= 0) { + hexagonsList_->Scale(globalScale_, static_cast(index)); + } + } + if (FloatLess(globalScale_, hexagonsList_->GetScaleThesholdOfZeroFactor())) { + hexagonsList_->SetReboundMode(UIHexagonsList::ReboundMode::CENTER_IMG_ON_SCR_CENTER); + } else { + hexagonsList_->SetReboundMode(UIHexagonsList::ReboundMode::NEAREST_IMG_ON_SCR_CENTER); + } + + if (Screen::GetInstance().GetScreenShape() == RECTANGLE) { + HandleClickEventForRectScreen(view); + } + + GRAPHIC_LOGE("%d-%d imgDist_=%d imgSize=%d imgScaleFactor=%f globalScale=%f horPad=%d verPad=%d boderRadius=%d", + view.GetViewType(), view.GetViewIndex(), imgDistance_, imgSize_, imgScaleFactor_, globalScale_, + horMargin_, verMargin_, borderRadius_); + return true; +} + +bool UITestHexagonsList::OnLongPress(UIView& view, const LongPressEvent& event) +{ + if (modifyImgSizeButton_ == &view) { + isIncreaseImgSize_ = !isIncreaseImgSize_; + } else if (modifyImgDistanceButton_ == &view) { + isIncreaseImgDistance_ = !isIncreaseImgDistance_; + } else if (modifyScaleFatorButton_ == &view) { + isIncreaseScaleFactor_ = !isIncreaseScaleFactor_; + } else if (modifyGlobalScaleButton_ == &view) { + isIncreaseGlobalScale_ = !isIncreaseGlobalScale_; + } else if (modifyHorMarginButton_ == &view) { + isIncreaseHorMargin_ = !isIncreaseHorMargin_; + } else if (modifyVerMarginButton_ == &view) { + isIncreaseVerMargin_ = !isIncreaseVerMargin_; + } else if (modifyBorderRadiusButton_ == &view) { + isIncreaseBorderRadius_ = !isIncreaseBorderRadius_; + } + GRAPHIC_LOGE("incSize=%d incDist=%d incFactor=%d incGloScale=%d incHPadding=%d incVPadding=%d incBRadius=%d", + isIncreaseImgSize_, isIncreaseImgDistance_, isIncreaseScaleFactor_, isIncreaseGlobalScale_, + isIncreaseHorMargin_, isIncreaseVerMargin_, isIncreaseBorderRadius_); + return true; +} + +const UIView* UITestHexagonsList::GetTestView() +{ + return container_; +} +} \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.h new file mode 100644 index 000000000..999b41b83 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_hexagons_list/ui_test_hexagons_list.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#ifndef UI_TEST_HEXAGONS_LIST_H +#define UI_TEST_HEXAGONS_LIST_H + +#include "ui_test.h" +#include "gfx_utils/list.h" +#include "components/ui_custom_hexagons_list.h" +#include "components/ui_button.h" + +namespace OHOS { +class UITestHexagonsList : public UITest, public UIView::OnClickListener, public UIView::OnLongPressListener { +public: + UITestHexagonsList() {} + ~UITestHexagonsList() override {} + void SetUp() override; + void TearDown() override; + const UIView *GetTestView() override; + bool OnClick(UIView& view, const ClickEvent& event) override; + bool OnLongPress(UIView& view, const LongPressEvent& event) override; + +private: + void HandleClickEventForRectScreen(const UIView& view); + void ConfigButtonAttr(UIView& view, int16_t x, int16_t y, int16_t width, int16_t height); + void SetUpButtons(int16_t xEnd, int16_t yEnd, int16_t xMiddle, int16_t yMiddle); + UICustomHexagonsList* hexagonsList_ = nullptr; + int16_t horMargin_ = 0; + int16_t verMargin_ = 0; + int16_t borderRadius_ = 0; + UIViewGroup* container_ = nullptr; + uint16_t imgSize_ = 0; + uint16_t imgDistance_ = 0; + float imgScaleFactor_ = 0; + float globalScale_ = 0; + bool isIncreaseImgSize_ = true; + UIButton* modifyImgSizeButton_ = nullptr; + bool isIncreaseImgDistance_ = true; + UIButton* modifyImgDistanceButton_ = nullptr; + bool isIncreaseScaleFactor_ = true; + UIButton* modifyScaleFatorButton_ = nullptr; + bool isIncreaseGlobalScale_ = true; + UIButton* modifyGlobalScaleButton_ = nullptr; + bool isIncreaseHorMargin_ = true; + UIButton* modifyHorMarginButton_ = nullptr; + bool isIncreaseVerMargin_ = true; + UIButton* modifyVerMarginButton_ = nullptr; + bool isIncreaseBorderRadius_ = true; + UIButton* modifyBorderRadiusButton_ = nullptr; +}; +} +#endif // UI_TEST_HEXAGONS_LIST_H \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp new file mode 100644 index 000000000..3f528d96a --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#include "ui_test_kaleidoscope.h" +#include "common/image_cache_manager.h" + +namespace OHOS { + +void UITestKaleidoscope::KaleidoscopeAnimator::Callback(UIView* view) +{ + if (view == nullptr) { + return; + } + + kaleidoscopeUtils_->Rotate(0.1f); // 0.1: rotate by 0.1 + view->Invalidate(); +} + +void UITestKaleidoscope::SetUp() +{ + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + container_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + + imgInfo_ = ImageCacheManager::GetInstance().LoadSingleRes(RES_PATH"rabbit454.bin"); + + if ((Screen::GetInstance().GetWidth() == imgInfo_->header.width) && + (Screen::GetInstance().GetHeight() == imgInfo_->header.height)) { + kaleidoscope_ = new UIKaleidoscopeView(); + if (kaleidoscope_->SetSrc(imgInfo_) == false) { + return; + } + + container_->Add(kaleidoscope_); + kaleidoscope_->RequestFocus(); + kaleidoscope_->SetRotateEventFactor(0.2f); // 0.2: rotate event factor + kaleidoscope_->SetRotateAnimatorValue(0.1f); // 0.1: rotate animator value + kaleidoscope_->StartRotateAnimator(); + return; + } + + kaleidoscopeUtils_ = new KaleidoscopeUtils(); + kaleidoscopeUtils_->Init(imgInfo_, nullptr); + ImageInfoExt* infoExt = kaleidoscopeUtils_->GetKaleidoscopeInfo(); + + img_ = new UIImageView(); + img_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + img_->SetAutoEnable(false); + img_->SetResizeMode(UIImageView::ImageResizeMode::FILL); + img_->SetSrc(&infoExt->info); + container_->Add(img_); + + if (utilsAnimator_ == nullptr) { + utilsAnimator_ = new KaleidoscopeAnimator(kaleidoscopeUtils_, img_); + utilsAnimator_->Start(); + } +} + +void UITestKaleidoscope::TearDown() +{ + if (utilsAnimator_ != nullptr) { + utilsAnimator_->Stop(); + delete utilsAnimator_; + utilsAnimator_ = nullptr; + } + + if (kaleidoscope_ != nullptr) { + kaleidoscope_->StopRotateAnimator(); + kaleidoscope_->ClearFocus(); + kaleidoscope_ = nullptr; + } + + DeleteChildren(container_); + container_ = nullptr; + imgInfo_ = nullptr; + img_ = nullptr; + + if (kaleidoscopeUtils_ != nullptr) { + delete kaleidoscopeUtils_; + kaleidoscopeUtils_ = nullptr; + } + ImageCacheManager::GetInstance().UnloadSingleRes(RES_PATH"rabbit454.bin"); +} + +const UIView* UITestKaleidoscope::GetTestView() +{ + return container_; +} +} diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.h new file mode 100644 index 000000000..15c3d933b --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_kaleidoscope/ui_test_kaleidoscope.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) @CompanyNameMagicTag. 2024. All rights reserved. + */ + +#ifndef UI_TEST_KALEIDOSCOPE_H +#define UI_TEST_KALEIDOSCOPE_H + +#include "ui_test.h" +#include "components/ui_kaleidoscope_view.h" +#include "components/kaleidoscope_utils.h" +#include "animator/animator.h" +#include "components/ui_image_view.h" + +namespace OHOS { +class UITestKaleidoscope : public UITest { +public: + UITestKaleidoscope() {} + ~UITestKaleidoscope() override {} + void SetUp() override; + void TearDown() override; + const UIView* GetTestView() override; + +private: + class KaleidoscopeAnimator : public Animator, public AnimatorCallback { + public: + KaleidoscopeAnimator(KaleidoscopeUtils* kaleidoscopeUtils, UIImageView* img) + : Animator(this, img, 0, true), kaleidoscopeUtils_(kaleidoscopeUtils) {} + virtual ~KaleidoscopeAnimator() {} + void Callback(UIView* view) override; + + private: + KaleidoscopeUtils* kaleidoscopeUtils_; + }; + + UIViewGroup* container_ = nullptr; + ImageInfo* imgInfo_ = nullptr; + + UIKaleidoscopeView* kaleidoscope_ = nullptr; + + UIImageView* img_ = nullptr; + KaleidoscopeUtils* kaleidoscopeUtils_ = nullptr; + KaleidoscopeAnimator* utilsAnimator_ = nullptr; +}; +} +#endif \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.cpp new file mode 100644 index 000000000..53cee9582 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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 "ui_test_map.h" +#include "common/screen.h" +#include "components/root_view.h" + +namespace OHOS { +static float g_scale = 1.0; +static const float SCALE_LIMIT = 0.5; +static const float SCALE_STEP = 0.1; +static const Vector2 SCALE_CENTER = {228, 178}; // 228, 178: scale center + +void UITestMap::SetUp() +{ + container_ = new UIScrollView(); + container_->Resize(Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetScrollBlankSize(200); // 200: blank size + + map_ = new UIMapView(); + map_->SetPosition(100, 50, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); // 100, 50: x, y + map_->SetSVG(RES_PATH"map.bin"); + container_->Add(map_); + + scale_ = new UILabelButton(); + scale_->SetPosition(57, 340, 100, 50); // 57: x, 340: y, 100: width, 50: height + scale_->SetText("scale"); + scale_->SetOnClickListener(this); + container_->Add(scale_); + + cache_ = new UILabelButton(); + cache_->SetPosition(177, 340, 100, 50); // 177: x, 340: y, 100: width, 50: height + cache_->SetText("cache"); + cache_->SetOnClickListener(this); + container_->Add(cache_); + + reset_ = new UILabelButton(); + reset_->SetPosition(297, 340, 100, 50); // 297: x, 340: y, 100: width, 50: height + reset_->SetText("reset"); + reset_->SetOnClickListener(this); + container_->Add(reset_); +} + +void UITestMap::TearDown() +{ + DeleteChildren(container_); + container_ = nullptr; + scale_ = nullptr; + cache_ = nullptr; + reset_ = nullptr; + map_ = nullptr; +} + +const UIView* UITestMap::GetTestView() +{ + return container_; +} + +bool UITestMap::OnClick(UIView& view, const ClickEvent& event) +{ + if (&view == scale_) { + g_scale -= SCALE_STEP; + if (g_scale < SCALE_LIMIT) { + g_scale = SCALE_LIMIT; + } + map_->EnableCache(false); + map_->ScaleMap(g_scale, SCALE_CENTER); + } else if (&view == cache_) { + if (!cached_) { + cache_->SetText("clear cache"); + map_->EnableCache(true); + cached_ = true; + } else { + cache_->SetText("cache"); + map_->EnableCache(false); + cached_ = false; + } + } else if (&view == reset_) { + g_scale = 1.0; + map_->EnableCache(false); + map_->ScaleMap(g_scale, SCALE_CENTER); + } + RootView::GetInstance()->Invalidate(); + return true; +} +} diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.h b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.h new file mode 100644 index 000000000..927a09840 --- /dev/null +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_map/ui_test_map.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 CompanyNameMagicTag. + * 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. + */ + +#ifndef UI_TEST_MAP_H +#define UI_TEST_MAP_H + +#include "ui_test.h" +#include "components/ui_label_button.h" +#include "components/ui_map_view.h" +#include "components/ui_scroll_view.h" + +namespace OHOS { +class UITestMap : public UITest, public UIView::OnClickListener { +public: + UITestMap() {} + ~UITestMap() override {} + void SetUp() override; + void TearDown() override; + const UIView* GetTestView() override; + bool OnClick(UIView& view, const ClickEvent& event) override; + +private: + UIScrollView* container_ = nullptr; + UILabelButton* scale_ = nullptr; + UILabelButton* cache_ = nullptr; + UILabelButton* reset_ = nullptr; + UIMapView* map_ = nullptr; + bool cached_ = false; +}; +} +#endif diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp index a84fb1666..0084d2b53 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/components/ui_test_video_play/ui_test_video_play.cpp @@ -24,7 +24,7 @@ namespace OHOS { static constexpr int16_t VIDEO_WIDTH = 454; static constexpr int16_t VIDEO_HEIGHT = 454; -static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 64; +static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 128; static constexpr int16_t BUFFER_QUEUE_SIZE = 3; static constexpr int16_t JPEG_HEIGHT_DIVISOR = 2; static constexpr int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128; @@ -36,7 +36,7 @@ static constexpr int16_t TEXT_FONT_SIEZ = 40; #ifdef SUPPORT_AT_OHOSFWK static MediaVideoPlay *g_videoPlay = nullptr; -static bool g_lastPlayed_ = false; +static bool g_lastPlayed = false; static void ScreenStatusNotify(ScreenStatus status) { if (g_videoPlay == nullptr) { @@ -47,22 +47,22 @@ static void ScreenStatusNotify(ScreenStatus status) if (status == SCREEN_STATUS_OFF && g_videoPlay->isPlayed_) { g_videoPlay->PauseVideoPlay(); } else if (status == SCREEN_STATUS_ON) { - if (g_lastPlayed_ && g_videoPlay->isPause_) { + if (g_lastPlayed && g_videoPlay->isPause_) { g_videoPlay->ResumeVideoPlay(); } } - g_lastPlayed_ = temp; + g_lastPlayed = temp; } #endif static void GetTime(char* buf, int len) { struct timeval tv; - gettimeofday(&tv, NULL); - uint32_t second = tv.tv_sec % TIME_CONVERT; - uint32_t minute = tv.tv_sec / TIME_CONVERT; - uint32_t hour = (minute / TIME_CONVERT) % 24; // 24: 24 hours per day - uint32_t realMilliSecond = tv.tv_usec / USEC_TO_MILLI; + gettimeofday(&tv, nullptr); + int32_t second = tv.tv_sec % TIME_CONVERT; + int32_t minute = tv.tv_sec / TIME_CONVERT; + int32_t hour = (minute / TIME_CONVERT) % 24; // 24: 24 hours per day + int32_t realMilliSecond = tv.tv_usec / USEC_TO_MILLI; minute = minute % TIME_CONVERT; sprintf_s(buf, len, "%02d : %02d : %02d : %03d", hour, minute, second, realMilliSecond); diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp index b3ec25124..ce6b1e7cd 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/test_case_list_adapter.cpp @@ -26,6 +26,7 @@ namespace OHOS { namespace { const uint16_t TESTCASE_BUTTON_HEIGHT = 100; const uint16_t STYLE_BORDER_WIDTH_VALUE = 4; +const uint16_t BACK_BUTTON_SIZE = 50; } // namespace uint16_t TestCaseListAdapter::GetCount() @@ -82,7 +83,8 @@ public: rootView->Add(tempView); if (backBtn_ == nullptr) { backBtn_ = new TransparentBackButton(); - backBtn_->SetPosition(0, 202, 50, 50); // 0: x position, 202: y position, 50: width and height + backBtn_->SetPosition(0, (Screen::GetInstance().GetHeight() - BACK_BUTTON_SIZE) / 2, // 2, half size + BACK_BUTTON_SIZE, BACK_BUTTON_SIZE); } backBtn_->SetViewId(view.GetViewId()); rootView->Add(backBtn_); diff --git a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/ui_test_group.cpp b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/ui_test_group.cpp index 5379804cf..0e6bce629 100644 --- a/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/ui_test_group.cpp +++ b/code/sdk/middleware/services/gui/uikit/sample/uitest/framework/src/ui_test_group.cpp @@ -68,12 +68,16 @@ #include "ui_test_sweepclock/ui_test_sweepclock.h" #include "ui_test_text_fps/ui_test_text_fps.h" #include "ui_test_tiger/ui_test_tiger.h" +#include "ui_test_hexagons_list/ui_test_hexagons_list.h" #include "ui_test_list_fps/ui_test_list_fps.h" #include "ui_test_card_switch/ui_test_card_switch.h" #include "ui_test_message/ui_test_message.h" #include "ui_test_breath/ui_test_breath.h" #include "ui_test_cube_rotate/ui_test_cube_rotate.h" #include "ui_test_cross/ui_test_cross.h" +#include "ui_test_map/ui_test_map.h" +#include "ui_test_coverflow/ui_test_coverflow.h" +#include "ui_test_kaleidoscope/ui_test_kaleidoscope.h" namespace OHOS { void UITestGroup::AddTestCase(TestCaseInfo testCaseInfo) @@ -92,6 +96,9 @@ void UITestGroup::SetUpTestCase() } testCaseList_->Clear(); testCaseList_->PushBack(TestCaseInfo{"老虎头", new UITestTiger()}); +#ifndef QSPI_DISPLAY + testCaseList_->PushBack(TestCaseInfo{"蜂窝表盘", new UITestHexagonsList()}); +#endif testCaseList_->PushBack(TestCaseInfo{"滑动列表", new UITestListFPS()}); testCaseList_->PushBack(TestCaseInfo{"扫秒", new UITestSweepClock()}); testCaseList_->PushBack(TestCaseInfo{"指南针", new UITestCompass()}); @@ -101,11 +108,16 @@ void UITestGroup::SetUpTestCase() testCaseList_->PushBack(TestCaseInfo{"卡片切换", new UITestCardSwitch()}); testCaseList_->PushBack(TestCaseInfo{"消息", new UITestMessage()}); testCaseList_->PushBack(TestCaseInfo{"呼吸效果", new UITestBreath()}); -#if !defined(_WIN32) && !defined(QSPI_DISPLAY) +#ifndef QSPI_DISPLAY + testCaseList_->PushBack(TestCaseInfo{"地图", new UITestMap()}); +#if !defined(_WIN32) testCaseList_->PushBack(TestCaseInfo{"视频播放", new UITestVideoPlay()}); #endif -#if !defined(QSPI_DISPLAY) testCaseList_->PushBack(TestCaseInfo{"翻转动效", new UITestCross()}); +#if !defined(_WIN32) + testCaseList_->PushBack(TestCaseInfo{"万花筒", new UITestKaleidoscope()}); +#endif + testCaseList_->PushBack(TestCaseInfo{"覆盖流", new UITestCoverflow()}); #endif #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH testCaseList_->PushBack(TestCaseInfo{"倒计时", new UITestCountdown()}); diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp index a4b37b165..3e1c2cb38 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/input_device_manager.cpp @@ -16,6 +16,7 @@ #include "common/input_device_manager.h" #include "common/task_manager.h" #include "gfx_utils/graphic_log.h" +#include "dock/pointer_input_device.h" namespace OHOS { InputDeviceManager* InputDeviceManager::GetInstance() @@ -81,4 +82,16 @@ void InputDeviceManager::Clear() { deviceList_.Clear(); } + +void InputDeviceManager::ClearPressableViews() +{ + ListNode* node = deviceList_.Begin(); + while (node != deviceList_.End()) { + PointerInputDevice* device = dynamic_cast(node->data_); + if (device != nullptr) { + device->ClearPressableViews(); + } + node = node->next_; + } +} } // namespace OHOS \ No newline at end of file diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/root_view.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/root_view.cpp index cf86bbf6c..d87f0f51a 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/root_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/root_view.cpp @@ -802,7 +802,7 @@ void RootView::DrawTop(UIView* view, const Rect& rect) #if ENABLE_MAP_BUFFER if ((curView->GetViewType() != UI_IMAGE_VIEW) && (curView->GetViewType() != UI_TEXTURE_MAPPER) && (curView->GetViewType() != UI_CANVAS_EXT) && (curView->GetViewType() != UI_MENU_ITEM) && - !curView->IsTransInvalid() && !enableAnimator) { + (curView->GetViewType() != UI_MAP_VIEW) && !curView->IsTransInvalid() && !enableAnimator) { origRect = curView->GetOrigRect(); relativeRect = curView->GetRelativeRect(); curView->GetTransformMap().SetInvalid(true); diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_chart.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_chart.cpp index 508445cfd..7be455b52 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_chart.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_chart.cpp @@ -1023,13 +1023,12 @@ void UIChartPolyline::GradientWithVGU(BufferInfo& gfxDstBuffer, const Rect& inva { Point yStart = yAxis_.GetStartPoint(); yStart.y = enableReverse_ ? (yStart.y + gradientBottom_) : (yStart.y - gradientBottom_); - int16_t topY = enableReverse_ ? data->GetValleyData() : data->GetPeakData(); - int16_t bottomY = enableReverse_ ? data->GetPeakData() : data->GetValleyData(); + int16_t topY = data->GetPeakData(); yAxis_.TranslateToPixel(topY); - yAxis_.TranslateToPixel(bottomY); - int16_t startY = enableReverse_ ? topY : yStart.y; - int16_t endY = enableReverse_ ? yStart.y : topY; - if ((invalidatedArea.GetBottom() < endY) || (invalidatedArea.GetTop() > startY)) { + + int16_t startY = enableReverse_ ? yStart.y : topY; + int16_t endY = enableReverse_ ? topY : yStart.y; + if ((invalidatedArea.GetBottom() < startY) || (invalidatedArea.GetTop() > endY)) { return; } @@ -1061,7 +1060,7 @@ void UIChartPolyline::GradientWithVGU(BufferInfo& gfxDstBuffer, const Rect& inva ColorType color = data->GetFillColor(); int16_t opaScaleTop = enableReverse_ ? (topY - yStart.y - 1) : (yStart.y - topY - 1); - if ((opaScaleTop < 0) || (opaScaleTop >= invalidatedArea.GetHeight())) { + if (opaScaleTop < 0) { return; } VGUColorStop stops[2] = {{0, Color::ColorTo32(Color::GetColorFromRGBA( diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_animator.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_animator.cpp index ad12a80f9..621ff5d88 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_animator.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_animator.cpp @@ -139,6 +139,12 @@ void UIImageAnimatorView::SetImageAnimatorSrc(const ImageAnimatorInfo imageAnima uint16_t timeOfUpdate) { ClearImagesCache(); + if ((imageSrc_ != nullptr) && (imageNum_ != 0)) { + ImageAnimatorInfo* imageAnimatorInfo = &(imageSrc_[0]); + if (imageAnimatorInfo->imageType == IMG_SRC_IMAGE_INFO) { + SetSrc(static_cast(nullptr)); + } + } imageSrc_ = const_cast(imageAnimatorInfoSrc); imageNum_ = imageNum; timeOfUpdate_ = timeOfUpdate; diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp index 5c4833840..18af043f5 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_label.cpp @@ -83,7 +83,8 @@ public: if (integerStep != 0) { offsetX_ -= integerStep; } else { - return; + offsetX_ -= 1; // At lest move one pixel + decimal_ = 0; } offsetX_ = ((offsetX_ - labelX_) % (textX_ + labelX_)) + labelX_; static_cast(view)->offsetX_ = offsetX_; diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp index 9f2f1aba7..e3b110b8a 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_qrcode.cpp @@ -147,7 +147,7 @@ void UIQrcode::SetQrcodeVal(const uint8_t* val, uint32_t length) qrcodeVal_ = nullptr; } dataBin_.clear(); - for (int i = 0; i < length; i++) { + for (uint32_t i = 0; i < length; i++) { dataBin_.push_back(val[i]); } } diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp index 360a751b1..2ede3705f 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_view.cpp @@ -272,7 +272,8 @@ void UIView::Rotate(int16_t angle, const Vector2& pivot) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Rotate is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -291,7 +292,8 @@ void UIView::Rotate(int16_t angle, const Vector3& pivotStart, const Vecto { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Rotate is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -306,10 +308,10 @@ void UIView::Rotate(int16_t angle, const Vector3& pivotStart, const Vecto transMap_->Rotate(angle, pivotStart, pivotEnd); if (firstTrans) { joinRect = transMap_->GetBoxRect(); + joinRect.Join(joinRect, GetOrigRect()); } else { joinRect.Join(joinRect, transMap_->GetBoxRect()); } - joinRect.Join(joinRect, GetOrigRect()); InvalidateRect(joinRect); } @@ -317,7 +319,8 @@ void UIView::Scale(const Vector2& scale, const Vector2& pivot) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Scale is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -331,7 +334,8 @@ void UIView::Scale(const Vector3& scale, const Vector3& pivot) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Scale is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -354,10 +358,10 @@ void UIView::Scale(const Vector3& scale, const Vector3& pivot) transMap_->Scale(scale, pivot); if (firstTrans) { joinRect = transMap_->GetBoxRect(); + joinRect.Join(joinRect, GetOrigRect()); } else { joinRect.Join(joinRect, transMap_->GetBoxRect()); } - joinRect.Join(joinRect, GetOrigRect()); InvalidateRect(joinRect); } @@ -365,7 +369,8 @@ void UIView::Shear(const Vector2& shearX, const Vector2& shearY, c { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Shear is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -380,10 +385,10 @@ void UIView::Shear(const Vector2& shearX, const Vector2& shearY, c transMap_->Shear(shearX, shearY, shearZ); if (firstTrans) { joinRect = transMap_->GetBoxRect(); + joinRect.Join(joinRect, GetOrigRect()); } else { joinRect.Join(joinRect, transMap_->GetBoxRect()); } - joinRect.Join(joinRect, GetOrigRect()); InvalidateRect(joinRect); } @@ -391,7 +396,8 @@ void UIView::Translate(const Vector2& trans) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Translate is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -404,7 +410,8 @@ void UIView::Translate(const Vector3& trans) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("Translate is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -419,10 +426,10 @@ void UIView::Translate(const Vector3& trans) transMap_->Translate(trans); if (firstTrans) { joinRect = transMap_->GetBoxRect(); + joinRect.Join(joinRect, GetOrigRect()); } else { joinRect.Join(joinRect, transMap_->GetBoxRect()); } - joinRect.Join(joinRect, GetOrigRect()); InvalidateRect(joinRect); } @@ -799,7 +806,8 @@ void UIView::SetTransformMap(const TransformMap& transMap) { #if !ENABLE_MAP_BUFFER UIViewType type = GetViewType(); - if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT)) { + if ((type != UI_IMAGE_VIEW) && (type != UI_TEXTURE_MAPPER) && (type != UI_CANVAS_EXT) && (type != UI_MAP_VIEW) && + (type != UI_MENU_ITEM)) { GRAPHIC_LOGE("SetTransformMap is not supported for view type %d if ENABLE_MAP_BUFFER is 0", type); return; } @@ -1197,4 +1205,24 @@ bool UIView::GetBitmap(ImageInfo& bitmap) rect_.SetPosition(tempX, tempY); return true; } + +bool UIView::IsVideoContained() +{ + if (GetViewType() == UI_LITE_SURFACE_VIEW) { + return true; + } + UIViewGroup* group = dynamic_cast(this); + if (group == nullptr) { + return false; + } + + UIView* view = group->GetChildrenHead(); + while (view != nullptr) { + if (view->IsVideoContained()) { + return true; + } + view = view->GetNextSibling(); + } + return false; +} } // namespace OHOS diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/pointer_input_device.h b/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/pointer_input_device.h index 295fb93ff..c5343fc14 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/pointer_input_device.h +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/dock/pointer_input_device.h @@ -32,6 +32,14 @@ public: {} virtual ~PointerInputDevice() {} + void ClearPressableViews() + { + dragLen_ = { 0, 0 }; + dragStep_ = { 0, 0 }; + draggableView_ = nullptr; + touchableView_ = nullptr; + } + protected: void DispatchEvent(const DeviceData& data) override; diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h index 11e09dac1..bd89a1919 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/common/input_device_manager.h @@ -53,6 +53,11 @@ public: */ void Clear(); + /** + * Clear pressable views recorded in the pointer input device + */ + void ClearPressableViews(); + void Callback() override; /** diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h index af0059558..3219560a8 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/root_view.h @@ -464,7 +464,7 @@ private: bool needScreencap_ = false; #endif bool isSnapshot_ = false; - UIView* blurView_; + UIView* blurView_ = nullptr; UIViewGroup sysView_; UIViewGroup appView_; }; diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h index 3ad3579fa..c5039a795 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_scroll_view.h @@ -241,10 +241,10 @@ protected: bool DragXInner(int16_t distance) override; bool DragYInner(int16_t distance) override; bool MoveOffset(int16_t offsetX, int16_t offsetY); + void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) override; private: void Drag(const DragEvent& event); - void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY) override; void RefreshScrollBar(); OnScrollListener* scrollListener_; #if ENABLE_VIBRATOR diff --git a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h index f3c3c76d7..9632e8471 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h +++ b/code/sdk/middleware/services/gui/uikit/ui/interfaces/kits/components/ui_view.h @@ -113,6 +113,8 @@ enum UIViewType : uint8_t { UI_CARD_PAGE, UI_CROSS_VIEW, UI_BARCODE, + UI_MAP_VIEW, + UI_KALEIDOSCOPE_VIEW, UI_NUMBER_MAX }; @@ -1785,6 +1787,12 @@ public: * to apply blur effect to the background. */ void HandleGaussianBlur(BufferInfo& gfxDstBuffer); + + /** + * @brief Check whether this view is lite surface view or it contains lite surface view + */ + bool IsVideoContained(); + protected: bool touchable_ : 1; bool visible_ : 1; diff --git a/code/sdk/middleware/services/gui/uikit/utils/frameworks/geometry2d.cpp b/code/sdk/middleware/services/gui/uikit/utils/frameworks/geometry2d.cpp index df8f05d49..2444ccc02 100644 --- a/code/sdk/middleware/services/gui/uikit/utils/frameworks/geometry2d.cpp +++ b/code/sdk/middleware/services/gui/uikit/utils/frameworks/geometry2d.cpp @@ -82,6 +82,9 @@ uint32_t Rect::GetSize() const bool Rect::Intersect(const Rect& rect1, const Rect& rect2) { + if (!rect1.IsValid() || !rect2.IsValid()) { + return false; + } /* Get the smaller area from 'rect1' and 'rect2' */ left_ = MATH_MAX(rect1.left_, rect2.left_); top_ = MATH_MAX(rect1.top_, rect2.top_); diff --git a/code/sdk/middleware/services/gui/uikit/utils/frameworks/graphic_math.cpp b/code/sdk/middleware/services/gui/uikit/utils/frameworks/graphic_math.cpp index e7941cd7f..d544bf73f 100644 --- a/code/sdk/middleware/services/gui/uikit/utils/frameworks/graphic_math.cpp +++ b/code/sdk/middleware/services/gui/uikit/utils/frameworks/graphic_math.cpp @@ -57,6 +57,27 @@ float Sin(float angle) #endif } +float Acos(float value) +{ +#if defined(ENABLE_CMATH) && ENABLE_CMATH + return acos(value); +#else + float result, l, r; + l = 0; + r = UI_PI; + result = (l + r) / 2; + while (MATH_ABS(Sin(QUARTER_IN_DEGREE - result * RADIAN_TO_ANGLE) - value) > UI_FLT_EPSILON) { + if (Sin(QUARTER_IN_DEGREE - result * RADIAN_TO_ANGLE) - value > UI_FLT_EPSILON) { + l = result; + } else { + r = result; + } + result = (l + r) / 2; + } + return result; +#endif +} + /* arctan(x) = x - p3 * x^3 + p5 * x^5 - p7 * x^7 */ uint16_t FastAtan2(int16_t x, int16_t y) { diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h index 163e79977..a31383746 100644 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h +++ b/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h @@ -157,7 +157,7 @@ namespace OHOS { * @brief use map buffer to support view transformation. if disable it to save memory, * transformation will not be supported except UIImageView, UITextureMapper and UICanvasExt. */ -#define ENABLE_MAP_BUFFER 1 +#define ENABLE_MAP_BUFFER 0 #elif defined _LITEOS /** * @brief Font shaping, which is disabled by default on LiteOS. diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h index b0d571ba0..748c81d8b 100644 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h +++ b/code/sdk/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils/graphic_math.h @@ -84,6 +84,7 @@ static constexpr float UI_FLT_EPSILON = 1E-5; static constexpr int16_t ORDER_MATRIX_4 = 4; float Sin(float angle); +float Acos(float value); uint16_t FastAtan2(int16_t x, int16_t y); float Sqrt(float x); @@ -661,6 +662,19 @@ public: */ Matrix4 Inverse() const; + /** + * @brief Obtains a rotation matrix. + * + * @param cosA Indicates the cosine of the angle to rotate. + * @param sinA Indicates the sine of the angle to rotate. + * @param pivot1 Indicates the rotation pivot. + * @param pivot2 Indicates the rotation pivot. + * @return Returns the matrix after rotation. + * @since 5.0 + * @version 3.0 + */ + static Matrix4 Rotate(T cosA, T sinA, const Vector3& pivot1, const Vector3& pivot2); + /** * @brief Obtains a rotation matrix. * @@ -864,7 +878,7 @@ bool Matrix4::operator==(const Matrix4& other) const } template -Matrix4 Matrix4::Rotate(T angle, const Vector3& pivot1, const Vector3& pivot2) +Matrix4 Matrix4::Rotate(T cosA, T sinA, const Vector3& pivot1, const Vector3& pivot2) { Matrix4 rotateMat4; T* rData = rotateMat4.data_; @@ -874,12 +888,12 @@ Matrix4 Matrix4::Rotate(T angle, const Vector3& pivot1, const Vector3(Sin(angle + QUARTER_IN_DEGREE)); - T sinA = static_cast(Sin(angle)); + T diff = 1 - cosA; T ux = (pivot2.x_ - pivot1.x_) / length; // 0 T uy = (pivot2.y_ - pivot1.y_) / length; // 0 T uz = (pivot2.z_ - pivot1.z_) / length; // 1 + Matrix4 transToOrigin = Matrix4::Translate(Vector3 { -pivot1.x_, -pivot1.y_, -pivot1.z_ }); rData[0] = ux * ux * diff + cosA; // 0 : index // cosA @@ -898,6 +912,14 @@ Matrix4 Matrix4::Rotate(T angle, const Vector3& pivot1, const Vector3 +Matrix4 Matrix4::Rotate(T angle, const Vector3& pivot1, const Vector3& pivot2) +{ + T cosA = static_cast(Sin(angle + QUARTER_IN_DEGREE)); + T sinA = static_cast(Sin(angle)); + return Matrix4::Rotate(cosA, sinA, pivot1, pivot2); +} + template Matrix4 Matrix4::Scale(const Vector3& scale, const Vector3& fixed) { @@ -956,7 +978,27 @@ inline int64_t FloatToInt64(float f) inline bool FloatEqual(float lhs, float rhs, float precision = 0.00001f) { - return (MATH_ABS(lhs - rhs) < precision) ? true : false; + return MATH_ABS(lhs - rhs) < precision; +} + +inline bool FloatMore(float lhs, float rhs, float precision = 0.00001f) +{ + return lhs - rhs > precision; +} + +inline bool FloatLess(float lhs, float rhs, float precision = 0.00001f) +{ + return lhs - rhs < -precision; +} + +inline bool FloatMoreEqual(float lhs, float rhs, float precision = 0.00001f) +{ + return lhs - rhs > -precision; +} + +inline bool FloatLessEqual(float lhs, float rhs, float precision = 0.00001f) +{ + return lhs - rhs < precision; } bool IsIdentity(Matrix3& matrix); diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp index 7d49d1c93..38247a870 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audiomanager/cpp/audio_manager.cpp @@ -14,7 +14,7 @@ #define LOG_MODULE_NAME "AudioManager" namespace Audio { -AudioManager::AudioManager() +AudioManager::AudioManager() noexcept : impl_(nullptr) { } diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c index b90744cfd..ee97596ec 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/policymanager/src/interrupt_manager.c @@ -782,7 +782,7 @@ static bool InterruptCheckIsCanResume(const InterruptElement *interruptMain, static void ResumeInterruptStream(const InterruptElement *interruptEl, List *list, bool isOutPut) { - for (ListIterator it = ListIterBegin(list); it != ListIterEnd(list);) { + for (ListIterator it = ListIterBegin(list); it != ListIterEnd(list); it = ListIterNext(list, it)) { InterruptElement *curInterruptEl = (InterruptElement *)ListIterData(it); if (curInterruptEl != NULL && curInterruptEl->isInterrupted && curInterruptEl->interruptedStreamType == interruptEl->streamType) { @@ -802,7 +802,6 @@ static void ResumeInterruptStream(const InterruptElement *interruptEl, List *lis curInterruptEl->delayedStreamType = AUDIO_STREAM_INVALID; } } - it = ListIterNext(list, it); } } diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c index aa07c130c..88f9624eb 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/stream_manager.c @@ -365,7 +365,7 @@ static int32_t CheckTrackState(const AudioStreamStrategy *strategy, int32_t newS for (int i = 0; i < CONCURRENT_ACTIVE_STREAM_MAX_NUM; i++) { if (g_streamMgrContext.simpleInfos[i].active) { uintptr_t handle = g_streamMgrContext.simpleInfos[i].streamHandle; - if (GetState(handle) == RUNNING) { + if (GetState(handle) == RUNNING && GetStreamType(handle) != AUDIO_STREAM_A2DP_MUSIC) { CHK_FAILED_RETURN(PauseTrack(handle), AUDIO_SUCCESS, AUDIO_ERROR, "pause failed"); } } @@ -522,7 +522,17 @@ static int32_t UpdateActiveStreamMixWeight(const AudioStreamStrategy *strategy, } int32_t ret = SetTrackVolume(streamHandle, g_streamMgrContext.typeVolume[typeHashId], mixWeightSet, NOT_SET_STREAM_VOLUME); - CHK_FAILED_RETURN(ret, AUDIO_SUCCESS, AUDIO_ERROR, "update stream volume fail when new stream create"); + // 解决多线程竞争,概率出现老流未启动设置混音失败,此时新流也会失败退出, + // 老流会在启动的时候设置音量,此处设置失败不应该直接向上返回错误, + // 后续要考虑下老流设置音箱的时机,此处是不是只记录音量信息即可 + if (ret == AUDIO_BAD_STATE) { + ALOGW("current state is not right!"); + return AUDIO_SUCCESS; + } + if (ret != AUDIO_SUCCESS) { + ALOGW("update stream volume fail when new stream create: %d", ret); + return AUDIO_ERROR; + } } } return AUDIO_SUCCESS; @@ -666,6 +676,10 @@ int32_t StreamMgrDestroyStreamOut(uintptr_t handle) AudioStreamStrategy *strategy = GetStrategyFromPolicyManager(&streamInfForDestroy, (uint32_t)streamId, STREAM_OUT_DESTROY); CHK_NULL_RETURN(strategy, AUDIO_ERROR, "get strategy fail when destroy out stream"); +#ifdef SUPPORT_SET_DSP_CLOCK_FREQ + AudioStreamType streamType = GetStreamType(handle); + AudioDeviceType deviceType = (AudioDeviceType)GetStreamDeviceId(handle); +#endif // hal 销毁 if (DestroyTrackHandle(handle) != AUDIO_SUCCESS) { return AUDIO_ERROR; @@ -676,9 +690,8 @@ int32_t StreamMgrDestroyStreamOut(uintptr_t handle) MediaMutexLock(g_mutex); DeleteOneStream(streamId, true); #ifdef SUPPORT_SET_DSP_CLOCK_FREQ - AudioStreamType streamType = GetStreamType(handle); if (IsAllStreamDestroyed(streamType)) { - SetHifiClockFreqByStreamTypeAndDeviceType(streamType, (AudioDeviceType)GetStreamDeviceId(handle), false); + SetHifiClockFreqByStreamTypeAndDeviceType(streamType, deviceType, false); } #endif if (UpdateTrackMixWeightWhenDestroy(strategy) != AUDIO_SUCCESS) { @@ -737,15 +750,18 @@ int32_t StreamMgrDestroyStreamIn(uintptr_t handle) { MediaMutexLock(g_mutex); int32_t streamId = GetSourceStreamId(handle); +#ifdef SUPPORT_SET_DSP_CLOCK_FREQ + AudioStreamType streamType = GetSourceStreamType(handle); + AudioDeviceType deviceType = (AudioDeviceType)GetSourceDeviceId(handle); +#endif if (DestroySourceHandle(handle) != AUDIO_SUCCESS) { MediaMutexUnLock(g_mutex); return AUDIO_ERROR; } DeleteOneStream(streamId, false); #ifdef SUPPORT_SET_DSP_CLOCK_FREQ - AudioStreamType streamType = GetSourceStreamType(handle); if (IsAllStreamDestroyed(streamType)) { - SetHifiClockFreqByStreamTypeAndDeviceType(streamType, (AudioDeviceType)GetSourceDeviceId(handle), false); + SetHifiClockFreqByStreamTypeAndDeviceType(streamType, deviceType, false); } #endif MediaMutexUnLock(g_mutex); diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c index d4248dba5..834752043 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c +++ b/code/sdk/middleware/services/media/foundation/audiomanager/frameworks/audioservice/src/streammanager/src/track_handle.c @@ -192,6 +192,9 @@ static int32_t ProcessCurStream(TrackHandleContext *context) return AUDIO_ERROR; } context->render = NULL; +#ifdef SUPPORT_SET_DSP_CLOCK_FREQ + SetHifiClockFreqByStreamTypeAndDeviceType(context->streamInfo.streamType, (AudioDeviceType)validFwDevice, false); +#endif return AUDIO_SUCCESS; } @@ -355,6 +358,7 @@ int32_t SetTrackOutputDevice(uintptr_t handle, int32_t deviceId, const AudioStre if (context->state == IDLE) { context->userAudioOutDevice = (uint32_t)deviceId; } else if (context->state == RUNNING) { + (void)context->callback(context->caller, AUDIO_EVENT_OUTPUT_DEVICE_CHANGED, NULL); if (ChangeRouteInner(context, deviceId) != AUDIO_SUCCESS) { goto ERR; } @@ -473,10 +477,9 @@ static void DestroyAudioRenderHandle(TrackHandleContext *context) static int32_t ResumeTrack(TrackHandleContext *context) { bool needChangeRoute = (context->routeChangedDevice != UNKNOWN); - + int32_t ret = UpdateMixWeigthWhenResume(context); + CHK_FAILED_RETURN_NO_LOG(ret, AUDIO_SUCCESS, ret); if (!needChangeRoute) { - int32_t ret = UpdateMixWeigthWhenResume(context); - CHK_FAILED_RETURN_NO_LOG(ret, AUDIO_SUCCESS, ret); if (context->render->control.Resume((AudioHandle)context->render) != AUDIO_SUCCESS) { return AUDIO_ERROR; } diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiocommon/audio_base_type.h b/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiocommon/audio_base_type.h index 07b6c11d3..6df4ffcbc 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiocommon/audio_base_type.h +++ b/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiocommon/audio_base_type.h @@ -448,6 +448,7 @@ typedef enum { AUDIO_EVENT_RENDER_FULL, /**< The render buffer is full. */ AUDIO_EVENT_RENDER_EOS, /**< Render to the end of the stream. */ AUDIO_EVENT_BUFFER_EMPTY, /**< The underlying buffer data is empty. */ + AUDIO_EVENT_OUTPUT_DEVICE_CHANGED, /**< The output device has been changed. */ AUDIO_EVENT_ERROR_OCCUR, /**< An error occurs. */ } AudioCallbackEventType; diff --git a/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiomanager/cpp/audio_manager.h b/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiomanager/cpp/audio_manager.h index f85583c5b..46654fccc 100644 --- a/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiomanager/cpp/audio_manager.h +++ b/code/sdk/middleware/services/media/foundation/audiomanager/interfaces/kits/audiomanager/cpp/audio_manager.h @@ -332,7 +332,7 @@ public: int32_t DumpInfo(AudioManagerDebugInfo &audioManagerInfo); private: - AudioManager(); + AudioManager() noexcept; class AudioManagerImpl; AudioManagerImpl *impl_; }; diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/include/player_define.h b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/include/player_define.h index 4b5a8dc98..1701f52b9 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/include/player_define.h +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/include/player_define.h @@ -68,6 +68,7 @@ typedef enum { EVNET_ON_JPEG_FRAME_RENDED, EVNET_FRAME_CONTINUE_LOST, EVNET_FIRST_AUDIO_REND, + EVNET_OUTPUT_DEVICE_CHANGED, EVNET_BUTT } EventCbType; diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp index f22c5817d..a3d02f44d 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.cpp @@ -610,6 +610,10 @@ int32_t PlayerControl::OnPlayControlEvent(void *priv, const EventCbType event) c } else if (event == EVNET_AUDIO_BUFFER_EMPTY) { EventCallback(PLAYERCONTROL_BUFFER_EMPTY, nullptr); return HI_SUCCESS; + } else if (event == EVNET_OUTPUT_DEVICE_CHANGED) { + PlayerControl *player = static_cast(priv); + player->RecordLastPosition(); + return HI_SUCCESS; } PalayControlEventItem item; @@ -1896,6 +1900,11 @@ int32_t PlayerControl::DoSetPlaybackSpeed(float speed) const return HI_SUCCESS; } +void PlayerControl::RecordLastPosition() +{ + sinkManager_->RecordLastPosition(); +} + // util bigein void PlayerControl::EventCallback(PlayerControlEvent event, const void *data) const { diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.h b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.h index 90123212e..739654cb2 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.h +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/player/liteplayer.h @@ -155,6 +155,7 @@ protected: void ClearCachePacket(void); void NotifyError(PlayerControlError playerError) const; void EventCallback(PlayerControlEvent event, const void *data) const; + void RecordLastPosition(); private: int32_t InitAttr(const PlayerControlParam &createParam); bool IsPlayEos(void) const; diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.cpp b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.cpp index c9c06b86c..69568fdeb 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.cpp +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.cpp @@ -45,7 +45,7 @@ AudioSink::AudioSink() rendStartTime_(-1), lastRendPts_(AV_INVALID_PTS), #ifdef MINI_MEMORY_SUPPORT - lastRenderPtsWhenPause_(0), + lastRenderPosition_(0), hasSendEosFrame_(false), #endif lastRendSysTimeMs_(-1), @@ -158,7 +158,7 @@ void AudioSink::ResetRendStartTime() { lastRendFrameCnt_ = 0; #ifdef MINI_MEMORY_SUPPORT - lastRenderPtsWhenPause_ = 0; + lastRenderPosition_ = 0; #endif lastRendPts_ = AV_INVALID_PTS; rendStartTime_ = AV_INVALID_PTS; @@ -552,9 +552,7 @@ int32_t AudioSink::Pause(void) CHECK_FAILED_RETURN(outStream_->Pause(), 0, -1, "pause() fail"); } paused_ = true; -#ifdef MINI_MEMORY_SUPPORT - lastRenderPtsWhenPause_ = lastRendPts_; -#endif + RecordLastPosition(); return SINK_SUCCESS; } @@ -632,7 +630,7 @@ void AudioSink::GetRenderPosition(int64_t &position) const position = posNs / NANOS_PER_MILLISECOND; #ifdef MINI_MEMORY_SUPPORT - position += lastRenderPtsWhenPause_; + position += lastRenderPosition_; #endif } @@ -669,6 +667,13 @@ int32_t AudioSink::SetOutputDevice(const int32_t deviceId) const return outStream_->SetOutputDevice(deviceId, renderConfig); } +void AudioSink::RecordLastPosition() +{ +#ifdef MINI_MEMORY_SUPPORT + lastRenderPosition_ = lastRendPts_; +#endif +} + int32_t AudioSink::SetParam(std::string &key, const DataType type, const void *value, int32_t len) const { (void)type; diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.h b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.h index a3dcd9d68..11dfc3539 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.h +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_audio_sink.h @@ -65,6 +65,7 @@ public: void GetRenderPosition(int64_t &position) const; bool IsOffloadSupported(const AudioOffloadParam &offloadInfo) const; int32_t SetOutputDevice(const int32_t deviceId) const; + void RecordLastPosition(); private: void ResetRendStartTime(); void SendAudioEndOfStream(); @@ -94,7 +95,7 @@ private: int64_t rendStartTime_; int64_t lastRendPts_; #ifdef MINI_MEMORY_SUPPORT - int64_t lastRenderPtsWhenPause_; + int64_t lastRenderPosition_; bool hasSendEosFrame_; #endif int64_t lastRendSysTimeMs_; diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.cpp b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.cpp index c9cb7a75b..9ec34e693 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.cpp +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.cpp @@ -466,5 +466,12 @@ int32_t SinkManager::SetOutputDevice(const int32_t deviceId) const } return -1; } + +void SinkManager::RecordLastPosition() +{ + if (audioSinkInfo_[0].sink != nullptr) { + audioSinkInfo_[0].sink->RecordLastPosition(); + } +} } } diff --git a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.h b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.h index f3cf5907e..f9e02fbc0 100644 --- a/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.h +++ b/code/sdk/middleware/services/media/foundation/player/frameworks/player_control/sink/player_sink_manager.h @@ -79,6 +79,7 @@ public: void GetRenderPosition(int64_t &position) const; bool IsOffloadSupported(const AudioOffloadParam &offloadInfo) const; int32_t SetOutputDevice(const int32_t deviceId) const; + void RecordLastPosition(); private: float speed_; float leftVolume_; diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp index e23fb05e8..d2591b368 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/audio_capture_wrapper.cpp @@ -63,6 +63,7 @@ typedef struct TagTestSample { bool needStop; AudioInterrupt interrupt; MediaThreadIdHandle audioCaptureProcess; + MediaMutexHandle mutex; } TestSample; struct SampleAudioCapturerInfo { @@ -130,6 +131,29 @@ static AudioManager& g_amInstance = AudioManager::GetInstance(); static TestSample g_sample; static std::shared_ptr g_captureInterruptListener; +static void AudioCaptureStop() +{ + MediaMutexLock(g_sample.mutex); + if (!g_audioCap->Stop()) { + MEDIA_ERR_LOG("Stop failed"); + } + if (!g_audioCap->Release()) { + MEDIA_ERR_LOG("Release failed"); + } + + delete g_audioSourceProcessInput.buffer; + g_audioSourceProcessInput.buffer = nullptr; + + if (g_amInstance.DeactivateAudioInterrupt(g_sample.interrupt) != 0) { + MEDIA_ERR_LOG("deactivate audio interrupt failed"); + } + g_audioCap.reset(); + g_audioCap = nullptr; + g_audioSourceProcessInput.bThreadRun = false; + MediaMutexUnLock(g_sample.mutex); + (void)MediaMutexDestroy(&g_sample.mutex); +} + static void* AudioCaptureProcess(void* arg) { FILE *pfd = (FILE *)arg; @@ -163,22 +187,7 @@ static void* AudioCaptureProcess(void* arg) MEDIA_INFO_LOG("audioCap Read readCnt = %d, size = %d", readCnt, ret); } fclose(pfd); - - if (!g_audioCap->Stop()) { - MEDIA_ERR_LOG("Stop failed"); - } - if (!g_audioCap->Release()) { - MEDIA_ERR_LOG("Release failed"); - } - - delete g_audioSourceProcessInput.buffer; - g_audioSourceProcessInput.buffer = nullptr; - - if (g_amInstance.DeactivateAudioInterrupt(g_sample.interrupt) != 0) { - MEDIA_ERR_LOG("deactivate audio interrupt failed"); - } - g_audioCap.reset(); - g_audioSourceProcessInput.bThreadRun = false; + AudioCaptureStop(); MEDIA_INFO_LOG("AudioCaptureProcess end"); return NULL; } @@ -253,10 +262,12 @@ static int32_t HandleAudioCaptureCmd(int32_t argc, const char **argv) } MEDIA_INFO_LOG("unmute cmd out"); } else if ((strncmp(g_sample.control, "dumpinfo", strlen("dumpinfo")) == 0)) { + MediaMutexLock(g_sample.mutex); if (g_audioCap != nullptr && g_audioCap.get() != nullptr) { AudioCapturerDebugInfo info; g_audioCap->DumpInfo(info); } + MediaMutexUnLock(g_sample.mutex); } else { MEDIA_ERR_LOG("[AudioCaptureSample]control cmd not supported:%s do nothing", g_sample.control); return 0; @@ -346,6 +357,12 @@ int32_t AudioCaptureSample(int32_t argc, const char **argv) std::string filePath = ""; g_sample.needStop = false; g_interruptHintStop = false; + g_sample.mutex = MediaMutexCreate(nullptr); + if (g_sample.mutex == nullptr) { + MEDIA_ERR_LOG("create mutex failed"); + g_audioSourceProcessInput.bThreadRun = false; + return -1; + } SampleAudioCapturerInfo audioCapturerInfo = {}; AudioSession sessionId = AUDIO_SESSION_ID_NONE; FILE *pfd = nullptr; diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp index ec7d37df5..447b97cd8 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/camera_preview_sample_wrapper.cpp @@ -56,7 +56,7 @@ const static int16_t MEDIA_PATH_MAX = 260; const static int32_t WAIT_SURFACE_INIT_SUCCESS_US = 100000; const static int32_t WAIT_START_CAPTURE_SUCCESS_US = 100000; const static int32_t WAIT_SURFACE_DEINIT_SUCCESS_US = 100000; -const static int16_t SURFACE_BYTE_ALIGNMENT = 64; +const static int16_t SURFACE_BYTE_ALIGNMENT = 128; const static int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128; const static int16_t JPEG_HEIGHT_BYTE_ALIGNMENT = 16; const static int16_t JPEG_HEIGHT_DIVISOR = 2; diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp index 75ffd97da..fab4fe7d7 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.cpp @@ -185,6 +185,7 @@ static void DeinitPlayerResources(MediaVideoPlay *videoPlay) { (void)videoPlay->player_.reset(); videoPlay->isExited_ = true; + videoPlay->isEntered_ = false; (void)MediaThreadCondDestroy(&videoPlay->cond_); (void)MediaMutexDestroy(&videoPlay->mutex_); } @@ -221,6 +222,7 @@ static int32_t VideoPlay(MediaVideoPlay *videoPlay) static void VideoStopAndExit(MediaVideoPlay *videoPlay) { + MediaMutexLock(videoPlay->mutex_); int32_t ret = videoPlay->player_->Stop(); if (ret != 0) { MEDIA_ERR_LOG("stop failed"); @@ -229,7 +231,6 @@ static void VideoStopAndExit(MediaVideoPlay *videoPlay) if (ret != 0) { MEDIA_ERR_LOG("reset failed"); } - MediaMutexLock(videoPlay->mutex_); videoPlay->isPlaybackCompleted_ = false; videoPlay->isPlayed_ = false; videoPlay->isPause_ = false; @@ -399,9 +400,16 @@ MediaVideoPlay::~MediaVideoPlay() int32_t MediaVideoPlay::StartVideoPlay(void) { + if (isEntered_) { + MEDIA_INFO_LOG("video play is not stop, can not start!"); + return MEDIA_OK; + } isExited_ = false; isEntered_ = true; MediaThreadattr attr = { "VideoPlayThread", 0x2000, THREAD_SCHED_INVALID, 0, true }; + if (isSyncExitMode_) { + attr.detached = false; + } threadHandle_ = MediaThreadCreate(VideoPlayThread, this, &attr); if (threadHandle_ == NULL) { MEDIA_ERR_LOG("create thread failed\n"); @@ -480,16 +488,32 @@ int32_t MediaVideoPlay::GetDumpInfo(PlayerDebugInfo *playerInfo) int32_t MediaVideoPlay::StopVideoPlay(void) { MediaMutexLock(mutex_); - if (isPlaybackStopped_ || isPlaybackCompleted_ || interruptHintStop_) { - MEDIA_ERR_LOG("video play already stopped"); + if (!isPlayed_) { + MEDIA_INFO_LOG("video play is not start,can not stop!"); + isPlaybackStopped_ = true; MediaMutexUnLock(mutex_); return MEDIA_OK; } - + if (isPlaybackStopped_ || isPlaybackCompleted_ || interruptHintStop_) { + if (isLoop_) { + if (!isPlaybackCompleted_) { + MEDIA_ERR_LOG("video play already stopped"); + MediaMutexUnLock(mutex_); + return MEDIA_OK; + } + } else { + MEDIA_ERR_LOG("video play already stopped"); + MediaMutexUnLock(mutex_); + return MEDIA_OK; + } + } isPlaybackStopped_ = true; MediaThreadCondSignal(cond_); - play = nullptr; MediaMutexUnLock(mutex_); + if (isSyncExitMode_) { + MediaThreadJoin(&threadHandle_); + } + play = nullptr; return MEDIA_OK; } @@ -505,6 +529,15 @@ void MediaVideoPlay::SetVideoPlayLoop(bool isLoop) MediaMutexUnLock(mutex_); } +void MediaVideoPlay::SetSyncExitMode(bool isSyncExitMode) +{ + MediaMutexLock(mutex_); + if (!isEntered_) { + isSyncExitMode_ = isSyncExitMode; + } + MediaMutexUnLock(mutex_); +} + void MediaVideoPlay::DestroyVideoPlaySource(void) { if (!isEntered_) { diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h index 267fbffa2..7d260a49c 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_play_wrapper.h @@ -36,6 +36,7 @@ public: int32_t ResumeVideoPlay(void); int32_t GetDumpInfo(PlayerDebugInfo *playerInfo); void SetVideoPlayLoop(bool isLoop); + void SetSyncExitMode(bool isSyncExitMode); bool IsExitCompletely(void); Surface *surface_ = nullptr; AudioInterrupt interrupt_; @@ -61,6 +62,7 @@ public: bool isPureVideo_ = false; static MediaVideoPlay *play; private: + bool isSyncExitMode_ = false; static void *VideoPlayThread(void *arg); void DestroyVideoPlaySource(void); }; diff --git a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp index eb7e38851..7faba9cc8 100644 --- a/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp +++ b/code/sdk/middleware/services/media/foundation/sample/wrapper/video_player_sample_wrapper.cpp @@ -69,7 +69,7 @@ using namespace OHOS; const static int32_t WAIT_SURFACE_INIT_SUCCESS_US = 100000; const static int32_t WAIT_PLAYER_SUCCESS_US = 1000000; const static int32_t WAIT_SURFACE_DEINIT_SUCCESS_US = 100000; -const static int16_t SURFACE_BYTE_ALIGNMENT = 64; +const static int16_t SURFACE_BYTE_ALIGNMENT = 128; const static int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128; const static int16_t JPEG_HEIGHT_BYTE_ALIGNMENT = 16; const static int16_t JPEG_HEIGHT_DIVISOR = 2; diff --git a/code/sdk/middleware/utils/dfx/dfx_reboot/cpu_utils/private/cpu_utils.c b/code/sdk/middleware/utils/dfx/dfx_reboot/cpu_utils/private/cpu_utils.c index fe0f4e02d..f4439d64a 100644 --- a/code/sdk/middleware/utils/dfx/dfx_reboot/cpu_utils/private/cpu_utils.c +++ b/code/sdk/middleware/utils/dfx/dfx_reboot/cpu_utils/private/cpu_utils.c @@ -39,6 +39,10 @@ #include "diag_log.h" #endif +#if defined CFG_DRIVERS_NANDFLASH +#include "nandflash_config.h" +#endif + #if MCU_ONLY static cpu_utils_reboot_cb g_reboot_mcu_cb = NULL; #endif @@ -157,6 +161,10 @@ static bool cpu_utils_sys_reboot_req(ipc_action_t message, const volatile ipc_pa g_reboot_mcu_cb(src); return true; } +#endif +#ifdef CFG_DRIVERS_NANDFLASH + nand_driver_init(SPEED_SLOW); + set_trans_type(TRANS_BY_CPU_SINGLE_LINE); #endif reset_deal_with_fs(); cpu_utils_reset_chip_with_log(src, (reboot_cause_t)reboot_reason); diff --git a/code/sdk/middleware/utils/dfx/log/log.c b/code/sdk/middleware/utils/dfx/log/log.c index 68c80f5b1..360e14d1b 100644 --- a/code/sdk/middleware/utils/dfx/log/log.c +++ b/code/sdk/middleware/utils/dfx/log/log.c @@ -214,7 +214,7 @@ void log_event(const uint8_t *buffer, uint16_t length) } } else { #if (SLAVE_BY_LIBRA_BT || SLAVE_BY_LIBRA_GNSS || SLAVE_BY_SOCMN1_ONLY || SLAVE_BY_BS25_ONLY || \ - SLAVE_BY_WS53_ONLY || CHIP_WS63) + SLAVE_BY_WS53_ONLY || CHIP_WS63 || CHIP_BRANDY) g_trigger_tx = true; #endif g_missed_messages++; diff --git a/code/sdk/middleware/utils/dfx/log/log_oml_exception.c b/code/sdk/middleware/utils/dfx/log/log_oml_exception.c index b1ad6d09c..905042f9f 100644 --- a/code/sdk/middleware/utils/dfx/log/log_oml_exception.c +++ b/code/sdk/middleware/utils/dfx/log/log_oml_exception.c @@ -437,17 +437,19 @@ void log_oml_dump_stack(void) #endif } -static void log_watch_dog_disable(void) +static void log_watch_dog_reconfigure(void) { watchdog_turnon_clk(); uapi_watchdog_disable(); - watchdog_turnoff_clk(); + /* DUMPÁ÷³ÌºÄʱ¹ý´ó£¬ÐèÒªÖØÐÂÅäÖù·³¬Ê±Ê±¼ä */ + uapi_watchdog_set_time(CHIP_WDT_TIMEOUT_256S); + uapi_watchdog_enable(WDT_MODE_INTERRUPT); } void log_oml_memory_dump(void) { #if (USE_COMPRESS_LOG_INSTEAD_OF_SDT_LOG == NO) - log_watch_dog_disable(); + log_watch_dog_reconfigure(); #if CORE == BT /* BT core has just one block of ram */ uapi_tcxo_delay_ms(DUMP_DELAY); diff --git a/code/sdk/middleware/utils/dfx/log_reader/private/log_uart.c b/code/sdk/middleware/utils/dfx/log_reader/private/log_uart.c index be9873f3e..f83753b9c 100644 --- a/code/sdk/middleware/utils/dfx/log_reader/private/log_uart.c +++ b/code/sdk/middleware/utils/dfx/log_reader/private/log_uart.c @@ -27,7 +27,7 @@ #ifdef SUPPORT_IPC #include "ipc.h" #endif - +#include "exception.h" #include "uart.h" #include "watchdog.h" #include "log_uart_porting.h" @@ -368,7 +368,7 @@ void log_main(const void *unused_p) uint32_t wdg_left_time; uapi_watchdog_get_left_time(&wdg_left_time); - if (wdg_left_time < LOG_MIN_WATCHDOG_LEFT_TIME) { + if (wdg_left_time < LOG_MIN_WATCHDOG_LEFT_TIME && get_exception_status() != true) { uapi_watchdog_kick(); } } diff --git a/code/sdk/open_source/openharmony/CMakeLists.txt b/code/sdk/open_source/openharmony/CMakeLists.txt index 2b820816d..390b4013a 100644 --- a/code/sdk/open_source/openharmony/CMakeLists.txt +++ b/code/sdk/open_source/openharmony/CMakeLists.txt @@ -25,6 +25,7 @@ add_subdirectory_with_alias_if_exist(base/global/i18n_lite ${PROJECT_BINARY_DIR} add_subdirectory_with_alias_if_exist(base/global/resmgr_lite ${PROJECT_BINARY_DIR}/ohos/resmgr) add_subdirectory_with_alias_if_exist(utils/native/lite/file ${PROJECT_BINARY_DIR}/ohos/file) add_subdirectory_with_alias_if_exist(utils/native/lite/kv_store ${PROJECT_BINARY_DIR}/ohos/kv_store) +add_subdirectory_with_alias_if_exist(utils/native/lite/js/builtin ${PROJECT_BINARY_DIR}/ohos/storage_jsi) add_subdirectory_with_alias_if_exist(hiviewdfx/hiview/lite ${PROJECT_BINARY_DIR}/ohos/hiview) add_subdirectory_with_alias_if_exist(hiviewdfx/hievent/lite ${PROJECT_BINARY_DIR}/ohos/hievent) add_subdirectory_with_alias_if_exist(hiviewdfx/hilog/lite/frameworks/mini ${PROJECT_BINARY_DIR}/ohos/hilog) diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a index bbe39f801..379ea9914 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a index 2faac3d92..65707de8f 100644 Binary files a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-xts/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt index e7594794b..f548b9466 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/CMakeLists.txt @@ -8,6 +8,12 @@ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/jsi ${CMAKE_CURRENT_SOURCE_DIR}/ + ${CMAKE_CURRENT_SOURCE_DIR}/include/base + ${CMAKE_CURRENT_SOURCE_DIR}/include/context +) + +set(PRIVATE_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base ${CMAKE_CURRENT_SOURCE_DIR}/animation ${CMAKE_CURRENT_SOURCE_DIR}/base ${CMAKE_CURRENT_SOURCE_DIR}/base/cache @@ -22,15 +28,10 @@ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/router ${CMAKE_CURRENT_SOURCE_DIR}/stylemgr ${CMAKE_CURRENT_SOURCE_DIR}/targets -) - -set(PRIVATE_HEADER - ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits - ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/components ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/animator ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits @@ -46,6 +47,23 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/ohos_deps ${ROOT_DIR}/open_source/openharmony/third_party/cJSON ${ROOT_DIR}/open_source/openharmony/third_party/qrcodegen/cpp + ${ROOT_DIR}/open_source/openharmony/base/global/i18n_lite/frameworks/i18n/include + ${ROOT_DIR}/open_source/openharmony/base/global/i18n_lite/interfaces/kits/i18n/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/api + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/ext + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/include + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/ecma/base + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/jmem + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/jrt + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-core/lit + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-ext/include + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-ext/include/jerryscript-ext + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-port/default/include + ${ROOT_DIR}/open_source/openharmony/third_party/jerryscript/jerry-libm/include + ) if("JS_ENABLE" IN_LIST DEFINES) @@ -153,6 +171,12 @@ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/jsi ${CMAKE_CURRENT_SOURCE_DIR}/ + ${CMAKE_CURRENT_SOURCE_DIR}/include/base + ${CMAKE_CURRENT_SOURCE_DIR}/include/context +) + +set(PRIVATE_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base ${CMAKE_CURRENT_SOURCE_DIR}/animation ${CMAKE_CURRENT_SOURCE_DIR}/base ${CMAKE_CURRENT_SOURCE_DIR}/base/cache @@ -167,10 +191,7 @@ set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/router ${CMAKE_CURRENT_SOURCE_DIR}/stylemgr ${CMAKE_CURRENT_SOURCE_DIR}/targets -) - -set(PRIVATE_HEADER - ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base + ${ROOT_DIR}/application/wearable/service/msg_center/include/vendor_app ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service @@ -191,6 +212,10 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/ohos_deps ${ROOT_DIR}/open_source/openharmony/third_party/cJSON ${ROOT_DIR}/open_source/openharmony/third_party/qrcodegen/cpp + ${ROOT_DIR}/open_source/openharmony/base/global/i18n_lite/frameworks/i18n/include + ${ROOT_DIR}/open_source/openharmony/base/global/i18n_lite/interfaces/kits/i18n/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include ) if("JS_ENABLE" IN_LIST DEFINES) @@ -224,10 +249,12 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/components/tab_content_component.cpp ${CMAKE_CURRENT_SOURCE_DIR}/components/tabs_component.cpp ${CMAKE_CURRENT_SOURCE_DIR}/components/text_component.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/components/baidu_map_component.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/app_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/dfx_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/module_manager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/locale_module.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/app_data_module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/cjson_parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/console_log_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets/console_module.cpp @@ -287,3 +314,171 @@ install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/interfaces" "*") install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/include" "*") build_component() + +set(COMPONENT_NAME "baidumapcomponent") +set(MODULE_NAME "ohos") +set(AUTO_DEF_FILE_ID TRUE) + +set(PUBLIC_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/async + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/jsi + ${CMAKE_CURRENT_SOURCE_DIR}/ + ${CMAKE_CURRENT_SOURCE_DIR}/animation + ${CMAKE_CURRENT_SOURCE_DIR}/base + ${CMAKE_CURRENT_SOURCE_DIR}/base/cache + ${CMAKE_CURRENT_SOURCE_DIR}/components + ${CMAKE_CURRENT_SOURCE_DIR}/context + ${CMAKE_CURRENT_SOURCE_DIR}/directive + ${CMAKE_CURRENT_SOURCE_DIR}/include/base + ${CMAKE_CURRENT_SOURCE_DIR}/include/context + ${CMAKE_CURRENT_SOURCE_DIR}/jsi + ${CMAKE_CURRENT_SOURCE_DIR}/modules + ${CMAKE_CURRENT_SOURCE_DIR}/modules/presets + ${CMAKE_CURRENT_SOURCE_DIR}/router + ${CMAKE_CURRENT_SOURCE_DIR}/stylemgr + ${CMAKE_CURRENT_SOURCE_DIR}/targets + ${ROOT_DIR}/application/wearable/service/msg_center/include/vendor_app +) + +set(PRIVATE_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/components + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/animator + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils + ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/layout + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits/common + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/font + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/dfx + ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include + ${ROOT_DIR}/application/wearable/ohos_deps + ${ROOT_DIR}/open_source/openharmony/third_party/cJSON + ${ROOT_DIR}/open_source/openharmony/third_party/qrcodegen/cpp + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent +) + +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/modules/baidumapcomponent/baidumap.cpp +) + +set(COMPONENT_PUBLIC_CCFLAGS +) + +set(COMPONENT_CCFLAGS + -std=c++11 + -Wno-error + -Wno-unused-parameter + -fno-exceptions + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -Wno-undef + -Wno-bitwise-op-parentheses + -Wno-shift-op-parentheses + -nostdlibinc + -nostdinc + -nostdlib + -Wno-c++11-narrowing + -Wno-error=unused-function +) + +set(WHOLE_LINK + true +) + +set(MAIN_COMPONENT + false +) + +set(PUBLIC_DEFINES + FEATURE_MODULE_BAIDU + FEATURE_COMPONENT_BAIDUMAP +) + +set(PRIVATE_DEFINES +) + +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/interfaces" "*") +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/include" "*") + +build_component() + +set(COMPONENT_NAME "brightness") +set(MODULE_NAME "ohos") +set(AUTO_DEF_FILE_ID TRUE) + +set(PUBLIC_HEADER +) + +set(PRIVATE_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/base + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/components + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/animator + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils + ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/layout + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits/common + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/font + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/kits/dfx + ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include + ${ROOT_DIR}/open_source/openharmony/third_party/cJSON + ${ROOT_DIR}/open_source/openharmony/third_party/qrcodegen/cpp + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display +) + +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/modules/display/display.cpp +) + +set(COMPONENT_PUBLIC_CCFLAGS +) + +set(COMPONENT_CCFLAGS + -std=c++11 + -Wno-error + -Wno-unused-parameter + -fno-exceptions + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -Wno-undef + -Wno-bitwise-op-parentheses + -Wno-shift-op-parentheses + -nostdlibinc + -nostdinc + -nostdlib + -Wno-c++11-narrowing + -Wno-error=unused-function +) + +set(WHOLE_LINK + true +) + +set(MAIN_COMPONENT + false +) + +set(PUBLIC_DEFINES + FEATURE_MODULE_BRIGHTNESS +) + +set(PRIVATE_DEFINES +) + +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/interfaces" "*") +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/include" "*") + +build_component() diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_bc.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_bc.h index 6c357d593..f29b72f5c 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_bc.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_bc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. + * Copyright (c) 2020-2023 Huawei Device Co., Ltd. * 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 @@ -13,8 +13,10 @@ * limitations under the License. */ -// AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY +#ifndef OHOS_ACELITE_FRAMEWORK_MIN_BC_H +#define OHOS_ACELITE_FRAMEWORK_MIN_BC_H +// AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY #include #ifndef ACELITE_FRAMEWORK_RAW_BUFFER @@ -25,17 +27,17 @@ #define OHOS_ACELITE_FRAMEWORK_MIN_SNAPSHOT_BUFFER const uint8_t g_frameworkBCBuffer[] = { - 0x4a, 0x52, 0x52, 0x59, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0a, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x28, 0x00, 0x30, 0x28, - 0x01, 0xc3, 0x4f, 0x08, 0x46, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x21, 0x00, 0x03, 0x02, + 0x4a, 0x52, 0x52, 0x59, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x0a, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x41, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x33, 0x2c, + 0x01, 0xd4, 0x5d, 0x08, 0x53, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x41, 0x00, 0x03, 0x02, 0x02, 0x06, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x47, 0x03, 0x00, 0x00, 0xe7, 0x03, 0x00, 0x00, 0x47, 0x04, 0x00, 0x00, 0x28, 0x06, 0x56, 0x02, - 0x60, 0x21, 0x07, 0x28, 0x07, 0x56, 0x03, 0x63, 0x11, 0x0a, 0x2b, 0x03, 0x08, 0x01, 0xb7, 0xc9, - 0x01, 0x21, 0x28, 0x09, 0x56, 0x04, 0x60, 0x21, 0x05, 0x36, 0x04, 0x0a, 0x11, 0x08, 0x29, 0x04, - 0x01, 0xbd, 0x01, 0x0f, 0x28, 0x00, 0x1d, 0x04, 0x28, 0x05, 0xcc, 0x00, 0x28, 0x01, 0xb7, 0xd2, - 0x0b, 0x04, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x00, + 0x47, 0x03, 0x00, 0x00, 0xe7, 0x03, 0x00, 0x00, 0x47, 0x04, 0x00, 0x00, 0x2c, 0x06, 0x64, 0x02, + 0x6e, 0x21, 0x07, 0x2c, 0x07, 0x64, 0x03, 0x71, 0x11, 0x0a, 0x2f, 0x03, 0x08, 0x01, 0xc8, 0xda, + 0x01, 0x21, 0x2c, 0x09, 0x64, 0x04, 0x6e, 0x21, 0x05, 0x39, 0x04, 0x0a, 0x11, 0x08, 0x2d, 0x04, + 0x01, 0xce, 0x01, 0x0f, 0x2c, 0x00, 0x1d, 0x04, 0x2c, 0x05, 0xdd, 0x00, 0x2c, 0x01, 0xc8, 0xe3, + 0x0b, 0x04, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x09, 0x27, 0x3b, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x87, 0x07, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, @@ -46,159 +48,161 @@ const uint8_t g_frameworkBCBuffer[] = 0xe7, 0x10, 0x00, 0x00, 0x87, 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x00, 0x87, 0x12, 0x00, 0x00, 0xe7, 0x12, 0x00, 0x00, 0x47, 0x13, 0x00, 0x00, 0xc7, 0x13, 0x00, 0x00, 0x47, 0x14, 0x00, 0x00, 0xe7, 0x14, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0xe7, 0x15, 0x00, 0x00, 0x47, 0x16, 0x00, 0x00, - 0x88, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, - 0x10, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x08, 0x05, 0x00, 0x00, - 0x48, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0xe0, 0x05, 0x00, 0x00, 0x10, 0x06, 0x00, 0x00, - 0x48, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x50, 0x07, 0x00, 0x00, - 0x70, 0x07, 0x00, 0x00, 0x98, 0x07, 0x00, 0x00, 0xb0, 0x07, 0x00, 0x00, 0xa8, 0x09, 0x00, 0x00, - 0x41, 0x04, 0x43, 0x05, 0x07, 0x2c, 0x2d, 0x39, 0x14, 0x1c, 0x18, 0x09, 0x48, 0x27, 0x0a, 0x48, - 0x28, 0x0b, 0x48, 0x29, 0x0c, 0xcb, 0x00, 0xce, 0x2a, 0x01, 0xce, 0x2b, 0x02, 0x36, 0x05, 0x0d, - 0x28, 0x2e, 0xd1, 0x0e, 0x36, 0x05, 0x0d, 0x28, 0x2f, 0xd1, 0x0f, 0x36, 0x05, 0x0d, 0x28, 0x30, - 0xd1, 0x10, 0x36, 0x05, 0x0d, 0x28, 0x31, 0xd1, 0x11, 0x2b, 0x06, 0x12, 0x32, 0xc8, 0x2b, 0x06, - 0x13, 0x33, 0xc8, 0x36, 0x06, 0x0d, 0x28, 0x34, 0xd1, 0x14, 0x36, 0x06, 0x0d, 0x28, 0x35, 0xd1, - 0x15, 0x36, 0x06, 0x0d, 0x28, 0x36, 0xd1, 0x16, 0x36, 0x06, 0x0d, 0x28, 0x37, 0xd1, 0x17, 0x14, - 0x48, 0x0a, 0x18, 0x48, 0x0b, 0x19, 0x48, 0x1b, 0x1a, 0x48, 0x1d, 0x1c, 0x48, 0x1f, 0x1e, 0x48, - 0x21, 0x20, 0x48, 0x23, 0x22, 0xcb, 0x04, 0x3b, 0x08, 0x24, 0x28, 0x04, 0xc0, 0x3a, 0x25, 0x28, - 0x38, 0xc0, 0xcb, 0x03, 0x36, 0x07, 0x0d, 0x28, 0x3a, 0xd1, 0x26, 0x47, 0x07, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, 0x01, 0x01, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, - 0x07, 0x08, 0x00, 0x00, 0x37, 0x01, 0x3a, 0x02, 0x28, 0x00, 0xbf, 0x46, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x02, 0x87, 0x07, 0x00, 0x00, - 0x67, 0x08, 0x00, 0x00, 0x37, 0x00, 0x3a, 0x01, 0xba, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, - 0xc7, 0x16, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x37, 0x00, 0x37, 0x00, 0x35, 0x01, 0x8b, 0x02, - 0x34, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x01, - 0x01, 0x01, 0x02, 0x02, 0x07, 0x02, 0x00, 0x00, 0x28, 0x01, 0x56, 0x00, 0x60, 0x21, 0x05, 0x2f, - 0x6a, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x03, - 0x03, 0x04, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x47, 0x17, 0x00, 0x00, 0x47, 0x18, 0x00, 0x00, - 0x07, 0x19, 0x00, 0x00, 0x3b, 0x03, 0x04, 0x29, 0x00, 0x01, 0x14, 0x32, 0x00, 0x4f, 0x18, 0x05, - 0x48, 0x02, 0x06, 0xb3, 0x03, 0x46, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x04, - 0x04, 0x04, 0x0a, 0x0a, 0x87, 0x19, 0x00, 0x00, 0xe7, 0x19, 0x00, 0x00, 0x87, 0x1a, 0x00, 0x00, - 0xe7, 0x1a, 0x00, 0x00, 0x67, 0x1b, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, 0x28, 0x00, 0xd4, 0x04, - 0x28, 0x01, 0xd4, 0x05, 0x28, 0x02, 0xd4, 0x06, 0x28, 0x03, 0xd4, 0x07, 0x3c, 0x09, 0xba, 0xd4, - 0x08, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, - 0x01, 0x05, 0x0a, 0x0c, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x27, 0x1c, 0x00, 0x00, - 0x07, 0x07, 0x00, 0x00, 0xa7, 0x1c, 0x00, 0x00, 0x67, 0x1d, 0x00, 0x00, 0xe7, 0x1d, 0x00, 0x00, - 0x87, 0x15, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, - 0x42, 0x01, 0x00, 0x31, 0x4f, 0xd4, 0x05, 0x2b, 0x02, 0x01, 0x06, 0x30, 0xb0, 0x03, 0x3b, 0x03, - 0x07, 0x28, 0x01, 0xc0, 0x21, 0x06, 0x29, 0x0a, 0x01, 0xbd, 0x04, 0x3b, 0x04, 0x08, 0x28, 0x01, - 0xc0, 0x3a, 0x09, 0x28, 0x0b, 0xbf, 0x46, 0x00, 0x05, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, - 0x01, 0x03, 0x04, 0x05, 0x07, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, - 0x28, 0x00, 0x00, 0x00, 0x42, 0x01, 0x00, 0x3b, 0x02, 0x03, 0x28, 0x04, 0xbf, 0x46, 0x00, 0x00, - 0x07, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, 0x01, 0x05, 0x05, 0x06, 0x47, 0x06, 0x00, 0x00, - 0x47, 0x05, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x41, 0x01, 0x42, 0x02, 0x00, 0x36, 0x03, 0x02, 0xcb, 0x01, 0x2b, 0x04, 0x03, 0x02, 0x28, 0x05, - 0xb0, 0x03, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x01, 0x00, 0x19, 0x00, 0x05, 0x00, - 0x00, 0x0a, 0x16, 0x16, 0x87, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, - 0x27, 0x1c, 0x00, 0x00, 0x27, 0x1f, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, - 0x47, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, - 0xe7, 0x1f, 0x00, 0x00, 0x67, 0x20, 0x00, 0x00, 0xc7, 0x20, 0x00, 0x00, 0x87, 0x0f, 0x00, 0x00, - 0x47, 0x10, 0x00, 0x00, 0x47, 0x13, 0x00, 0x00, 0xc7, 0x16, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, - 0x67, 0x0c, 0x00, 0x00, 0x67, 0x1d, 0x00, 0x00, 0xa7, 0x0e, 0x00, 0x00, 0x41, 0x02, 0x36, 0x03, - 0x0a, 0x35, 0x0b, 0x3a, 0x0c, 0x28, 0x04, 0xc0, 0xcb, 0x01, 0x3b, 0x05, 0x0d, 0x2a, 0x01, 0xc5, - 0x36, 0x06, 0x0e, 0x67, 0x07, 0x1d, 0x07, 0x36, 0x06, 0x0f, 0x67, 0x07, 0x11, 0x07, 0xcf, 0x01, - 0x00, 0x01, 0x11, 0x36, 0x06, 0x10, 0x67, 0x07, 0x21, 0x0a, 0x3b, 0x01, 0x0b, 0x32, 0x01, 0xc0, - 0xcc, 0x00, 0x04, 0x28, 0x00, 0x21, 0x0e, 0x36, 0x00, 0x11, 0x21, 0x09, 0x3b, 0x00, 0x12, 0x36, - 0x08, 0x13, 0xc0, 0x04, 0x36, 0x09, 0x14, 0xcb, 0x02, 0x28, 0x02, 0x21, 0x06, 0x3b, 0x02, 0x15, - 0xba, 0x04, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, - 0x01, 0x02, 0x02, 0x03, 0x47, 0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x01, 0x00, - 0x36, 0x01, 0x00, 0xb1, 0x03, 0x45, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x07, 0x03, - 0x03, 0x07, 0x0c, 0x0e, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, - 0x07, 0x07, 0x00, 0x00, 0x67, 0x1d, 0x00, 0x00, 0x47, 0x17, 0x00, 0x00, 0x47, 0x18, 0x00, 0x00, - 0x47, 0x21, 0x00, 0x00, 0xa7, 0x21, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, - 0x41, 0x03, 0x42, 0x04, 0x01, 0x42, 0x05, 0x02, 0x36, 0x00, 0x07, 0xcb, 0x03, 0x3b, 0x06, 0x08, - 0x29, 0x00, 0x04, 0x14, 0x31, 0x4f, 0x18, 0x09, 0x48, 0x0c, 0x0a, 0x48, 0x0d, 0x0b, 0xb3, 0x03, - 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x00, - 0x02, 0x07, 0x0c, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, - 0x87, 0x06, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0xc7, 0x08, 0x00, 0x00, 0xc7, 0x0a, 0x00, 0x00, - 0x67, 0x0c, 0x00, 0x00, 0xa7, 0x0c, 0x00, 0x00, 0xe7, 0x0d, 0x00, 0x00, 0x3b, 0x02, 0x07, 0xba, - 0xd7, 0x00, 0x28, 0x00, 0x21, 0x09, 0x3b, 0x00, 0x08, 0x29, 0x03, 0x04, 0xc6, 0x04, 0x3b, 0x05, - 0x09, 0x28, 0x06, 0xc0, 0xd7, 0x01, 0x3b, 0x05, 0x0a, 0x28, 0x01, 0xc0, 0x21, 0x09, 0x3b, 0x01, - 0x0b, 0x29, 0x03, 0x04, 0xc6, 0x04, 0x47, 0x06, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, - 0x01, 0x04, 0x05, 0x05, 0x47, 0x06, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, - 0x67, 0x0d, 0x00, 0x00, 0xce, 0x00, 0x01, 0x3b, 0x02, 0x04, 0x28, 0x03, 0xbf, 0x46, 0x00, 0x00, - 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x06, 0x00, 0x00, 0x01, 0x06, 0x06, 0x07, 0x05, 0x00, 0x00, - 0x07, 0x08, 0x00, 0x00, 0xe7, 0x19, 0x00, 0x00, 0x67, 0x20, 0x00, 0x00, 0x87, 0x19, 0x00, 0x00, - 0x67, 0x08, 0x00, 0x00, 0x00, 0x15, 0x10, 0x3b, 0x00, 0x01, 0x30, 0xbf, 0x37, 0x02, 0x3a, 0x03, - 0x37, 0x04, 0xc0, 0x45, 0x00, 0x1d, 0x08, 0x3b, 0x00, 0x05, 0xb9, 0x10, 0x46, 0x00, 0x00, 0x00, - 0x0b, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x00, 0x04, 0x05, 0x0b, 0x0b, 0x47, 0x05, 0x00, 0x00, - 0x67, 0x1b, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, 0x87, 0x19, 0x00, 0x00, 0xe7, 0x1a, 0x00, 0x00, - 0x87, 0x1a, 0x00, 0x00, 0x67, 0x20, 0x00, 0x00, 0x37, 0x05, 0xd7, 0x00, 0x3c, 0x06, 0xba, 0xd7, - 0x01, 0x37, 0x07, 0xd7, 0x02, 0x37, 0x08, 0xd7, 0x03, 0x6b, 0x01, 0x00, 0x1d, 0x06, 0x29, 0x04, - 0x01, 0xbd, 0x21, 0x12, 0x37, 0x09, 0x3a, 0x0a, 0x2b, 0x02, 0x01, 0x00, 0x28, 0x03, 0xb3, 0x04, - 0x28, 0x01, 0xd5, 0x05, 0x04, 0x46, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x02, - 0x03, 0x03, 0x07, 0x07, 0xe7, 0x0c, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0x07, 0x22, 0x00, 0x00, - 0x07, 0x08, 0x00, 0x00, 0x3b, 0x00, 0x03, 0x28, 0x01, 0x30, 0xc6, 0xd7, 0x02, 0x28, 0x04, 0x56, - 0x02, 0x60, 0x21, 0x11, 0x37, 0x05, 0x1d, 0x05, 0x1c, 0xd5, 0x05, 0x04, 0x37, 0x05, 0x3a, 0x06, - 0x28, 0x02, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x00, - 0x01, 0x01, 0x04, 0x04, 0x07, 0x22, 0x00, 0x00, 0x67, 0x08, 0x00, 0x00, 0xc7, 0x16, 0x00, 0x00, - 0x37, 0x01, 0xd7, 0x00, 0x28, 0x00, 0x11, 0x0e, 0x01, 0x07, 0x3b, 0x00, 0x02, 0xba, 0xb6, 0x36, - 0x00, 0x03, 0x0d, 0x08, 0x46, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x01, - 0x01, 0x03, 0x04, 0x04, 0x47, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0x67, 0x1d, 0x00, 0x00, - 0x28, 0x00, 0x21, 0x06, 0x29, 0x01, 0x00, 0xbd, 0x11, 0x12, 0x36, 0x00, 0x03, 0x11, 0x07, 0x36, - 0x00, 0x03, 0x01, 0x06, 0x29, 0x02, 0x00, 0x3f, 0x01, 0x04, 0x28, 0x00, 0x45, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0xa7, 0x1c, 0x00, 0x00, - 0x28, 0x00, 0x21, 0x05, 0x36, 0x00, 0x01, 0x45, 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x02, - 0x02, 0x04, 0x08, 0x09, 0x87, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0xc7, 0x22, 0x00, 0x00, - 0x67, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, - 0x41, 0x02, 0x42, 0x03, 0x01, 0x31, 0x53, 0x6a, 0x00, 0x21, 0x04, 0x28, 0x03, 0x11, 0x34, 0x37, - 0x04, 0x1d, 0x05, 0x14, 0xd5, 0x04, 0x04, 0x37, 0x04, 0x35, 0x00, 0x1d, 0x08, 0x37, 0x04, 0x28, - 0x00, 0x1c, 0xc9, 0x04, 0x37, 0x04, 0x35, 0x00, 0xcb, 0x02, 0x3b, 0x02, 0x05, 0x28, 0x03, 0xc0, - 0x6d, 0x06, 0x11, 0x0c, 0x3b, 0x02, 0x07, 0x28, 0x03, 0xbf, 0x28, 0x08, 0x01, 0x04, 0x31, 0x53, - 0x45, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x00, - 0x00, 0x02, 0x04, 0x04, 0x87, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0xc7, 0x13, 0x00, 0x00, - 0x67, 0x23, 0x00, 0x00, 0x3b, 0x00, 0x02, 0x3b, 0x00, 0x03, 0x28, 0x01, 0xc0, 0x32, 0x00, 0xc5, - 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, - 0x01, 0x01, 0x03, 0x04, 0xc7, 0x22, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x31, 0x53, 0x6a, 0x00, 0x21, 0x15, 0x37, 0x01, 0x21, 0x11, 0x37, 0x01, 0x35, 0x00, 0x21, 0x0b, - 0x37, 0x01, 0x35, 0x00, 0x3a, 0x02, 0x28, 0x03, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x01, 0x01, 0x01, 0x02, 0x02, 0x47, 0x0a, 0x00, 0x00, - 0x3b, 0x00, 0x01, 0xba, 0x45, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x02, - 0x02, 0x02, 0x04, 0x04, 0x07, 0x24, 0x00, 0x00, 0xa7, 0x24, 0x00, 0x00, 0x28, 0x00, 0xd4, 0x02, - 0x28, 0x01, 0xd4, 0x03, 0x46, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x03, 0x03, 0x07, 0x24, 0x00, 0x00, 0x67, 0x0d, 0x00, 0x00, 0xa7, 0x24, 0x00, 0x00, - 0x37, 0x00, 0x21, 0x09, 0x37, 0x00, 0x3a, 0x01, 0x37, 0x02, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x07, 0x06, 0x00, 0x00, - 0x36, 0x01, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x05, 0x01, - 0x01, 0x05, 0x0c, 0x0d, 0x47, 0x05, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, - 0x07, 0x07, 0x00, 0x00, 0x07, 0x25, 0x00, 0x00, 0x67, 0x25, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, - 0x87, 0x26, 0x00, 0x00, 0x67, 0x20, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, - 0x70, 0x00, 0x00, 0x00, 0x41, 0x01, 0x42, 0x02, 0x00, 0x2a, 0x03, 0x7b, 0x4f, 0x11, 0x07, 0x29, - 0x03, 0x02, 0x3f, 0x45, 0x30, 0xd5, 0x05, 0xcb, 0x01, 0x29, 0x06, 0x04, 0x35, 0x07, 0x35, 0x08, - 0x3a, 0x09, 0x28, 0x02, 0xc0, 0x66, 0x21, 0x0d, 0x3b, 0x04, 0x0a, 0x28, 0x02, 0xc0, 0x3a, 0x0b, - 0x28, 0x0c, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x29, 0x00, 0x06, 0x01, - 0x02, 0x05, 0x0b, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x27, 0x27, 0x00, 0x00, - 0x27, 0x28, 0x00, 0x00, 0xa7, 0x28, 0x00, 0x00, 0x47, 0x29, 0x00, 0x00, 0xa7, 0x29, 0x00, 0x00, - 0x47, 0x03, 0x00, 0x00, 0x67, 0x2a, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x36, 0x02, 0x00, 0xd7, - 0x01, 0x68, 0x05, 0x00, 0x11, 0x09, 0x2b, 0x03, 0x06, 0x01, 0xc9, 0x01, 0x2a, 0x68, 0x07, 0x00, - 0x11, 0x09, 0x2b, 0x0b, 0x03, 0x01, 0xc3, 0x01, 0x1e, 0x68, 0x08, 0x00, 0x11, 0x08, 0x29, 0x04, - 0x01, 0xbd, 0x01, 0x13, 0x28, 0x09, 0x56, 0x01, 0x60, 0x21, 0x0c, 0x2b, 0x03, 0x00, 0x01, 0x3a, - 0x0a, 0x28, 0x03, 0xc0, 0xc9, 0x04, 0x46, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x05, 0x02, - 0x02, 0x06, 0x0b, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, - 0x87, 0x06, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0x67, 0x20, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, - 0x87, 0x1e, 0x00, 0x00, 0x67, 0x0c, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x42, - 0x03, 0x01, 0x28, 0x06, 0x56, 0x03, 0x60, 0x21, 0x0b, 0x3b, 0x03, 0x07, 0x29, 0x02, 0x02, 0xc6, - 0xcc, 0x03, 0x04, 0x3b, 0x04, 0x08, 0x28, 0x03, 0xc0, 0x3a, 0x09, 0x28, 0x0b, 0xbf, 0x3b, 0x05, - 0x0a, 0x28, 0x03, 0xbf, 0x46, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x98, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x68, 0x06, 0x00, 0x00, + 0x88, 0x06, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x00, 0xd0, 0x06, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00, + 0x20, 0x07, 0x00, 0x00, 0x60, 0x07, 0x00, 0x00, 0xb8, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, + 0x28, 0x08, 0x00, 0x00, 0x60, 0x08, 0x00, 0x00, 0x78, 0x08, 0x00, 0x00, 0x18, 0x09, 0x00, 0x00, + 0x68, 0x09, 0x00, 0x00, 0x88, 0x09, 0x00, 0x00, 0xb0, 0x09, 0x00, 0x00, 0xc8, 0x09, 0x00, 0x00, + 0x46, 0x00, 0x46, 0x01, 0x46, 0x02, 0x4d, 0x27, 0x03, 0x4d, 0x28, 0x04, 0x46, 0x05, 0x46, 0x06, + 0x4d, 0x29, 0x07, 0x14, 0x1c, 0x18, 0x09, 0x55, 0x2a, 0x0a, 0x55, 0x2b, 0x0b, 0x55, 0x2c, 0x0c, + 0xdc, 0x00, 0x2c, 0x2d, 0xdc, 0x01, 0x2c, 0x2e, 0xdc, 0x02, 0x39, 0x03, 0x0d, 0x2c, 0x2f, 0xe2, + 0x0e, 0x39, 0x03, 0x0d, 0x2c, 0x30, 0xe2, 0x0f, 0x39, 0x03, 0x0d, 0x2c, 0x31, 0xe2, 0x10, 0x39, + 0x03, 0x0d, 0x2c, 0x32, 0xe2, 0x11, 0x2f, 0x04, 0x12, 0x33, 0xd9, 0x2f, 0x04, 0x13, 0x34, 0xd9, + 0x39, 0x04, 0x0d, 0x2c, 0x35, 0xe2, 0x14, 0x39, 0x04, 0x0d, 0x2c, 0x36, 0xe2, 0x15, 0x39, 0x04, + 0x0d, 0x2c, 0x37, 0xe2, 0x16, 0x39, 0x04, 0x0d, 0x2c, 0x38, 0xe2, 0x17, 0x14, 0x55, 0x0a, 0x18, + 0x55, 0x0b, 0x19, 0x55, 0x1b, 0x1a, 0x55, 0x1d, 0x1c, 0x55, 0x1f, 0x1e, 0x55, 0x21, 0x20, 0x55, + 0x23, 0x22, 0xdc, 0x06, 0x3e, 0x08, 0x24, 0x2c, 0x06, 0xd1, 0x3d, 0x25, 0x2c, 0x39, 0xd1, 0xdc, + 0x05, 0x39, 0x07, 0x0d, 0x2c, 0x3a, 0xe2, 0x26, 0x54, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x49, 0x00, 0x03, 0x04, 0x04, 0x04, 0x0a, 0x0a, 0xc7, 0x16, 0x00, 0x00, + 0x27, 0x17, 0x00, 0x00, 0xc7, 0x17, 0x00, 0x00, 0x27, 0x18, 0x00, 0x00, 0xa7, 0x18, 0x00, 0x00, + 0xe7, 0x09, 0x00, 0x00, 0x2c, 0x00, 0xe5, 0x04, 0x2c, 0x01, 0xe5, 0x05, 0x2c, 0x02, 0xe5, 0x06, + 0x2c, 0x03, 0xe5, 0x07, 0x3f, 0x09, 0xcb, 0xe5, 0x08, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, 0x01, 0x05, 0x0a, 0x0c, 0x47, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x67, 0x19, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0xe7, 0x19, 0x00, 0x00, + 0xa7, 0x1a, 0x00, 0x00, 0x27, 0x1b, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0xc7, 0x1b, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x4d, 0x00, 0x01, 0x34, 0x5d, 0xe5, 0x05, 0x2f, + 0x02, 0x01, 0x06, 0x33, 0xc1, 0x03, 0x3e, 0x03, 0x07, 0x2c, 0x01, 0xd1, 0x21, 0x06, 0x2d, 0x0a, + 0x01, 0xce, 0x04, 0x3e, 0x04, 0x08, 0x2c, 0x01, 0xd1, 0x3d, 0x09, 0x2c, 0x0b, 0xd0, 0x53, 0x00, + 0x05, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, 0x01, 0x03, 0x04, 0x05, 0x07, 0x05, 0x00, 0x00, + 0x47, 0x06, 0x00, 0x00, 0xc7, 0x1b, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x01, 0x3e, + 0x02, 0x03, 0x2c, 0x04, 0xd0, 0x53, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, + 0x01, 0x05, 0x05, 0x06, 0x47, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x01, 0x46, 0x02, 0x39, 0x03, 0x01, + 0xdc, 0x02, 0x2f, 0x04, 0x03, 0x01, 0x2c, 0x05, 0xc1, 0x03, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x00, 0x03, 0x0a, 0x16, 0x16, 0x67, 0x1c, 0x00, 0x00, + 0x67, 0x19, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, + 0x07, 0x06, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, 0x27, 0x1d, 0x00, 0x00, + 0xa7, 0x1d, 0x00, 0x00, 0x07, 0x1e, 0x00, 0x00, 0x87, 0x0f, 0x00, 0x00, 0x47, 0x10, 0x00, 0x00, + 0x47, 0x13, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, 0xc7, 0x1b, 0x00, 0x00, 0x67, 0x0c, 0x00, 0x00, + 0xa7, 0x1a, 0x00, 0x00, 0xa7, 0x0e, 0x00, 0x00, 0x39, 0x04, 0x0a, 0x38, 0x0b, 0x3d, 0x0c, 0x2c, + 0x03, 0xd1, 0xe8, 0x01, 0x3e, 0x05, 0x0d, 0x2e, 0x01, 0xd6, 0x39, 0x06, 0x0e, 0x75, 0x07, 0x1d, + 0x07, 0x39, 0x06, 0x0f, 0x75, 0x07, 0x11, 0x07, 0xe0, 0x01, 0x00, 0x01, 0x11, 0x39, 0x06, 0x10, + 0x75, 0x07, 0x21, 0x0a, 0x3e, 0x01, 0x0b, 0x35, 0x01, 0xd1, 0xdd, 0x00, 0x04, 0x2c, 0x00, 0x21, + 0x0e, 0x39, 0x00, 0x11, 0x21, 0x09, 0x3e, 0x00, 0x12, 0x39, 0x08, 0x13, 0xd1, 0x04, 0x39, 0x09, + 0x14, 0xe8, 0x02, 0x2c, 0x02, 0x21, 0x06, 0x3e, 0x02, 0x15, 0xcb, 0x04, 0x53, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x01, 0x01, 0x02, 0x02, 0x03, 0x47, 0x05, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x2f, 0x02, 0x01, 0x00, 0x39, 0x01, 0x00, 0xc2, 0x03, 0x52, 0x00, 0x00, + 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x07, 0x03, 0x03, 0x07, 0x0c, 0x0e, 0x87, 0x05, 0x00, 0x00, + 0xc7, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0xa7, 0x1a, 0x00, 0x00, + 0x07, 0x1f, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, 0xc7, 0x20, 0x00, 0x00, 0x27, 0x21, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x4d, 0x01, 0x03, 0x4d, 0x02, 0x04, 0x46, 0x05, + 0x39, 0x00, 0x07, 0xdc, 0x05, 0x3e, 0x06, 0x08, 0x2d, 0x00, 0x03, 0x14, 0x34, 0x5d, 0x18, 0x09, + 0x55, 0x0c, 0x0a, 0x55, 0x0d, 0x0b, 0xc4, 0x03, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x01, 0x00, 0x49, 0x00, 0x05, 0x00, 0x02, 0x07, 0x0c, 0x0c, 0x07, 0x05, 0x00, 0x00, + 0x87, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, + 0xc7, 0x08, 0x00, 0x00, 0xc7, 0x0a, 0x00, 0x00, 0x67, 0x0c, 0x00, 0x00, 0xa7, 0x0c, 0x00, 0x00, + 0xe7, 0x0d, 0x00, 0x00, 0x3e, 0x02, 0x07, 0xcb, 0xe8, 0x00, 0x2c, 0x00, 0x21, 0x09, 0x3e, 0x00, + 0x08, 0x2d, 0x03, 0x04, 0xd7, 0x04, 0x3e, 0x05, 0x09, 0x2c, 0x06, 0xd1, 0xe8, 0x01, 0x3e, 0x05, + 0x0a, 0x2c, 0x01, 0xd1, 0x21, 0x09, 0x3e, 0x01, 0x0b, 0x2d, 0x03, 0x04, 0xd7, 0x04, 0x54, 0x06, + 0x05, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x01, 0x01, 0x04, 0x05, 0x05, 0xc7, 0x05, 0x00, 0x00, + 0x87, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x67, 0x0d, 0x00, 0x00, 0xdf, 0x00, 0x01, 0x3e, + 0x02, 0x04, 0x2c, 0x03, 0xd0, 0x53, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x05, 0x01, + 0x01, 0x05, 0x0c, 0x0d, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, + 0x07, 0x07, 0x00, 0x00, 0x87, 0x21, 0x00, 0x00, 0xe7, 0x21, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, + 0x07, 0x23, 0x00, 0x00, 0xa7, 0x1d, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0xc7, 0x1b, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x01, 0x46, 0x02, 0x2e, 0x03, 0x89, 0x5d, 0x11, 0x07, 0x2d, + 0x03, 0x01, 0x42, 0x52, 0x33, 0xe6, 0x05, 0xdc, 0x02, 0x2d, 0x06, 0x04, 0x38, 0x07, 0x38, 0x08, + 0x3d, 0x09, 0x2c, 0x01, 0xd1, 0x74, 0x21, 0x0d, 0x3e, 0x04, 0x0a, 0x2c, 0x01, 0xd1, 0x3d, 0x0b, + 0x2c, 0x0c, 0xd1, 0x04, 0x53, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x49, 0x00, 0x06, 0x01, + 0x02, 0x05, 0x0b, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0xa7, 0x23, 0x00, 0x00, + 0xa7, 0x24, 0x00, 0x00, 0x27, 0x25, 0x00, 0x00, 0xc7, 0x25, 0x00, 0x00, 0x27, 0x26, 0x00, 0x00, + 0x47, 0x03, 0x00, 0x00, 0xe7, 0x26, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x39, 0x02, 0x00, 0xe8, + 0x01, 0x76, 0x05, 0x00, 0x11, 0x09, 0x2f, 0x03, 0x06, 0x01, 0xda, 0x01, 0x2a, 0x76, 0x07, 0x00, + 0x11, 0x09, 0x2f, 0x0b, 0x03, 0x01, 0xd4, 0x01, 0x1e, 0x76, 0x08, 0x00, 0x11, 0x08, 0x2d, 0x04, + 0x01, 0xce, 0x01, 0x13, 0x2c, 0x09, 0x64, 0x01, 0x6e, 0x21, 0x0c, 0x2f, 0x03, 0x00, 0x01, 0x3d, + 0x0a, 0x2c, 0x03, 0xd1, 0xda, 0x04, 0x53, 0x00, 0x10, 0x00, 0x01, 0x00, 0x09, 0x00, 0x05, 0x02, + 0x02, 0x07, 0x0e, 0x0f, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x47, 0x27, 0x00, 0x00, + 0x07, 0x07, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0xa7, 0x1d, 0x00, 0x00, + 0x87, 0x02, 0x00, 0x00, 0xc7, 0x25, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0xc7, 0x1b, 0x00, 0x00, + 0x67, 0x0c, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x02, 0x4d, 0x01, 0x03, 0x2c, 0x07, + 0x64, 0x03, 0x6e, 0x21, 0x0b, 0x3e, 0x03, 0x08, 0x2d, 0x02, 0x02, 0xd7, 0xdd, 0x03, 0x04, 0x2c, + 0x09, 0x64, 0x04, 0x71, 0x21, 0x04, 0x2c, 0x04, 0x11, 0x09, 0x2f, 0x02, 0x0a, 0x03, 0xda, 0x61, + 0x52, 0x3e, 0x05, 0x0b, 0x2c, 0x03, 0xd1, 0x3d, 0x0c, 0x2c, 0x0e, 0xd0, 0x3e, 0x06, 0x0d, 0x2c, + 0x03, 0xd0, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x01, 0x01, 0x03, 0x03, 0x04, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, - 0x2b, 0x03, 0x01, 0x02, 0x28, 0x00, 0xb1, 0x03, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2f, 0x03, 0x01, 0x02, 0x2c, 0x00, 0xc2, 0x03, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x01, 0x00, 0x09, 0x00, 0x07, 0x03, 0x03, 0x06, 0x0b, 0x0d, 0x47, 0x05, 0x00, 0x00, - 0x87, 0x05, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x47, 0x17, 0x00, 0x00, 0x47, 0x18, 0x00, 0x00, - 0xc7, 0x2a, 0x00, 0x00, 0x47, 0x21, 0x00, 0x00, 0xa7, 0x21, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, - 0x70, 0x00, 0x00, 0x00, 0x42, 0x03, 0x01, 0x42, 0x04, 0x02, 0x3b, 0x05, 0x06, 0x29, 0x00, 0x04, - 0x14, 0x32, 0x00, 0x4f, 0x18, 0x07, 0x31, 0x4f, 0x18, 0x08, 0x48, 0x0b, 0x09, 0x48, 0x0c, 0x0a, - 0xb3, 0x03, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x36, 0x00, 0x01, 0x45, - 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x01, 0x01, 0x03, 0x03, 0x03, 0x47, 0x05, 0x00, 0x00, - 0x87, 0x05, 0x00, 0x00, 0x2b, 0x01, 0x02, 0x00, 0xc8, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x03, 0x03, 0x04, 0x04, 0x04, 0x47, 0x06, 0x00, 0x00, - 0x28, 0x03, 0x2a, 0x00, 0x29, 0x01, 0x02, 0x3d, 0x04, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x07, 0x1f, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, + 0x27, 0x28, 0x00, 0x00, 0xc7, 0x20, 0x00, 0x00, 0x27, 0x21, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x4d, 0x01, 0x03, 0x4d, 0x02, 0x04, 0x3e, 0x05, 0x06, 0x2d, 0x00, 0x04, + 0x14, 0x35, 0x00, 0x5d, 0x18, 0x07, 0x34, 0x5d, 0x18, 0x08, 0x55, 0x0b, 0x09, 0x55, 0x0c, 0x0a, + 0xc4, 0x03, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x49, 0x00, 0x01, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x39, 0x00, 0x01, 0x52, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x03, 0x01, 0x01, 0x03, 0x03, 0x03, 0x47, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x2f, 0x01, 0x02, 0x00, 0xd9, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x01, 0x01, 0x01, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, + 0x07, 0x08, 0x00, 0x00, 0x3a, 0x01, 0x3d, 0x02, 0x2c, 0x00, 0xd0, 0x53, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x02, 0x87, 0x07, 0x00, 0x00, + 0x67, 0x08, 0x00, 0x00, 0x3a, 0x00, 0x3d, 0x01, 0xcb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x01, 0x00, 0x49, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, + 0x87, 0x1e, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x3a, 0x00, 0x38, 0x01, 0x99, 0x02, + 0x37, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x02, 0x01, + 0x01, 0x01, 0x02, 0x02, 0x07, 0x02, 0x00, 0x00, 0x2c, 0x01, 0x64, 0x00, 0x6e, 0x21, 0x05, 0x28, + 0x78, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x49, 0x00, 0x07, 0x03, + 0x03, 0x04, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x07, 0x1f, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, + 0x07, 0x29, 0x00, 0x00, 0x3e, 0x03, 0x04, 0x2d, 0x00, 0x01, 0x14, 0x35, 0x00, 0x5d, 0x18, 0x05, + 0x55, 0x02, 0x06, 0xc4, 0x03, 0x53, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x49, 0x00, 0x06, 0x00, + 0x00, 0x01, 0x06, 0x06, 0x07, 0x05, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x27, 0x17, 0x00, 0x00, + 0xa7, 0x1d, 0x00, 0x00, 0xc7, 0x16, 0x00, 0x00, 0x67, 0x08, 0x00, 0x00, 0x00, 0x15, 0x10, 0x3e, + 0x00, 0x01, 0x33, 0xd0, 0x3a, 0x02, 0x3d, 0x03, 0x3a, 0x04, 0xd1, 0x52, 0x00, 0x1d, 0x08, 0x3e, + 0x00, 0x05, 0xca, 0x10, 0x53, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x01, 0x00, 0x49, 0x00, 0x07, 0x00, + 0x04, 0x05, 0x0b, 0x0b, 0x47, 0x05, 0x00, 0x00, 0xa7, 0x18, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, + 0xc7, 0x16, 0x00, 0x00, 0x27, 0x18, 0x00, 0x00, 0xc7, 0x17, 0x00, 0x00, 0xa7, 0x1d, 0x00, 0x00, + 0x3a, 0x05, 0xe8, 0x00, 0x3f, 0x06, 0xcb, 0xe8, 0x01, 0x3a, 0x07, 0xe8, 0x02, 0x3a, 0x08, 0xe8, + 0x03, 0x79, 0x01, 0x00, 0x1d, 0x06, 0x2d, 0x04, 0x01, 0xce, 0x21, 0x12, 0x3a, 0x09, 0x3d, 0x0a, + 0x2f, 0x02, 0x01, 0x00, 0x2c, 0x03, 0xc4, 0x04, 0x2c, 0x01, 0xe6, 0x05, 0x04, 0x53, 0x00, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x49, 0x00, 0x05, 0x02, 0x03, 0x03, 0x07, 0x07, 0xe7, 0x0c, 0x00, 0x00, + 0x47, 0x03, 0x00, 0x00, 0x87, 0x29, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x2c, + 0x01, 0x33, 0xd7, 0xe8, 0x02, 0x2c, 0x04, 0x64, 0x02, 0x6e, 0x21, 0x11, 0x3a, 0x05, 0x1d, 0x05, + 0x1c, 0xe6, 0x05, 0x04, 0x3a, 0x05, 0x3d, 0x06, 0x2c, 0x02, 0xd1, 0x04, 0x53, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x01, 0x00, 0x49, 0x00, 0x03, 0x00, 0x01, 0x01, 0x04, 0x04, 0x87, 0x29, 0x00, 0x00, + 0x67, 0x08, 0x00, 0x00, 0x87, 0x1e, 0x00, 0x00, 0x3a, 0x01, 0xe8, 0x00, 0x2c, 0x00, 0x11, 0x0e, + 0x01, 0x07, 0x3e, 0x00, 0x02, 0xcb, 0xc7, 0x39, 0x00, 0x03, 0x0d, 0x08, 0x53, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x01, 0x00, 0x49, 0x00, 0x02, 0x01, 0x01, 0x03, 0x04, 0x04, 0x47, 0x05, 0x00, 0x00, + 0x07, 0x06, 0x00, 0x00, 0xa7, 0x1a, 0x00, 0x00, 0x2c, 0x00, 0x21, 0x06, 0x2d, 0x01, 0x00, 0xce, + 0x11, 0x12, 0x39, 0x00, 0x03, 0x11, 0x07, 0x39, 0x00, 0x03, 0x01, 0x06, 0x2d, 0x02, 0x00, 0x42, + 0x01, 0x04, 0x2c, 0x00, 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x49, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x02, 0xe7, 0x19, 0x00, 0x00, 0x2c, 0x00, 0x21, 0x05, 0x39, 0x00, 0x01, 0x52, + 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x02, 0x02, 0x04, 0x08, 0x09, 0x47, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x47, 0x2a, 0x00, 0x00, 0xe7, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x08, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x4d, 0x01, 0x02, 0x46, 0x03, 0x34, 0x61, 0x78, + 0x00, 0x21, 0x04, 0x2c, 0x02, 0x11, 0x34, 0x3a, 0x04, 0x1d, 0x05, 0x14, 0xe6, 0x04, 0x04, 0x3a, + 0x04, 0x38, 0x00, 0x1d, 0x08, 0x3a, 0x04, 0x2c, 0x00, 0x1c, 0xda, 0x04, 0x3a, 0x04, 0x38, 0x00, + 0xdc, 0x03, 0x3e, 0x03, 0x05, 0x2c, 0x02, 0xd1, 0x7b, 0x06, 0x11, 0x0c, 0x3e, 0x03, 0x07, 0x2c, + 0x02, 0xd0, 0x2c, 0x08, 0x01, 0x04, 0x34, 0x61, 0x52, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x01, 0x00, 0x49, 0x00, 0x07, 0x00, 0x00, 0x02, 0x04, 0x04, 0x87, 0x05, 0x00, 0x00, + 0x47, 0x05, 0x00, 0x00, 0xc7, 0x13, 0x00, 0x00, 0xe7, 0x2a, 0x00, 0x00, 0x3e, 0x00, 0x02, 0x3e, + 0x00, 0x03, 0x2c, 0x01, 0xd1, 0x35, 0x00, 0xd6, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x01, 0x01, 0x01, 0x03, 0x04, 0x47, 0x2a, 0x00, 0x00, + 0xc7, 0x1b, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x34, 0x61, 0x78, 0x00, 0x21, 0x15, 0x3a, 0x01, + 0x21, 0x11, 0x3a, 0x01, 0x38, 0x00, 0x21, 0x0b, 0x3a, 0x01, 0x38, 0x00, 0x3d, 0x02, 0x2c, 0x03, + 0xd1, 0x04, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x49, 0x00, 0x03, 0x01, + 0x01, 0x01, 0x02, 0x02, 0x47, 0x0a, 0x00, 0x00, 0x3e, 0x00, 0x01, 0xcb, 0x52, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x87, 0x2b, 0x00, 0x00, + 0x27, 0x2c, 0x00, 0x00, 0x2c, 0x00, 0xe5, 0x02, 0x2c, 0x01, 0xe5, 0x03, 0x53, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x01, 0x00, 0x49, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x03, 0x87, 0x2b, 0x00, 0x00, + 0x67, 0x0d, 0x00, 0x00, 0x27, 0x2c, 0x00, 0x00, 0x3a, 0x00, 0x21, 0x09, 0x3a, 0x00, 0x3d, 0x01, + 0x3a, 0x02, 0xd1, 0x04, 0x53, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x49, 0x00, 0x01, 0x01, + 0x01, 0x02, 0x02, 0x02, 0x87, 0x06, 0x00, 0x00, 0x39, 0x01, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x49, 0x00, 0x05, 0x03, 0x03, 0x04, 0x04, 0x04, 0xc7, 0x05, 0x00, 0x00, + 0x2c, 0x03, 0x2e, 0x00, 0x2d, 0x01, 0x02, 0x40, 0x04, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x00, 0x06, 0x00, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x06, 0x00, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x04, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x06, 0x00, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x09, 0x00, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x00, 0x08, 0x00, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x03, 0x00, 0x61, 0x6d, 0x64, 0x00, 0x09, 0x00, 0x56, 0x69, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x00, - 0x01, 0x00, 0x74, 0x00, 0x01, 0x00, 0x65, 0x00, 0x01, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x73, 0x00, - 0x01, 0x00, 0x72, 0x00, 0x01, 0x00, 0x69, 0x00, 0x01, 0x00, 0x6f, 0x00, 0x01, 0x00, 0x63, 0x00, + 0x01, 0x00, 0x74, 0x00, 0x01, 0x00, 0x65, 0x00, 0x01, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x69, 0x00, + 0x01, 0x00, 0x6f, 0x00, 0x01, 0x00, 0x73, 0x00, 0x01, 0x00, 0x72, 0x00, 0x01, 0x00, 0x63, 0x00, 0x06, 0x00, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x05, 0x00, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x00, 0x04, 0x00, 0x70, 0x75, 0x73, 0x68, 0x03, 0x00, 0x70, 0x6f, 0x70, 0x00, 0x03, 0x00, 0x74, 0x6f, 0x70, 0x00, 0x09, 0x00, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x00, 0x04, 0x00, @@ -214,27 +218,29 @@ const uint8_t g_frameworkBCBuffer[] = 0x73, 0x6f, 0x72, 0x74, 0x06, 0x00, 0x53, 0x50, 0x4c, 0x49, 0x43, 0x45, 0x06, 0x00, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x07, 0x00, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, 0x45, 0x00, 0x07, 0x00, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x00, 0x04, 0x00, 0x6b, 0x65, 0x79, 0x73, 0x03, 0x00, - 0x6d, 0x61, 0x70, 0x00, 0x06, 0x00, 0x24, 0x77, 0x61, 0x74, 0x63, 0x68, 0x06, 0x00, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x0e, 0x00, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x0a, 0x00, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, - 0x05, 0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, 0x04, 0x00, 0x5f, 0x63, 0x74, 0x78, 0x07, 0x00, - 0x5f, 0x67, 0x65, 0x74, 0x74, 0x65, 0x72, 0x00, 0x03, 0x00, 0x5f, 0x66, 0x6e, 0x00, 0x05, 0x00, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x00, 0x0a, 0x00, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x05, 0x00, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x0a, 0x00, 0x5f, 0x68, 0x69, 0x6a, - 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x06, 0x00, 0x5f, 0x5f, 0x6f, 0x62, 0x5f, 0x5f, 0x07, 0x00, - 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x07, 0x00, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, - 0x68, 0x00, 0x09, 0x00, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x00, 0x05, 0x00, - 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x04, 0x00, 0x63, 0x61, 0x6c, 0x6c, 0x05, 0x00, 0x61, 0x70, - 0x70, 0x6c, 0x79, 0x00, 0x03, 0x00, 0x67, 0x65, 0x74, 0x00, 0x03, 0x00, 0x73, 0x65, 0x74, 0x00, - 0x09, 0x00, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x73, 0x00, 0x07, 0x00, 0x5f, 0x6f, - 0x62, 0x73, 0x4d, 0x61, 0x70, 0x00, 0x07, 0x00, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x00, - 0x07, 0x00, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x04, 0x00, 0x5f, 0x6b, 0x65, 0x79, - 0x03, 0x00, 0x5f, 0x76, 0x6d, 0x00, 0x0f, 0x00, 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5d, 0x00, 0x08, 0x00, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x0e, 0x00, 0x69, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x68, 0x65, - 0x65, 0x74, 0x06, 0x00, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x07, 0x00, 0x24, 0x72, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x00, 0x04, 0x00, 0x64, 0x61, 0x74, 0x61, 0x0a, 0x00, 0x73, 0x74, 0x79, 0x6c, - 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x04, 0x00, 0x62, 0x69, 0x6e, 0x64, 0x0c, 0x00, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65 + 0x6d, 0x61, 0x70, 0x00, 0x06, 0x00, 0x24, 0x77, 0x61, 0x74, 0x63, 0x68, 0x04, 0x00, 0x5f, 0x63, + 0x74, 0x78, 0x07, 0x00, 0x5f, 0x67, 0x65, 0x74, 0x74, 0x65, 0x72, 0x00, 0x03, 0x00, 0x5f, 0x66, + 0x6e, 0x00, 0x05, 0x00, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x00, 0x0a, 0x00, 0x5f, 0x6c, 0x61, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x05, 0x00, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x0a, 0x00, + 0x5f, 0x68, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x06, 0x00, 0x5f, 0x5f, 0x6f, 0x62, + 0x5f, 0x5f, 0x07, 0x00, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x07, 0x00, 0x66, 0x6f, + 0x72, 0x45, 0x61, 0x63, 0x68, 0x00, 0x09, 0x00, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x00, 0x05, 0x00, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x04, 0x00, 0x63, 0x61, 0x6c, 0x6c, + 0x05, 0x00, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x00, 0x06, 0x00, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x0e, 0x00, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x0a, 0x00, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x03, 0x00, 0x67, 0x65, + 0x74, 0x00, 0x03, 0x00, 0x73, 0x65, 0x74, 0x00, 0x03, 0x00, 0x5f, 0x76, 0x6d, 0x00, 0x0f, 0x00, + 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5d, 0x00, + 0x08, 0x00, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0e, 0x00, 0x69, 0x6e, 0x69, 0x74, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x06, 0x00, 0x72, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x07, 0x00, 0x24, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x00, 0x04, 0x00, 0x64, 0x61, + 0x74, 0x61, 0x0a, 0x00, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x04, 0x00, + 0x62, 0x69, 0x6e, 0x64, 0x0b, 0x00, 0x5f, 0x5f, 0x61, 0x70, 0x70, 0x56, 0x69, 0x6e, 0x67, 0x5f, + 0x5f, 0x00, 0x0c, 0x00, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, + 0x05, 0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, 0x09, 0x00, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, + 0x68, 0x65, 0x73, 0x00, 0x07, 0x00, 0x5f, 0x6f, 0x62, 0x73, 0x4d, 0x61, 0x70, 0x00, 0x07, 0x00, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x00, 0x07, 0x00, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x00, 0x04, 0x00, 0x5f, 0x6b, 0x65, 0x79 }; #endif +#endif // OHOS_ACELITE_FRAMEWORK_MIN_BC_H diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_js.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_js.h index 4a5d10d8d..393093cbe 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_js.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/framework_min_js.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2020-2023 Huawei Device Co., Ltd. * 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 @@ -13,7 +13,11 @@ * limitations under the License. */ +#ifndef OHOS_ACELITE_FRAMEWORK_MIN_JS_H +#define OHOS_ACELITE_FRAMEWORK_MIN_JS_H + // AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY +#include #ifndef ACELITE_FRAMEWORK_RAW_BUFFER #error THIS FILE CAN ONLY BE INCLUDED BY RAW BUFFER CPP @@ -51,9 +55,11 @@ const char * const g_frameworkJSBuffer = "'},s=Object.keys(r).map((function(t){return r[t]}));function c(t){if(!(this instanceof c))" "return new c(t);var e=this._vm=this;'[object Object]'===Object.prototype.toString.call(t)&" "&Object.keys(t).forEach((function(n){var i=t[n];'render'===n?e.$render=i:'data'===n?functi" - "on(t,e){'function'==typeof e&&(e=e.call(t,t));Object.keys(e).forEach((function(n){return f" - "unction(t,e,n){Object.defineProperty(t,n,{enumerable:!1,configurable:!0,get:function(){ret" - "urn e[n]},set:function(t){e[n]=t}})}(t,e,n)})),o.of(e)}(e,i):'styleSheet'===n?initStyleShe" - "et(i):'function'==typeof i&&(e[n]=i.bind(e))}))}return c.prototype.$watch=function(t,e,n){" - "return new i(this,t,e,n)},c}));"; + "on(t,e){'function'==typeof e&&(e=e.call(t,t));if('undefined'!=typeof __appVing__&&__appVin" + "g__)return void(t.data=e);Object.keys(e).forEach((function(n){return function(t,e,n){Objec" + "t.defineProperty(t,n,{enumerable:!1,configurable:!0,get:function(){return e[n]},set:functi" + "on(t){e[n]=t}})}(t,e,n)})),o.of(e)}(e,i):'styleSheet'===n?initStyleSheet(i):'function'==ty" + "peof i&&(e[n]=i.bind(e))}))}return c.prototype.$watch=function(t,e,n){return new i(this,t," + "e,n)},c}));"; #endif +#endif // OHOS_ACELITE_FRAMEWORK_MIN_JS_H diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/keys.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/keys.h index aeffcf675..c05f28bb6 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/keys.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/keys.h @@ -290,6 +290,9 @@ enum { #ifdef FEATURE_COMPONENT_VIDEO KEYWORD(VIDEO, video) // video tag name #endif // FEATURE_COMPONENT_VIDEO +#ifdef FEATURE_COMPONENT_BAIDUMAP + KEYWORD(BAIDUMAP, baidumap) // baidumap tag name +#endif // FEATURE_COMPONENT_BAIDUMAP KEYWORD(WIDTH, width) // common attributes KEYWORD(WRAP, wrap) // flex wrap #ifdef FEATURE_DATE_FORMAT diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a index 54e282d4e..16e297962 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a index 86889f011..de42bae56 100644 Binary files a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-xts/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.cpp new file mode 100644 index 000000000..7a40c0209 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.cpp @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. + * 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 "acelite_config.h" +#ifdef FEATURE_COMPONENT_BAIDUMAP +#include "baidu_map_component.h" +#include "ace_log.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +// API-method +const char * const BaiduMapComponent::FUNC_SET_ZOOM_EVENT_ENABLED = "set_zoom_event_enabled"; +const char * const BaiduMapComponent::FUNC_ZOOM_IN = "zoom_in"; +const char * const BaiduMapComponent::FUNC_ZOOM_OUT = "zoom_out"; +const char * const BaiduMapComponent::FUNC_ZOOM_TO = "zoom_to"; +const char * const BaiduMapComponent::FUNC_ZOOM_BY = "zoom_by"; +const char * const BaiduMapComponent::FUNC_SET_MAP_BACKGROUND_COLOR = "set_map_background_color"; +const char * const BaiduMapComponent::FUNC_SET_MAP_OVERLAYER_ENABLED = "set_map_overlayer_enabled"; +const char * const BaiduMapComponent::FUNC_SET_MAP_TITLES_ENABLED = "set_map_tiles_enabled"; +const char * const BaiduMapComponent::FUNC_SET_SCROLL_GESTURES_ENABLED = "set_scroll_gestures_enabled"; +const char * const BaiduMapComponent::FUNC_SCROLL_BY = "scroll_by"; +const char * const BaiduMapComponent::FUNC_NEW_LAT_LNG = "new_lat_lng"; +const char * const BaiduMapComponent::FUNC_NEW_LAT_LNG_ZOOM = "new_lat_lng_zoom"; +const char * const BaiduMapComponent::FUNC_CLEAR_MAP_OVERLAYER = "clear_map_overlayer"; +const char * const BaiduMapComponent::FUNC_DRAW_MARKER = "draw_marker"; +const char * const BaiduMapComponent::FUNC_DRAW_POLYGON = "draw_polygon"; +const char * const BaiduMapComponent::FUNC_DRAW_PATH = "draw_path"; +const char * const BaiduMapComponent::FUNC_DRAW_TEXT = "draw_text"; +const char * const BaiduMapComponent::FUNC_START_LISTEN_MY_GEO_LOCATION = "start_listen_my_geo_location"; +const char * const BaiduMapComponent::FUNC_STOP_LISTEN_MY_GEO_LOCATION = "stop_listen_my_geo_location"; +const char * const BaiduMapComponent::FUNC_GET_MY_GEO_STATUS = "get_my_geo_status"; +const char * const BaiduMapComponent::FUNC_GET_MY_GEO_LOCATION = "get_my_geo_location"; + +const FunctionMap BaiduMapComponent::funcMap[] = { + {FUNC_SET_ZOOM_EVENT_ENABLED, SetZoomEventEnabled}, + {FUNC_ZOOM_IN, ZoomIn}, + {FUNC_ZOOM_OUT, ZoomOut}, + {FUNC_ZOOM_TO, ZoomTo}, + {FUNC_ZOOM_BY, ZoomBy}, + {FUNC_SET_MAP_BACKGROUND_COLOR, SetMapBackgroundColor}, + {FUNC_SET_MAP_OVERLAYER_ENABLED, SetMapOverlayerEnabled}, + {FUNC_SET_MAP_TITLES_ENABLED, SetMapTilesEnabled}, + {FUNC_SET_SCROLL_GESTURES_ENABLED, SetScrollGesturesEnabled}, + {FUNC_SCROLL_BY, ScrollBy}, + {FUNC_NEW_LAT_LNG, NewLatLng}, + {FUNC_NEW_LAT_LNG_ZOOM, NewLatLngZoom}, + {FUNC_CLEAR_MAP_OVERLAYER, ClearMapOverlayer}, + {FUNC_DRAW_MARKER, DrawMarker}, + {FUNC_DRAW_POLYGON, DrawPolygon}, + {FUNC_DRAW_PATH, DrawPath}, + {FUNC_DRAW_TEXT, DrawText}, + {FUNC_START_LISTEN_MY_GEO_LOCATION, StartListenMyGeoLocation}, + {FUNC_STOP_LISTEN_MY_GEO_LOCATION, StopListenMyGeoLocation}, + {FUNC_GET_MY_GEO_STATUS, GetMyGeoStatus}, + {FUNC_GET_MY_GEO_LOCATION, GetMyGeoLocation} +}; +BaiduMapComponent::BaiduMapComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager) +{ + HILOG_INFO(HILOG_MODULE_ACE,"BaiduMapComponent"); + SetComponentName(K_BAIDUMAP); + uint16_t funcMapLength = sizeof(funcMap) / sizeof(funcMap[0]); + for (uint16_t index = 0; index < funcMapLength; index++) { + RegisterNamedFunction(funcMap[index].funcName, funcMap[index].handler); + } +} + +UIView *BaiduMapComponent::GetComponentRootView() const +{ + return const_cast(MapComponentApi::getInstance().get_baidumap_root_view()); +} + +JSValue BaiduMapComponent::SetZoomEventEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"SetZoomEventEnabled"); + bool enabled = BoolOf(args[0]); + MapComponentApi::getInstance().set_zoom_event_enabled(enabled); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ZoomIn(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ZoomIn"); + MapComponentApi::getInstance().zoom_in(); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ZoomOut(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ZoomOut"); + MapComponentApi::getInstance().zoom_out(); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ZoomTo(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ZoomTo"); + int amount = IntegerOf(args[0]); + MapComponentApi::getInstance().zoom_to(amount); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ZoomBy(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ZoomBy"); + int amount = IntegerOf(args[0]); + MapComponentApi::getInstance().zoom_by(amount); + return UNDEFINED; +} + +JSValue BaiduMapComponent::SetMapBackgroundColor(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"SetMapBackgroundColor"); + char *json_color = MallocStringOf(args[0]); + MapComponentApi::getInstance().set_map_background_color(json_color); + return UNDEFINED; +} + +JSValue BaiduMapComponent::SetMapOverlayerEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"SetMapOverlayerEnabled"); + bool enabled = BoolOf(args[0]); + MapComponentApi::getInstance().set_map_overlayer_enabled(enabled); + return UNDEFINED; +} + +JSValue BaiduMapComponent::SetMapTilesEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"SetMapTilesEnabled"); + bool enabled = BoolOf(args[0]); + MapComponentApi::getInstance().set_map_tiles_enabled(enabled); + return UNDEFINED; +} + +JSValue BaiduMapComponent::SetScrollGesturesEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"SetScrollGesturesEnabled"); + bool enabled = BoolOf(args[0]); + MapComponentApi::getInstance().set_scroll_gestures_enabled(enabled); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ScrollBy(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ScrollBy"); + int pixel_x = IntegerOf(args[0]); + int pixel_y = IntegerOf(args[1]); + MapComponentApi::getInstance().scroll_by(pixel_x,pixel_y); + return UNDEFINED; +} + +JSValue BaiduMapComponent::NewLatLng(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"NewLatLng"); + char *json_lat_lng = MallocStringOf(args[0]); + MapComponentApi::getInstance().new_lat_lng(json_lat_lng); + return UNDEFINED; +} + +JSValue BaiduMapComponent::NewLatLngZoom(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"NewLatLngZoom"); + char *json_lat_lng = MallocStringOf(args[0]); + int zoom = IntegerOf(args[1]); + MapComponentApi::getInstance().new_lat_lng_zoom(json_lat_lng,zoom); + return UNDEFINED; +} + +JSValue BaiduMapComponent::ClearMapOverlayer(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ClearMapOverlayer"); + MapComponentApi::getInstance().clear_map_overlayer(); + return UNDEFINED; +} + +JSValue BaiduMapComponent::DrawMarker(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"DrawMarker"); + char *json_marker = MallocStringOf(args[0]); + MapComponentApi::getInstance().draw_marker(json_marker); + return UNDEFINED; +} + +JSValue BaiduMapComponent::DrawPolygon(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"DrawPolygon"); + char *json_polygon = MallocStringOf(args[0]); + MapComponentApi::getInstance().draw_polygon(json_polygon); + return UNDEFINED; +} + +JSValue BaiduMapComponent::DrawPath(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"DrawPath"); + char *json_path = MallocStringOf(args[0]); + MapComponentApi::getInstance().draw_path(json_path); + return UNDEFINED; +} + +JSValue BaiduMapComponent::DrawText(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"DrawText"); + char *json_text = MallocStringOf(args[0]); + MapComponentApi::getInstance().draw_text(json_text); + return UNDEFINED; +} + +JSValue BaiduMapComponent::StartListenMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"StartListenMyGeoLocation"); + return UNDEFINED; +} + +JSValue BaiduMapComponent::StopListenMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"StopListenMyGeoLocation"); + return UNDEFINED; +} + +JSValue BaiduMapComponent::GetMyGeoStatus(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"GetMyGeoStatus"); + return UNDEFINED; +} + +JSValue BaiduMapComponent::GetMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"GetMyGeoLocation"); + return UNDEFINED; +} + +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_BAIDUMAP \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.h new file mode 100644 index 000000000..dbe9680f9 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/baidu_map_component.h @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef OHOS_ACELITE_BAIDU_MAP_COMPONENT_H +#define OHOS_ACELITE_BAIDU_MAP_COMPONENT_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_BAIDUMAP +#include +#include "jsi.h" +#include "component.h" +#include "baidumap_js_component.h" + + +namespace OHOS { +namespace ACELite { +struct FunctionMap { + ACE_DISALLOW_COPY_AND_MOVE(FunctionMap); + const char *funcName; + jerry_external_handler_t handler; +}; + +class BaiduMapComponent final: public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(BaiduMapComponent); + BaiduMapComponent() = delete; + BaiduMapComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~BaiduMapComponent() override{} + + /** + * SetZoomEventEnabled, enabled Indicates whether to allow scaling events. This function is disabled by default + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue SetZoomEventEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ZoomIn ,Map zoomed out one level. Valid only at levels 4 to 18 + */ + static JSValue ZoomIn(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ZoomOut ,Map zoomed in one level. Valid only at levels 4 to 18 + */ + static JSValue ZoomOut(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ZoomTo, Zoom the map to the specified level + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue ZoomTo(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ZoomBy, amount Incremental scaling of a map at a given level + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue ZoomBy(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * SetMapBackgroundColor, Set the placeholder background color before the map is displayed + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue SetMapBackgroundColor(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * SetMapOverlayerEnabled, Indicates whether to enable the overlay layer. This function is disabled by default + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue SetMapOverlayerEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * SetMapTilesEnabled, Indicates whether to enable the map tile layer. This function is enabled by default + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue SetMapTilesEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * SetScrollGesturesEnabled, Indicates whether to enable gesture sliding. This function is enabled by default + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue SetScrollGesturesEnabled(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ScrollBy, Incremental moving map for a given screen pixel. The screen origin is in the upper left corner + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue ScrollBy(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * NewLatLng, Displays the map to the center of the screen based on the longitude and latitude + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue NewLatLng(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * NewLatLngZoom, Displays the map of the specified longitude and latitude at the specified level to the center of the screen + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue NewLatLngZoom(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * ClearMapOverlayer, Clear all overlays on the map + */ + static JSValue ClearMapOverlayer(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * DrawMarker, Construction point + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue DrawMarker(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * DrawPolygon, Constructing Polygons + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue DrawPolygon(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * DrawPath, structural route + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue DrawPath(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * DrawText, Constructed text + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue DrawText(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * StartListenMyGeoLocation, Initiate location interception + */ + static JSValue StartListenMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * StopListenMyGeoLocation, Stop location interception + */ + static JSValue StopListenMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * GetMyGeoStatus, Obtaining the Location Status + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue GetMyGeoStatus(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + /** + * GetMyGeoLocation, Obtains the watch location information + * + * @param thisVal Indicates function execute context + * @param args Indicates the function arguments + * @param argsSize Indicates the size of function arguments + */ + static JSValue GetMyGeoLocation(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t args[], const jerry_length_t argsSize); + + static const char * const FUNC_SET_ZOOM_EVENT_ENABLED; + static const char * const FUNC_ZOOM_IN; + static const char * const FUNC_ZOOM_OUT; + static const char * const FUNC_ZOOM_TO; + static const char * const FUNC_ZOOM_BY; + static const char * const FUNC_SET_MAP_BACKGROUND_COLOR; + static const char * const FUNC_SET_MAP_OVERLAYER_ENABLED; + static const char * const FUNC_SET_MAP_TITLES_ENABLED; + static const char * const FUNC_SET_SCROLL_GESTURES_ENABLED; + static const char * const FUNC_SCROLL_BY; + static const char * const FUNC_NEW_LAT_LNG; + static const char * const FUNC_NEW_LAT_LNG_ZOOM; + static const char * const FUNC_CLEAR_MAP_OVERLAYER; + static const char * const FUNC_DRAW_MARKER; + static const char * const FUNC_DRAW_POLYGON; + static const char * const FUNC_DRAW_PATH; + static const char * const FUNC_DRAW_TEXT; + static const char * const FUNC_START_LISTEN_MY_GEO_LOCATION; + static const char * const FUNC_STOP_LISTEN_MY_GEO_LOCATION; + static const char * const FUNC_GET_MY_GEO_STATUS; + static const char * const FUNC_GET_MY_GEO_LOCATION; + static const FunctionMap funcMap[]; + +protected: + UIView *GetComponentRootView() const override; +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_BAIDUMAP +#endif // OHOS_ACELITE_BAIDU_MAP_COMPONENT_H \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h index c686ee874..7e5c68f58 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/components/component_factory.h @@ -57,6 +57,9 @@ #include "tab_content_component.h" #include "tabs_component.h" #endif // FEATURE_COMPONENT_TABS +#ifdef FEATURE_COMPONENT_BAIDUMAP +#include "baidu_map_component.h" +#endif // FEATURE_COMPONENT_BAIDUMAP #include "text_component.h" #include "video_component.h" @@ -180,6 +183,11 @@ public: component = new VideoComponent(options, children, styleManager); break; #endif // FEATURE_COMPONENT_VIDEO +#ifdef FEATURE_COMPONENT_BAIDUMAP + case K_BAIDUMAP: + component = new BaiduMapComponent(options, children, styleManager); + break; +#endif // FEATURE_COMPONENT_BAIDUMAP default: component = nullptr; break; diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h index d59927281..68b56ba9b 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/context/js_ability_impl.h @@ -112,11 +112,17 @@ public: return router_; } + jerry_value_t GetAppVM() const + { + return abilityModel_; + } + private: void InvokeOnCreate() const; void InvokeOnDestroy() const; void InvokeOnBackPressed() const; void InvokeMethodWithoutParameter(const char * const name) const; + void MarkAppViewModelEvaling(bool evaling) const; JsAppContext* appContext_; jerry_value_t abilityModel_; // the object evaled from user JS code diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp new file mode 100644 index 000000000..d6959b614 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.cpp @@ -0,0 +1,1128 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. + * 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 "ace_log.h" +#include "baidumap.h" +#include "baidumap_js_location.h" +#include "baidumap_js_component.h" +#include "baidu_app.h" +#include "msg_center_protocol.h" +#include "js_async_work.h" +#include "adapter.h" + +#include "gfx_utils/heap_base.h" + +typedef struct : public OHOS::HeapBase { + char *msgBody; + uint8_t type; + bool flag; +} BaiduMapAsyncMsgParams; + +typedef struct : public OHOS::HeapBase { + double lon; + double lat; +} BaiduMapJSCoordinate; + +constexpr char LON[] = "lon"; +constexpr char LAT[] = "lat"; + +namespace OHOS { +namespace ACELite { + +static int32_t DmsLiteCpoyStr(char **destStr, const char *srcStr); + +static void ExecuteSendMsgToJS(void *data); + +static bool CheckIsJsValueFunction(OHOS::ACELite::JSIValue jsValue); + +//poi_nearby_search +OHOS::ACELite::JSIValue poi_successCallback = nullptr; +OHOS::ACELite::JSIValue poi_failCallback = nullptr; +OHOS::ACELite::JSIValue poi_callbackContext = nullptr; +//route_riding_search +OHOS::ACELite::JSIValue route_riding_successCallback = nullptr; +OHOS::ACELite::JSIValue route_riding_failCallback = nullptr; +OHOS::ACELite::JSIValue route_riding_callbackContext = nullptr; +//route_walking_search +OHOS::ACELite::JSIValue route_walking_successCallback = nullptr; +OHOS::ACELite::JSIValue route_walking_failCallback = nullptr; +OHOS::ACELite::JSIValue route_walking_callbackContext = nullptr; +//route_transit_search +OHOS::ACELite::JSIValue route_transit_successCallback = nullptr; +OHOS::ACELite::JSIValue route_transit_failCallback = nullptr; +OHOS::ACELite::JSIValue route_transit_callbackContext = nullptr; +//auth_license +OHOS::ACELite::JSIValue auth_successCallback = nullptr; +OHOS::ACELite::JSIValue auth_failCallback = nullptr; +OHOS::ACELite::JSIValue auth_callbackContext = nullptr; +//naviInit +OHOS::ACELite::JSIValue nav_successCallback = nullptr; +OHOS::ACELite::JSIValue nav_failCallback = nullptr; +OHOS::ACELite::JSIValue nav_callbackContext = nullptr; +//getGeolocation +OHOS::ACELite::JSIValue geo_location_Callback = nullptr; +OHOS::ACELite::JSIValue geo_location_callbackContext = nullptr; +//onRoutePlanStart +OHOS::ACELite::JSIValue route_plan_start_Callback = nullptr; +OHOS::ACELite::JSIValue route_plan_start_callbackContext = nullptr; +//onRoutePlanSuccess +OHOS::ACELite::JSIValue route_plan_success_Callback = nullptr; +OHOS::ACELite::JSIValue route_plan_success_callbackContext = nullptr; +//onRoutePlanFail +OHOS::ACELite::JSIValue route_plan_fail_Callback = nullptr; +OHOS::ACELite::JSIValue route_plan_fail_callbackContext = nullptr; +//onNaviStart +OHOS::ACELite::JSIValue navi_start_Callback = nullptr; +OHOS::ACELite::JSIValue navi_start_callbackContext = nullptr; +//onNaviDestroy +OHOS::ACELite::JSIValue navi_destroy_Callback = nullptr; +OHOS::ACELite::JSIValue navi_destroy_callbackContext = nullptr; +//onRoadGuideTextUpdate +OHOS::ACELite::JSIValue road_guide_text_update_Callback = nullptr; +OHOS::ACELite::JSIValue road_guide_text_update_callbackContext = nullptr; +//onRouteGuideIconUpdate +OHOS::ACELite::JSIValue road_guide_icon_update_Callback = nullptr; +OHOS::ACELite::JSIValue road_guide_icon_update_callbackContext = nullptr; +//onRemainTimeUpdate +OHOS::ACELite::JSIValue remain_time_Callback = nullptr; +OHOS::ACELite::JSIValue remain_time_callbackContext = nullptr; +//onRemainDistanceUpdate +OHOS::ACELite::JSIValue remain_distance_Callback = nullptr; +OHOS::ACELite::JSIValue remain_distance_callbackContext = nullptr; +//onRemainRouteUpdate +OHOS::ACELite::JSIValue remain_route_Callback = nullptr; +OHOS::ACELite::JSIValue remain_route_callbackContext = nullptr; +//onGpsStatusChange +OHOS::ACELite::JSIValue gps_status_Callback = nullptr; +OHOS::ACELite::JSIValue gps_status_callbackContext = nullptr; +//onRouteFarAway +OHOS::ACELite::JSIValue route_far_Callback = nullptr; +OHOS::ACELite::JSIValue route_far_callbackContext = nullptr; +//onRoutePlanYawing +OHOS::ACELite::JSIValue route_plan_yawing_Callback = nullptr; +OHOS::ACELite::JSIValue route_plan_yawing_callbackContext = nullptr; +//onReRouteComplete +OHOS::ACELite::JSIValue reroute_Callback = nullptr; +OHOS::ACELite::JSIValue reroute_callbackContext = nullptr; +//onArriveDest +OHOS::ACELite::JSIValue arrivedest_Callback = nullptr; +OHOS::ACELite::JSIValue arrivedest_callbackContext = nullptr; +//poi_sug_search +OHOS::ACELite::JSIValue poi_sug_successCallback = nullptr; +OHOS::ACELite::JSIValue poi_sug_failCallback = nullptr; +OHOS::ACELite::JSIValue poi_sug_callbackContext = nullptr; +//geocode_search +OHOS::ACELite::JSIValue geocode_search_successCallback = nullptr; +OHOS::ACELite::JSIValue geocode_search_failCallback = nullptr; +OHOS::ACELite::JSIValue geocode_search_callbackContext = nullptr; +//regeocode_search +OHOS::ACELite::JSIValue regeocode_search_successCallback = nullptr; +OHOS::ACELite::JSIValue regeocode_search_failCallback = nullptr; +OHOS::ACELite::JSIValue regeocode_search_callbackContext = nullptr; + +static bool CheckIsJsValueDefined(OHOS::ACELite::JSIValue jsValue) +{ + if (jsValue == nullptr) { + return false; + } + + if (OHOS::ACELite::JSI::ValueIsUndefined(jsValue)) { + return false; + } + + return true; +} + + +static int32_t DmsLiteCpoyStr(char **destStr, const char *srcStr) +{ + if (destStr == nullptr || srcStr == nullptr) { + return -1; + } + + uint32_t length = strlen(srcStr) + 1; + *destStr = static_cast(AdapterMalloc(length)); + if (*destStr == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to allocate memory for destination string"); + return -1; + } + + if (memset_s(*destStr, length, 0, length) != EOK) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to set memory for destination string"); + AdapterFree(*destStr); + return -1; + } + if (memcpy_s(*destStr, length, srcStr, length) != EOK) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to copy source string to destination string"); + AdapterFree(*destStr); + return -1; + } + + return 0; +} + + + +static void ExecuteSendMsgToJS(void *data) +{ + BaiduMapAsyncMsgParams *params = static_cast(data); + if (params == nullptr) { + return; + } + + OHOS::ACELite::JSIValue success = nullptr; + OHOS::ACELite::JSIValue fail = nullptr; + OHOS::ACELite::JSIValue context = nullptr; + uint8_t type = params->type; + bool flag = params->flag; + switch (type) { + case MSGCENTER_TYPE_ID_VECTOR_NAVI_RECV_POI: + success = poi_successCallback; + fail = poi_failCallback; + context = poi_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_RIDING_SEARCH: + success = route_riding_successCallback; + fail = route_riding_failCallback; + context = route_riding_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_WALKING_SEARCH: + success = route_walking_successCallback; + fail = route_walking_failCallback; + context = route_walking_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_TRANSIT_SEARCH: + success = route_transit_successCallback; + fail = route_transit_failCallback; + context = route_transit_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_POI_SUG_SEARCH: + success = poi_sug_successCallback; + fail = poi_sug_failCallback; + context = poi_sug_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_AUTH_LICENSE: + success = auth_successCallback; + fail = auth_failCallback; + context = auth_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_INIT: + success = nav_successCallback; + fail = nav_failCallback; + context = nav_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEO_LOCATION: + success = geo_location_Callback; + context = geo_location_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_START: + success = route_plan_start_Callback; + context = route_plan_start_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_SUCC: + success = route_plan_success_Callback; + context = route_plan_success_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_FAIL: + success = route_plan_fail_Callback; + context = route_plan_fail_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_START: + success = navi_start_Callback; + context = navi_start_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_NAVI_DESTROY: + success = navi_destroy_Callback; + context = navi_destroy_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_TEXT_UPDATE: + success = road_guide_text_update_Callback; + context = road_guide_text_update_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROAD_GUIDE_ICON_UPDATE: + success = road_guide_icon_update_Callback; + context = road_guide_icon_update_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_TIME_UPDATE: + success = remain_time_Callback; + context = remain_time_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_DISTANCE_UPDATE: + success = remain_distance_Callback; + context = remain_distance_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REMAIN_ROUTE_UPDATE: + success = remain_route_Callback; + context = remain_route_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GPS_STATUS_CHANGE: + success = gps_status_Callback; + context = gps_status_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_FARAWAY: + success = route_far_Callback; + context = route_far_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ROUTE_PLAN_YAWING: + success = route_plan_yawing_Callback; + context = route_plan_yawing_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_RE_ROUTE_COMPLETE: + success = reroute_Callback; + context = reroute_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_ARRIVE_DSTINATION: + success = arrivedest_Callback; + context = arrivedest_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_GEOCODE_SEARCH: + success = geocode_search_successCallback; + fail = geocode_search_failCallback; + context = geocode_search_callbackContext; + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REC_REGEOCODE_SEARCH: + success = regeocode_search_successCallback; + fail = regeocode_search_failCallback; + context = regeocode_search_callbackContext; + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "Invalid command type"); + break; + + } + + char *msgBody = params->msgBody; + delete params; + params = nullptr; + + OHOS::ACELite::JSIValue dataInfo = OHOS::ACELite::JSI::CreateObject(); + OHOS::ACELite::JSI::SetBooleanProperty(dataInfo, "isFileType", false); + OHOS::ACELite::JSI::SetBooleanProperty(dataInfo, "isRegister", false); + OHOS::ACELite::JSI::SetStringProperty(dataInfo, "message", msgBody); + if (flag) { + if ((!CheckIsJsValueFunction(success)) || (!CheckIsJsValueDefined(context))) { + HILOG_ERROR(HILOG_MODULE_ACE, "Error in ExecuteSendMsgToJS. Invalid params detected!"); + return; + } + OHOS::ACELite::JSIValue successArgv[OHOS::ACELite::ARGC_ONE] = { dataInfo }; + OHOS::ACELite::JSI::CallFunction(success, context, successArgv, OHOS::ACELite::ARGC_ONE); + OHOS::ACELite::JSI::ReleaseValue(dataInfo); + } else { + if ((!CheckIsJsValueDefined(context)) || (!CheckIsJsValueFunction(fail))) { + HILOG_ERROR(HILOG_MODULE_ACE, "Error in ExecuteSendMsgToJS. Invalid params detected!"); + return; + } + OHOS::ACELite::JSIValue failArgv[OHOS::ACELite::ARGC_ONE] = { dataInfo }; + OHOS::ACELite::JSI::CallFunction(fail, context, failArgv, OHOS::ACELite::ARGC_ONE); + OHOS::ACELite::JSI::ReleaseValue(dataInfo); + } + if (msgBody != nullptr) { + AdapterFree(msgBody); + msgBody = nullptr; + } + + return; +} + +static bool CheckIsJsValueFunction(OHOS::ACELite::JSIValue jsValue) +{ + if (!CheckIsJsValueDefined(jsValue)) { + return false; + } + + return OHOS::ACELite::JSI::ValueIsFunction(jsValue); +} + +static void ReleaseJsValue(OHOS::ACELite::JSIValue &jsValue) +{ + if (CheckIsJsValueDefined(jsValue)) { + OHOS::ACELite::JSI::ReleaseValue(jsValue); + jsValue = OHOS::ACELite::JSI::CreateUndefined(); + } + return; +} + +static void ReleaseMsgJsValue(uint8_t type) +{ + HILOG_INFO(HILOG_MODULE_ACE,"ReleasePoiMsgJsValue"); + switch (type) { + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI: + ReleaseJsValue(poi_callbackContext); + ReleaseJsValue(poi_successCallback); + ReleaseJsValue(poi_failCallback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE: + ReleaseJsValue(auth_callbackContext); + ReleaseJsValue(auth_successCallback); + ReleaseJsValue(auth_failCallback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT: + ReleaseJsValue(nav_callbackContext); + ReleaseJsValue(nav_successCallback); + ReleaseJsValue(nav_failCallback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START: + ReleaseJsValue(route_plan_start_callbackContext); + ReleaseJsValue(route_plan_start_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH: + ReleaseJsValue(poi_sug_callbackContext); + ReleaseJsValue(poi_sug_successCallback); + ReleaseJsValue(poi_sug_failCallback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC: + ReleaseJsValue(route_plan_success_callbackContext); + ReleaseJsValue(route_plan_success_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION: + ReleaseJsValue(geo_location_callbackContext); + ReleaseJsValue(geo_location_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL: + ReleaseJsValue(route_plan_fail_callbackContext); + ReleaseJsValue(route_plan_fail_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START: + ReleaseJsValue(navi_start_callbackContext); + ReleaseJsValue(navi_start_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY: + ReleaseJsValue(navi_destroy_callbackContext); + ReleaseJsValue(navi_destroy_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE: + ReleaseJsValue(road_guide_text_update_callbackContext); + ReleaseJsValue(road_guide_text_update_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE: + ReleaseJsValue(road_guide_icon_update_callbackContext); + ReleaseJsValue(road_guide_icon_update_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE: + ReleaseJsValue(remain_time_callbackContext); + ReleaseJsValue(remain_time_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE: + ReleaseJsValue(remain_distance_callbackContext); + ReleaseJsValue(remain_distance_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE: + ReleaseJsValue(remain_route_callbackContext); + ReleaseJsValue(remain_route_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE: + ReleaseJsValue(gps_status_callbackContext); + ReleaseJsValue(gps_status_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY: + ReleaseJsValue(route_far_callbackContext); + ReleaseJsValue(route_far_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING: + ReleaseJsValue(route_plan_yawing_callbackContext); + ReleaseJsValue(route_plan_yawing_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE: + ReleaseJsValue(reroute_callbackContext); + ReleaseJsValue(reroute_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION: + ReleaseJsValue(arrivedest_callbackContext); + ReleaseJsValue(arrivedest_Callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH: + ReleaseJsValue(geocode_search_successCallback); + ReleaseJsValue(geocode_search_failCallback); + ReleaseJsValue(geocode_search_callbackContext); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH: + ReleaseJsValue(regeocode_search_successCallback); + ReleaseJsValue(regeocode_search_failCallback); + ReleaseJsValue(regeocode_search_callbackContext); + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "ReleaseMsgJsValue Invalid command type"); + break; + } + return; +} + +bool setCallbackFunction(OHOS::ACELite::JSIValue callback,uint8_t type,bool isSuccess) +{ + if (!OHOS::ACELite::JSI::ValueIsUndefined(callback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(callback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Success callback value is not a function"); + } else { + switch (type) { + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI: + if (isSuccess) { + poi_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + poi_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE: + if (isSuccess) { + auth_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + auth_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT: + if (isSuccess) { + nav_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + nav_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH: + if (isSuccess) { + poi_sug_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + poi_sug_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION: + geo_location_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START: + route_plan_start_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC: + route_plan_success_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL: + route_plan_fail_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START: + navi_start_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY: + navi_destroy_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE: + road_guide_text_update_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE: + road_guide_icon_update_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE: + remain_time_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE: + remain_distance_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE: + remain_route_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE: + gps_status_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY: + route_far_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING: + route_plan_yawing_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE: + reroute_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION: + arrivedest_Callback = OHOS::ACELite::JSI::AcquireValue(callback); + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH: + if (isSuccess) { + geocode_search_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + geocode_search_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + case MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH: + if (isSuccess) { + regeocode_search_successCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } else { + regeocode_search_failCallback = OHOS::ACELite::JSI::AcquireValue(callback); + } + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "setCallbackFunction Invalid command type"); + return false; + } + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "Success callback value is undefined"); + return false; + } + + return true; +} + +/** + * MsgCenter interface + */ + +JSIValue BaiduMapComponentModule::poi_nearby_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"poi_nearby_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"poi_nearby_search : %s \n",data); + //success Callback & failed Callback + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI); + poi_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,false); + msg_center_vector_navi_req_poi(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::route_riding_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"route_riding_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"route_riding_search : %s \n",data); + //success Callback & failed Callback + ReleaseJsValue(route_riding_successCallback); + ReleaseJsValue(route_riding_failCallback); + ReleaseJsValue(route_riding_callbackContext); + route_riding_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + + if (!OHOS::ACELite::JSI::ValueIsUndefined(successCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(successCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_riding_search Success callback value is not a function"); + } else { + route_riding_successCallback = OHOS::ACELite::JSI::AcquireValue(successCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_riding_search Success callback value is undefined"); + } + + if (!OHOS::ACELite::JSI::ValueIsUndefined(failCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(failCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_riding_search Fail callback value is not a function"); + } else { + route_riding_failCallback = OHOS::ACELite::JSI::AcquireValue(failCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_riding_search Fail callback value is undefined"); + } + + msg_center_vector_navi_req_dst_by_text(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_DST_BY_TEST,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::route_walking_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"route_walking_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"route_walking_search : %s \n",data); + //success Callback & failed Callback + ReleaseJsValue(route_walking_successCallback); + ReleaseJsValue(route_walking_failCallback); + ReleaseJsValue(route_walking_callbackContext); + route_walking_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + + if (!OHOS::ACELite::JSI::ValueIsUndefined(successCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(successCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_walking_search Success callback value is not a function"); + } else { + route_walking_successCallback = OHOS::ACELite::JSI::AcquireValue(successCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_walking_search Success callback value is undefined"); + } + + if (!OHOS::ACELite::JSI::ValueIsUndefined(failCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(failCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_walking_search Fail callback value is not a function"); + } else { + route_walking_failCallback = OHOS::ACELite::JSI::AcquireValue(failCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_walking_search Fail callback value is undefined"); + } + msg_center_vector_navi_req_dst_by_text(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_DST_BY_TEST,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::route_transit_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"route_transit_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"route_transit_search : %s \n",data); + //success Callback & failed Callback + ReleaseJsValue(route_transit_successCallback); + ReleaseJsValue(route_transit_failCallback); + ReleaseJsValue(route_transit_callbackContext); + route_transit_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + + if (!OHOS::ACELite::JSI::ValueIsUndefined(successCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(successCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_transit_search Success callback value is not a function"); + } else { + route_transit_successCallback = OHOS::ACELite::JSI::AcquireValue(successCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_transit_search Success callback value is undefined"); + } + + if (!OHOS::ACELite::JSI::ValueIsUndefined(failCallback)) { + if (!OHOS::ACELite::JSI::ValueIsFunction(failCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "route_transit_search Fail callback value is not a function"); + } else { + route_transit_failCallback = OHOS::ACELite::JSI::AcquireValue(failCallback); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "route_transit_search Fail callback value is undefined"); + } + msg_center_vector_navi_req_dst_by_text(MSGCENTER_CMD_VECTOR_NAVI,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_DST_BY_TEST,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::auth_license(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"auth_license"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"auth_license : %s \n",data); + //success Callback & failed Callback + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE); + auth_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,false); + msg_center_vector_navi_req_auth_license(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_AUTH_LICENSE,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::getGeolocation(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"getGeolocation"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"getGeolocation : %s \n",data); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION); + geo_location_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,true); + msg_center_vector_navi_req_geo_location(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEO_LOCATION,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::naviInit(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"naviInit"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"naviInit : %s \n",data); + //success Callback & failed Callback + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT); + nav_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,false); + msg_center_vector_navi_req_navi_init(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_INIT,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRoutePlanStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRoutePlanStart"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START); + route_plan_start_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_START,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRoutePlanSuccess(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRoutePlanSuccess"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC); + route_plan_success_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_SUCC,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRoutePlanFail(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRoutePlanFail"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL); + route_plan_fail_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_FAIL,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onNaviStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onNaviStart"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START); + navi_start_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_START,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onNaviDestroy(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onNaviDestroy"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY); + navi_destroy_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_NAVI_DESTROY,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRoadGuideTextUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRoadGuideTextUpdate"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE); + road_guide_text_update_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_TEXT_UPDATE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRouteGuideIconUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRouteGuideIconUpdate"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE); + road_guide_icon_update_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROAD_GUIDE_ICON_UPDATE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRemainTimeUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRemainTimeUpdate"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE); + remain_time_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_TIME_UPDATE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRemainDistanceUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRemainDistanceUpdate"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE); + remain_distance_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_DISTANCE_UPDATE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRemainRouteUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRemainRouteUpdate"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE); + remain_route_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REMAIN_ROUTE_UPDATE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onGpsStatusChange(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onGpsStatusChange"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE); + gps_status_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GPS_STATUS_CHANGE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRouteFarAway(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRouteFarAway"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY); + route_far_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_FARAWAY,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onRoutePlanYawing(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onRoutePlanYawing"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING); + route_plan_yawing_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING,true); + //msg_center_vector_navi_req_route_plan_yawing(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ROUTE_PLAN_YAWING,Callback,1); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onReRouteComplete(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onReRouteComplete"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE); + reroute_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_RE_ROUTE_COMPLETE,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::onArriveDest(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"onArriveDest"); + OHOS::ACELite::JSIValue Callback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_CALLBACK); + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION); + arrivedest_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + setCallbackFunction(Callback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_ARRIVE_DSTINATION,true); + return JSI::CreateBoolean(0); +} + +JSIValue BaiduMapComponentModule::poi_sug_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"poi_sug_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"poi_sug_search : %s \n",data); + + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH); + poi_sug_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,false); + msg_center_vertor_navi_req_poi_sug_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_POI_SUG_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +/** + * location interface + */ +JSIValue BaiduMapComponentModule::Location_WGS84ToGCJ02(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToGCJ02"); + double lon = OHOS::ACELite::JSI::GetNumberProperty(args[0], LON); + double lat = OHOS::ACELite::JSI::GetNumberProperty(args[0], LAT); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToGCJ02 befor lon: %lf \s",lon); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToGCJ02 befor lat: %lf \s",lat); + JSCoordinate params = {0}; + WGS84ToGCJ02(lon, lat, params); + + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToGCJ02 after lon: %lf \s",params.lon); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToGCJ02 after lat: %lf \s",params.lat); + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "lon", params.lon); + JSI::SetNumberProperty(result, "lat", params.lat); + return result; +} + +JSIValue BaiduMapComponentModule::Location_GCJ02ToBD09(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"GCJ02ToBD09"); + double lon = OHOS::ACELite::JSI::GetNumberProperty(args[0], LON); + double lat = OHOS::ACELite::JSI::GetNumberProperty(args[0], LAT); + HILOG_INFO(HILOG_MODULE_ACE,"GCJ02ToBD09 befor lon: %lf \s",lon); + HILOG_INFO(HILOG_MODULE_ACE,"GCJ02ToBD09 befor lat: %lf \s",lat); + JSCoordinate params = {0}; + GCJ02ToBD09(lon, lat, params); + + HILOG_INFO(HILOG_MODULE_ACE,"GCJ02ToBD09 after lon: %lf \s",params.lon); + HILOG_INFO(HILOG_MODULE_ACE,"GCJ02ToBD09 after lat: %lf \s",params.lat); + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "lon", params.lon); + JSI::SetNumberProperty(result, "lat", params.lat); + return result; +} + +JSIValue BaiduMapComponentModule::Location_WGS84ToBD09(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToBD09"); + double lon = OHOS::ACELite::JSI::GetNumberProperty(args[0], LON); + double lat = OHOS::ACELite::JSI::GetNumberProperty(args[0], LAT); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToBD09 befor lon: %lf \s",lon); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToBD09 befor lat: %lf \s",lat); + JSCoordinate params = {0}; + WGS84ToBD09(lon, lat, params); + + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToBD09 after lon: %lf \s",params.lon); + HILOG_INFO(HILOG_MODULE_ACE,"WGS84ToBD09 after lat: %lf \s",params.lat); + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "lon", params.lon); + JSI::SetNumberProperty(result, "lat", params.lat); + return result; +} + +JSIValue BaiduMapComponentModule::Location_BD09ToGCJ02(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"BD09ToGCJ02"); + double lon = OHOS::ACELite::JSI::GetNumberProperty(args[0], LON); + double lat = OHOS::ACELite::JSI::GetNumberProperty(args[0], LAT); + HILOG_INFO(HILOG_MODULE_ACE,"BD09ToGCJ02 befor lon: %lf \s",lon); + HILOG_INFO(HILOG_MODULE_ACE,"BD09ToGCJ02 befor lat: %lf \s",lat); + JSCoordinate params = {0}; + BD09ToGCJ02(lon, lat, params); + + HILOG_INFO(HILOG_MODULE_ACE,"BD09ToGCJ02 after lon: %lf \s",params.lon); + HILOG_INFO(HILOG_MODULE_ACE,"BD09ToGCJ02 after lat: %lf \s",params.lat); + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "lon", params.lon); + JSI::SetNumberProperty(result, "lat", params.lat); + return result; +} + +/** + * geocode interface + */ +JSIValue BaiduMapComponentModule::Geocode_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"Geocode_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"Geocode_search : %s \n",data); + //success Callback & failed Callback + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH); + geocode_search_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,false); + msg_center_vector_navi_req_geocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_GEOCODE_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); + +} + +JSIValue BaiduMapComponentModule::Regeocode_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + HILOG_INFO(HILOG_MODULE_ACE,"Regeocode_search"); + char *data = JSI::JsonStringify(args[0]); + HILOG_INFO(HILOG_MODULE_ACE,"Regeocode_search : %s \n",data); + //success Callback & failed Callback + ReleaseMsgJsValue(MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH); + regeocode_search_callbackContext = OHOS::ACELite::JSI::AcquireValue(thisVal); + OHOS::ACELite::JSIValue successCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_SUCCESS); + OHOS::ACELite::JSIValue failCallback = OHOS::ACELite::JSI::GetNamedProperty(args[0], CB_FAIL); + setCallbackFunction(successCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,true); + setCallbackFunction(failCallback,MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,false); + msg_center_vector_navi_req_regeocode_search(MSGCENTER_CMD_VECTOR_NAVI, MSGCENTER_TYPE_ID_VECTOR_NAVI_REQ_REGEOCODE_SEARCH,data,strlen(data)); + return JSI::CreateBoolean(0); +} + +void InitBaiduMapComponentModule(JSIValue exports) +{ + HILOG_INFO(HILOG_MODULE_ACE,"InitBaiduMapComponentModule"); + /** + * MsgCenter interface + */ + JSI::SetModuleAPI(exports, "poi_nearby_search", BaiduMapComponentModule::poi_nearby_search); + JSI::SetModuleAPI(exports, "route_riding_search", BaiduMapComponentModule::route_riding_search); + JSI::SetModuleAPI(exports, "route_walking_search", BaiduMapComponentModule::route_walking_search); + JSI::SetModuleAPI(exports, "route_transit_search", BaiduMapComponentModule::route_transit_search); + JSI::SetModuleAPI(exports, "auth_license", BaiduMapComponentModule::auth_license); + JSI::SetModuleAPI(exports, "getGeolocation", BaiduMapComponentModule::getGeolocation); + JSI::SetModuleAPI(exports, "naviInit", BaiduMapComponentModule::naviInit); + JSI::SetModuleAPI(exports, "onRoutePlanStart", BaiduMapComponentModule::onRoutePlanStart); + JSI::SetModuleAPI(exports, "onRoutePlanSuccess", BaiduMapComponentModule::onRoutePlanSuccess); + JSI::SetModuleAPI(exports, "onRoutePlanFail", BaiduMapComponentModule::onRoutePlanFail); + JSI::SetModuleAPI(exports, "onNaviStart", BaiduMapComponentModule::onNaviStart); + JSI::SetModuleAPI(exports, "onNaviDestroy", BaiduMapComponentModule::onNaviDestroy); + JSI::SetModuleAPI(exports, "onRoadGuideTextUpdate", BaiduMapComponentModule::onRoadGuideTextUpdate); + JSI::SetModuleAPI(exports, "onRouteGuideIconUpdate", BaiduMapComponentModule::onRouteGuideIconUpdate); + JSI::SetModuleAPI(exports, "onRemainTimeUpdate", BaiduMapComponentModule::onRemainTimeUpdate); + JSI::SetModuleAPI(exports, "onRemainDistanceUpdate", BaiduMapComponentModule::onRemainDistanceUpdate); + JSI::SetModuleAPI(exports, "onRemainRouteUpdate", BaiduMapComponentModule::onRemainRouteUpdate); + JSI::SetModuleAPI(exports, "onGpsStatusChange", BaiduMapComponentModule::onGpsStatusChange); + JSI::SetModuleAPI(exports, "onRouteFarAway", BaiduMapComponentModule::onRouteFarAway); + JSI::SetModuleAPI(exports, "onRoutePlanYawing", BaiduMapComponentModule::onRoutePlanYawing); + JSI::SetModuleAPI(exports, "onReRouteComplete", BaiduMapComponentModule::onReRouteComplete); + JSI::SetModuleAPI(exports, "onArriveDest", BaiduMapComponentModule::onArriveDest); + JSI::SetModuleAPI(exports, "poi_sug_search", BaiduMapComponentModule::poi_sug_search); + + /** + * location interface + */ + JSI::SetModuleAPI(exports, "WGS84ToGCJ02", BaiduMapComponentModule::Location_WGS84ToGCJ02); + JSI::SetModuleAPI(exports, "GCJ02ToBD09", BaiduMapComponentModule::Location_GCJ02ToBD09); + JSI::SetModuleAPI(exports, "WGS84ToBD09", BaiduMapComponentModule::Location_WGS84ToBD09); + JSI::SetModuleAPI(exports, "BD09ToGCJ02", BaiduMapComponentModule::Location_BD09ToGCJ02); + + /** + * geocode interface + */ + JSI::SetModuleAPI(exports, "geocode_search", BaiduMapComponentModule::Geocode_search); + JSI::SetModuleAPI(exports, "regeocode_search", BaiduMapComponentModule::Regeocode_search); + +} + +} // namespace ACELite +} // namespace OHOS + +void BaidumapSendMsgToJS(const char *msgBody,uint8_t type) +{ + BaiduMapAsyncMsgParams *params = new BaiduMapAsyncMsgParams(); + if (params == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE,"Failed to allocate memory for params"); + return; + } + params->type = type; + params->flag = true; + int32_t copyRet = OHOS::ACELite::DmsLiteCpoyStr(¶ms->msgBody, msgBody); + + if (copyRet != 0) { + HILOG_ERROR(HILOG_MODULE_ACE,"Failed to copy msgBody"); + delete params; + params = nullptr; + return; + } + + bool ret = OHOS::ACELite::JsAsyncWork::DispatchAsyncWork(OHOS::ACELite::ExecuteSendMsgToJS,static_cast(params)); + if (!ret) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to dispatch async work"); + delete params; + params = nullptr; + } + + return; +} + +void BaidumapFailSendMsgToJS(const char *msgBody,uint8_t type) +{ + BaiduMapAsyncMsgParams *params = new BaiduMapAsyncMsgParams(); + if (params == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE,"Failed to allocate memory for params"); + return; + } + params->type = type; + params->flag = false; + int32_t copyRet = OHOS::ACELite::DmsLiteCpoyStr(¶ms->msgBody, msgBody); + + if (copyRet != 0) { + HILOG_ERROR(HILOG_MODULE_ACE,"Failed to copy msgBody"); + delete params; + params = nullptr; + return; + } + + bool ret = OHOS::ACELite::JsAsyncWork::DispatchAsyncWork(OHOS::ACELite::ExecuteSendMsgToJS, static_cast(params)); + if (!ret) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to dispatch async work"); + delete params; + params = nullptr; + } + + return; +} + diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h new file mode 100644 index 000000000..831691806 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/baidumapcomponent/baidumap.h @@ -0,0 +1,102 @@ +/* +* Copyright (c) CompanyNameMagicTag. 2021-2021. All rights reserved. +* Description: audio capture wrapper +* Author: Media Software Group +* Create: 2021-09-13 +*/ + +#ifndef BAIDUMAPCOMPONENT_MODULE_H +#define BAIDUMAPCOMPONENT_MODULE_H + +#include +#include "jsi.h" + +namespace OHOS { +namespace ACELite { +class BaiduMapComponentModule final : public MemoryHeap { +public: + /** + * constructor + */ + BaiduMapComponentModule() = default; + + /** + * desconstructor + */ + ~BaiduMapComponentModule() = default; + + /** + * MsgCenter interface + */ + static JSIValue poi_nearby_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue route_riding_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue route_walking_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue route_transit_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue auth_license(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue getGeolocation(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue naviInit(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRoutePlanStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRoutePlanSuccess(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRoutePlanFail(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onNaviStart(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onNaviDestroy(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRoadGuideTextUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRouteGuideIconUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRemainTimeUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRemainDistanceUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRemainRouteUpdate(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onGpsStatusChange(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRouteFarAway(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onRoutePlanYawing(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onReRouteComplete(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue onArriveDest(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue poi_sug_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + /** + * location interface + */ + static JSIValue Location_WGS84ToGCJ02(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue Location_GCJ02ToBD09(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue Location_WGS84ToBD09(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue Location_BD09ToGCJ02(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + /** + * geocode interface + */ + static JSIValue Geocode_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + + static JSIValue Regeocode_search(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); +}; + +void InitBaiduMapComponentModule(JSIValue exports); +} +} +void BaidumapSendMsgToJS(const char *msgBody,uint8_t type); +void BaidumapFailSendMsgToJS(const char *msgBody,uint8_t type); +#endif + diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.cpp new file mode 100644 index 000000000..bf97b75ed --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. + * 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 "display.h" +#include "ace_log.h" +#include "errcode.h" +#if defined(SUPPORT_POWER_MANAGER) +#include "power_display_service.h" +#endif + +constexpr char KEEPSCREENON[] = "keepScreenOn"; +uint32_t g_keepOnTimeout = 5000; // 5000ms +const char * ERR_GENERAL = "display error"; +const char * ERR_NOT_SUPPORT = "display set is not support"; +const int DISPLAY_SUCCESS = 0; +const int DISPLAY_FAIL = -1; +const int DISPLAY_NOT_SUPPORT = -2; + +namespace OHOS { +namespace ACELite { +static void FailCallBack(const JSIValue thisVal, const JSIValue args, int ret) +{ + JSIValue errCode = JSI::CreateNumber(ret); + JSIValue errInfo; + if (ret == DISPLAY_FAIL) { + errInfo = JSI::CreateString(ERR_GENERAL); + } else { + errInfo = JSI::CreateString(ERR_NOT_SUPPORT); + } + JSIValue fail = JSI::GetNamedProperty(args, CB_FAIL); + JSIValue complete = JSI::GetNamedProperty(args, CB_COMPLETE); + JSIValue argv[ARGC_TWO] = {errInfo, errCode}; + if (!JSI::ValueIsUndefined(fail)) { + JSI::CallFunction(fail, thisVal, argv, ARGC_TWO); + } + if (!JSI::ValueIsUndefined(complete)) { + JSI::CallFunction(complete, thisVal, nullptr, 0); + } + JSI::ReleaseValueList(fail, complete, errInfo, errCode, ARGS_END); +} + +static void SuccessCallBack(const JSIValue thisVal, const JSIValue args, JSIValue jsiValue) +{ + if (JSI::ValueIsUndefined(args)) { + return; + } + JSIValue success = JSI::GetNamedProperty(args, CB_SUCCESS); + JSIValue complete = JSI::GetNamedProperty(args, CB_COMPLETE); + if (!JSI::ValueIsUndefined(success)) { + if (JSI::ValueIsUndefined(jsiValue)) { + JSI::CallFunction(success, thisVal, nullptr, 0); + } else { + JSI::CallFunction(success, thisVal, &jsiValue, ARGC_ONE); + } + } + if (!JSI::ValueIsUndefined(complete)) { + JSI::CallFunction(complete, thisVal, nullptr, 0); + } + JSI::ReleaseValueList(success, complete, ARGS_END); +} + +JSIValue DisplayModule::SetKeepScreenOn(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize) +{ + int ret = DISPLAY_NOT_SUPPORT; +#if defined(SUPPORT_POWER_MANAGER) + errcode_t result; + bool keepScreenOn = JSI::GetBooleanProperty(args[0], KEEPSCREENON); + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (keepScreenOn) { + screen_context_t * curScreenCtx = power_display_get_screen_context(); + g_keepOnTimeout = curScreenCtx->keep_on_timeout; + if (display_api->get_screen_state() != SCREEN_ON) { + display_api->turn_on_screen(); + } + result = display_api->set_screen_set_keepon_timeout(3600000); // 3600000ms + } else { + result = display_api->set_screen_set_keepon_timeout(g_keepOnTimeout); + } + if (result == ERRCODE_SUCC) { + ret = DISPLAY_SUCCESS; + } + else { + ret = DISPLAY_FAIL; + } +#endif + if (ret == DISPLAY_SUCCESS) { + SuccessCallBack(thisVal, args[0], JSI::CreateUndefined()); + } else { + FailCallBack(thisVal, args[0], ret); + } + return JSI::CreateUndefined(); +} +void InitBrightnessModule(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "setKeepScreenOn", DisplayModule::SetKeepScreenOn); +} +} // namespace ACELite +} // namespace OHOS \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.h new file mode 100644 index 000000000..387495535 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/display/display.h @@ -0,0 +1,40 @@ +/* +* Copyright (c) CompanyNameMagicTag. 2024-2024. All rights reserved. +* Description: display control interfaces +* Author: Software Group +* Create: 2024-04-03 +*/ + +#ifndef DISPLAY_MODULE_H +#define DISPLAY_MODULE_H + +#include +#include "jsi.h" + +namespace OHOS { +namespace ACELite { +class DisplayModule final : public MemoryHeap { +public: + /** + * constructor + */ + DisplayModule() = default; + + /** + * desconstructor + */ + ~DisplayModule() = default; + + /** + * Display interface + */ + static JSIValue SetKeepScreenOn(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize); + +}; + +void InitBrightnessModule(JSIValue exports); +} // namespace ACELite +} // namespace OHOS + +#endif // DISPLAY_MODULE_H + diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h index 4ab2f81b0..e6f4df9f8 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/ohos_module_config.h @@ -33,6 +33,7 @@ extern void InitAppModule(JSIValue exports); #ifdef FEATURE_MODULE_AUDIO extern void InitAudioModule(JSIValue exports); extern void InitAudioCaptuerModule(JSIValue exports); +extern void InitBaiduMapComponentModule(JSIValue exports); #endif // FEATURE_MODULE_AUDIO #ifdef FEATURE_ACELITE_DFX_MODULE extern void InitDfxModule(JSIValue exports); @@ -44,10 +45,10 @@ extern void InitDfxModule(JSIValue exports); // extern void InitDialogModule(JSIValue exports); // #endif // FEATURE_MODULE_DIALOG -// #ifdef FEATURE_MODULE_STORAGE -// extern void InitNativeApiFs(JSIValue exports); -// extern void InitNativeApiKv(JSIValue exports); -// #endif +#ifdef FEATURE_MODULE_STORAGE +extern void InitNativeApiFs(JSIValue exports); +extern void InitNativeApiKv(JSIValue exports); +#endif // #ifdef FEATURE_MODULE_DEVICE // extern void InitDeviceModule(JSIValue exports); @@ -62,9 +63,9 @@ extern void InitDfxModule(JSIValue exports); // extern void InitSensorModule(JSIValue exports); // #endif -// #ifdef FEATURE_MODULE_BRIGHTNESS -// extern void InitBrightnessModule(JSIValue exports); -// #endif +#ifdef FEATURE_MODULE_BRIGHTNESS +extern void InitBrightnessModule(JSIValue exports); +#endif // #ifdef FEATURE_MODULE_BATTERY // extern void InitBatteryModule(JSIValue exports); @@ -87,6 +88,9 @@ const Module OHOS_MODULES[] = { #ifdef FEATURE_MODULE_AUDIO {"audio", InitAudioModule}, {"audiocaptuer", InitAudioCaptuerModule}, +#endif +#ifdef FEATURE_MODULE_BAIDU + {"baidumapcomponent",InitBaiduMapComponentModule}, #endif // FEATURE_MODULE_AUDIO #ifdef FEATURE_MODULE_MESSAGE_CENTER {"message", InitMsgCenter}, @@ -102,10 +106,10 @@ const Module OHOS_MODULES[] = { // {"prompt", InitDialogModule}, // #endif // FEATURE_MODULE_DIALOG -// #ifdef FEATURE_MODULE_STORAGE -// {"file", InitNativeApiFs}, -// {"storage", InitNativeApiKv}, -// #endif +#ifdef FEATURE_MODULE_STORAGE + {"file", InitNativeApiFs}, + {"storage", InitNativeApiKv}, +#endif // #ifdef FEATURE_MODULE_DEVICE // {"device", InitDeviceModule}, // #endif @@ -116,9 +120,9 @@ const Module OHOS_MODULES[] = { // {"vibrator", InitVibratorModule}, // {"sensor", InitSensorModule}, // #endif -// #ifdef FEATURE_MODULE_BRIGHTNESS -// {"brightness", InitBrightnessModule}, -// #endif +#ifdef FEATURE_MODULE_BRIGHTNESS + {"brightness", InitBrightnessModule}, +#endif // #ifdef FEATURE_MODULE_BATTERY // {"battery", InitBatteryModule}, // #endif diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.cpp b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.cpp new file mode 100644 index 000000000..6966cf073 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 "app_data_module.h" + +#include "ace_log.h" +#include "js_ability_impl.h" +#include "js_app_context.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +const char * const AppDataModule::GETAPP_METHOD_NAME = "getApp"; +const char * const AppDataModule::GETAPP_DATA_STR = "data"; +void AppDataModule::Init() +{ + CreateNamedFunction(GETAPP_METHOD_NAME, GetApp); +} + +jerry_value_t AppDataModule::GetApp(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)context; + (void)args; + + if (argsNum != 0) { + return UNDEFINED; + } + + const JSAbilityImpl *abilityImpl = JsAppContext::GetInstance()->GetTopJSAbilityImpl(); + if (!abilityImpl) { + return UNDEFINED; + } + + jerry_value_t abilityVM = abilityImpl->GetAppVM(); // do not release here + if (IS_UNDEFINED(abilityVM)) { + return UNDEFINED; + } + + jerry_value_t dataObj = jerryx_get_property_str(abilityVM, GETAPP_DATA_STR); + if (IS_UNDEFINED(dataObj)) { + return UNDEFINED; + } + jerry_release_value(dataObj); + return abilityVM; +} +} // namespace ACELite +} // namespace OHOS diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.h new file mode 100644 index 000000000..dfba14ddb --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/modules/presets/app_data_module.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef OHOS_ACELITE_APP_DATA_MODULE_H +#define OHOS_ACELITE_APP_DATA_MODULE_H + +#include "acelite_config.h" +#include "js_config.h" +#include "non_copyable.h" +#include "presets/preset_module.h" + +namespace OHOS { +namespace ACELite { +class AppDataModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppDataModule); + + /** + * @fn AppDataModule::AppDataModule() + * + * @brief Constructor. + */ + AppDataModule() : PresetModule(nullptr) {} + + /** + * @fn AppDataModule::~AppDataModule() + * + * @brief Constructor. + */ + ~AppDataModule() = default; + + static void Load() + { + AppDataModule appDataModule; + appDataModule.Init(); + } + + void Init() override; + +private: + static jerry_value_t GetApp(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + static const char * const GETAPP_METHOD_NAME; + static const char * const GETAPP_DATA_STR; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_APP_DATA_MODULE_H diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/CMakeLists.txt b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/CMakeLists.txt index 9f1b335fc..82a382278 100644 --- a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/CMakeLists.txt +++ b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/CMakeLists.txt @@ -16,6 +16,8 @@ set(PUBLIC_HEADER set(PRIVATE_HEADER ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include ${ROOT_DIR}/application/wearable/ohos_deps ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include @@ -102,3 +104,89 @@ install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/extcmd/include" "*") build_component() +set(COMPONENT_NAME "bms_sign_mode") +set(MODULE_NAME "ohos") +set(AUTO_DEF_FILE_ID TRUE) + +set(PUBLIC_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/frameworks/bundle_lite/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/interfaces/innerkits/bundlemgr_lite + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/interfaces/innerkits/bundlemgr_lite/slite + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/interfaces/kits/bundle_lite/slite + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/utils + ${CMAKE_CURRENT_SOURCE_DIR}/include/appexecfwk/appexecfwk_lite/utils/bundle_lite + ${CMAKE_CURRENT_SOURCE_DIR}/extcmd/include +) + +set(PRIVATE_HEADER + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/frameworks/resmgr_lite/include + ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include + ${ROOT_DIR}/application/wearable/ohos_deps + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits + ${ROOT_DIR}/open_source/openharmony/third_party/cJSON + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits +) + +if("__LITEOS__" IN_LIST DEFINES) +elseif ("__FREERTOS__" IN_LIST DEFINES) + set(PRIVATE_HEADER + ${PRIVATE_HEADER} + ${ROOT_DIR}/middleware/services/utils/fs/include/freertos_adapt + ) +endif() + +if("JS_ENABLE" IN_LIST DEFINES) +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/bundlems/sign_mode.cpp +) +endif() + +set(COMPONENT_PUBLIC_CCFLAGS +) + +set(COMPONENT_CCFLAGS + -std=c++11 + -Wno-error + -Wno-unused-parameter + -fno-exceptions + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -Wno-undef + -Wno-bitwise-op-parentheses + -Wno-shift-op-parentheses + -nostdlibinc + -nostdinc + -nostdlib + -Wno-c++11-narrowing + -Wno-error=unused-function +) + + +set(WHOLE_LINK + true +) + +set(MAIN_COMPONENT + false +) + +set(PUBLIC_DEFINES +) + +set(PRIVATE_DEFINES + APP_PLATFORM_WATCHGT + OHOS_DEBUG + JERRY_FOR_IAR_CONFIG +) + +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/include" "*") +install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/extcmd/include" "*") + +build_component() \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a index 638859b9a..7c8a4153c 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a index c36aac3e4..ba0b0665a 100644 Binary files a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-xts/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/bundlems/sign_mode.cpp b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/bundlems/sign_mode.cpp new file mode 100644 index 000000000..df1e672c4 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/bundlems/sign_mode.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "sign_mode.h" + +#include "ability_info_utils.h" +#include "ability_message_id.h" +#include "appexecfwk_errors.h" +#include "bundle_common.h" +#include "bundle_message_id.h" +#include "bundle_util.h" +#include "bundlems_log.h" +#include "cmsis_os2.h" +#include "dirent.h" +#include "fcntl.h" +#include "gt_bundle_extractor.h" +#include "gt_bundle_parser.h" +#include "gt_extractor_util.h" + +#include "los_tick.h" +#include "stdio.h" +#include "sys/stat.h" +#include "unistd.h" +#include "utils.h" +#include "want.h" + +#include "generate-bytecode.h" + +namespace OHOS { + +#ifdef OHOS_DEBUG +bool SignMode::isSignMode_ = true; + +uint8_t SignMode::SetSignMode(bool enable) +{ + isSignMode_ = enable; + return ERR_OK; +} + +bool SignMode::IsSignMode() +{ + return isSignMode_; +} +#endif +} // namespace OHOS diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/gt_bundle_manager_service.h b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/gt_bundle_manager_service.h index f619d4f72..d9f5eec50 100644 --- a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/gt_bundle_manager_service.h +++ b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/gt_bundle_manager_service.h @@ -83,10 +83,6 @@ public: PreAppList *InitPreAppInfo(void); void InsertPreAppInfo(const char *filePath, PreAppList *list); void SetPreAppInfo(PreAppList *list); -#ifdef OHOS_DEBUG - uint8_t SetSignMode(bool enable); - bool IsSignMode() const; -#endif private: GtManagerService(); ~GtManagerService(); @@ -121,9 +117,6 @@ private: PreAppList *preAppList_; bool updateFlag_; int32_t oldVersionCode_; -#ifdef OHOS_DEBUG - bool isSignMode_ { true }; -#endif }; } diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/sign_mode.h b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/sign_mode.h new file mode 100644 index 000000000..6ce1a2770 --- /dev/null +++ b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include/sign_mode.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef SIGN_MODE_H +#define SIGN_MODE_H + +#include "adapter.h" +#include "bundle_info.h" +#include "bundle_map.h" +#include "cJSON.h" +#include "gt_bundle_installer.h" +#include "stdint.h" +#include "want.h" +#include "install_param.h" +#include "bundle_install_msg.h" +#include "bundle_manager.h" +#include "los_list.h" +#include "ohos_types.h" + +namespace OHOS { + +class SignMode { +public: + static SignMode& GetInstance() { + static SignMode instance; + return instance; + } +#ifdef OHOS_DEBUG + static uint8_t SetSignMode(bool enable); + static bool IsSignMode(); +#endif + +private: + SignMode() = default; + ~SignMode() = default; + static bool isSignMode_; +}; + +} // namespace OHOS + +#endif // SIGN_MODE_H \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/CMakeLists.txt b/code/sdk/open_source/openharmony/third_party/jerryscript/CMakeLists.txt index 8f557e3b1..0648d1d11 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/CMakeLists.txt +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/CMakeLists.txt @@ -1,195 +1,253 @@ set(COMPONENT_NAME "jerryscript") set(PUBLIC_HEADER - ${CMAKE_CURRENT_SOURCE_DIR}/include/jerrycore - ${CMAKE_CURRENT_SOURCE_DIR}/include/jerryext - ${CMAKE_CURRENT_SOURCE_DIR}/include/jerrylibm - ${CMAKE_CURRENT_SOURCE_DIR}/include/jerryport - ${CMAKE_CURRENT_SOURCE_DIR}/include/jerryext/jerryscript-ext +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ext +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/include +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jmem +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jrt +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/lit +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/include +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/include/jerryscript-ext +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/include +# ${CMAKE_CURRENT_SOURCE_DIR}/jerry-libm/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/api + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/ecma/base + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/jmem + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/jrt + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-core/lit + ${CMAKE_CURRENT_SOURCE_DIR}/include/jerry-ext/include/jerryscript-ext ) set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/ohos_deps - ${PUBLIC_HEADER} + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/debugger + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jcontext + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/regexp + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/common + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/arg + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handle-scope + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ext + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/include + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jmem + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jrt + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/lit + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/include + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/include/jerryscript-ext + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/include + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-libm/include ) if("JS_ENABLE" IN_LIST DEFINES) + set(SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/arg.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/arg-js-iterator-helper.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/arg-transform-functions.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/byte-code.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/common.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-common.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-rp.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-serial.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-sha1.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-tcp.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger-ws.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-date.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-debugger.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-external-context.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-fatal.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-io.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/default-module.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-alloc.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-arraybuffer-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-array-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-boolean-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-arraybuffer.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-arraybuffer-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-array-iterator-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-boolean.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-boolean-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-dataview.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-dataview-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-date.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-date-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-error.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-error-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-evalerror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-evalerror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-float32array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-float32array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-float64array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-float64array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-function.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-function-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-global.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-helpers.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-helpers-date.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-helpers-error.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-helpers-json.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-helpers-sort.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int16array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int16array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int32array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int32array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int8array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-int8array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-iterator-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-json.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-map.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-map-iterator-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-map-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-math.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-number.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-number-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-object-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-promise.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-promise-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-rangeerror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-rangeerror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-referenceerror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-referenceerror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-regexp.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-regexp-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtins.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-set.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-set-iterator-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-set-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-string.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-string-iterator-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-string-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-symbol.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-symbol-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-syntaxerror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-syntaxerror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-typedarray.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-typedarray-helpers.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-typedarray-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-typeerror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-typeerror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-type-error-thrower.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint16array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint16array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint32array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint32array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint8array.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint8array-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint8clampedarray.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-uint8clampedarray-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-urierror.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-builtin-urierror-prototype.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-comparison.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-container-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-conversion.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-dataview-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-eval.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-exceptions.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-function-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-gc.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-get-put-value.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-collection.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-conversion.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-errol.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-external-pointers.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-number.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-string.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-helpers-value.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-init-finalize.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-iterator-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-jobqueue.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-lcache.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-lex-env.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-literal-storage.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-module.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-number-arithmetic.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-number-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-objects-arguments.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-objects.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-objects-general.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-promise-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-property-hashmap.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-reference.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-regexp-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-string-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-symbol-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/ecma-typedarray-object.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/generate-bytecode.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handler-assert.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handler-gc.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handler-print.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handler-register.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handle-scope-allocator.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/handle-scope.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jcontext.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jerry.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jerry-debugger.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jerry-debugger-transport.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jerry-snapshot.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jmem-allocator.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jmem-heap.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jmem-poolman.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/jrt-fatals.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-lexer.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser-expr.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser-mem.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser-module.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser-statm.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-parser-util.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-scanner.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/js-scanner-util.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/lit-char-helpers.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/lit-magic-strings.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/lit-strings.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/module.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/opcodes.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/opcodes-ecma-arithmetics.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/opcodes-ecma-bitwise.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/opcodes-ecma-relational-equality.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/re-bytecode.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/re-compiler.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/re-parser.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/vm.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/vm-stack.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/vm-utils.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api/jerry-debugger-transport.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api/jerry-debugger.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api/jerry-snapshot.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/api/jerry.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/debugger/debugger.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-alloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-gc.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-collection.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-conversion.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-errol.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-external-pointers.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-number.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-string.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers-value.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-helpers.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-init-finalize.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-lcache.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-literal-storage.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-module.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/base/ecma-property-hashmap.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype-unscopables.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-arraybuffer.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-boolean-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-boolean.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-dataview.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-date.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-error.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-evalerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-function.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-generator-function.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-generator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-generator.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-global.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-error.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-json.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-sort.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-intrinsic.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-json.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-map-iterator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-map-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-map.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-math.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-number-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-number.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-promise-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-promise.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-proxy.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-rangeerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-referenceerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-reflect.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-regexp-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-regexp.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-set-iterator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-set-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-set.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-string-iterator-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-string.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-symbol-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-symbol.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-syntaxerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-type-error-thrower.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-typeerror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-urierror-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-urierror.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-weakmap-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-weakmap.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-weakset-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtin-weakset.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/ecma-builtins.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int16array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int32array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-int8array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-helpers.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint16array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint32array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8array.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray-prototype.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-uint8clampedarray.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-array-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-arraybuffer-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-boolean-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-comparison.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-container-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-conversion.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-dataview-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-eval.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-exceptions.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-function-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-get-put-value.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-iterator-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-jobqueue.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-lex-env.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-number-arithmetic.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-number-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-objects-arguments.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-objects-general.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-objects.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-promise-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-proxy-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-reference.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-regexp-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-string-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-symbol-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ecma/operations/ecma-typedarray-object.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ext/ext-utils.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ext/heapdump.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/ext/tracker.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jcontext/jcontext.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jmem/jmem-allocator.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jmem/jmem-heap.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jmem/jmem-poolman.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/jrt/jrt-fatals.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/lit/lit-char-helpers.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/lit/lit-magic-strings.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/lit/lit-strings.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/byte-code.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/common.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-lexer.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-expr.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-mem.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-module.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-statm.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-tagged-template-literal.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser-util.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-parser.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-scanner-ops.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-scanner-util.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/js/js-scanner.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/regexp/re-bytecode.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/regexp/re-compiler.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/parser/regexp/re-parser.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/opcodes-ecma-arithmetics.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/opcodes-ecma-bitwise.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/opcodes-ecma-relational-equality.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/opcodes.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/vm-stack.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/vm-utils.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-core/vm/vm.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/arg/arg-js-iterator-helper.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/arg/arg-transform-functions.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/arg/arg.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-common.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-rp.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-serial.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-sha1.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-tcp.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/debugger/debugger-ws.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handle-scope/handle-scope-allocator.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handle-scope/handle-scope.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handler/handler-assert.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handler/handler-gc.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handler/handler-print.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handler/handler-register.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/handler/handler-resource-name.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-ext/module/module.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-date.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-debugger.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-external-context.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-fatal.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-io.c + ${CMAKE_CURRENT_SOURCE_DIR}/jerry-port/default/default-module.c ) endif() @@ -223,54 +281,12 @@ set(PUBLIC_DEFINES ) set(PRIVATE_DEFINES + JERRY_GLOBAL_HEAP_SIZE=128 JERRY_ERROR_MESSAGES=1 JERRY_LINE_INFO=1 - JERRY_DEBUGGER=1 - JERRY_STACK_LIMIT=0 - JERRY_FOR_IAR_CONFIG JERRY_FUNCTION_NAME JERRY_FUNCTION_BACKTRACE - JERRY_GC_LIMIT=0 - JERRY_CPOINTER_32_BIT=0 - JERRY_EXTERNAL_CONTEXT=0 - JERRY_PARSER=1 - JERRY_LOGGING=0 - JERRY_MEM_GC_BEFORE_EACH_ALLOC=0 - JERRY_PARSER_DUMP_BYTE_CODE=0 - JERRY_ES2015=0 - JERRY_REGEXP_STRICT_MODE=0 - JERRY_REGEXP_DUMP_BYTE_CODE=0 - JERRY_SNAPSHOT_EXEC=1 - JERRY_SNAPSHOT_SAVE=1 - JERRY_SYSTEM_ALLOCATOR=0 - JERRY_VALGRIND=0 - JERRY_VM_EXEC_STOP=0 - CONFIG_FEATURE_OS_DEBUG=false - JERRYSCRIPT_MASK_OFF_ACOS - JERRYSCRIPT_MASK_OFF_ACOSH - JERRYSCRIPT_MASK_OFF_ASIN - JERRYSCRIPT_MASK_OFF_ASINH - JERRYSCRIPT_MASK_OFF_ATAN - JERRYSCRIPT_MASK_OFF_ATAN2 - JERRYSCRIPT_MASK_OFF_ATANH - JERRYSCRIPT_MASK_OFF_CBRT - JERRYSCRIPT_MASK_OFF_CEIL - JERRYSCRIPT_MASK_OFF_COSH - JERRYSCRIPT_MASK_OFF_EXP - JERRYSCRIPT_MASK_OFF_FABS - JERRYSCRIPT_MASK_OFF_FLOOR - JERRYSCRIPT_MASK_OFF_FMOD - JERRYSCRIPT_MASK_OFF_LOG - JERRYSCRIPT_MASK_OFF_LOG10 - JERRYSCRIPT_MASK_OFF_LOG2 - JERRYSCRIPT_MASK_OFF_POW - JERRYSCRIPT_MASK_OFF_SCALBN - JERRYSCRIPT_MASK_OFF_SINH - JERRYSCRIPT_MASK_OFF_SQRT - JERRYSCRIPT_MASK_OFF_TANH - JERRYSCRIPT_MASK_OFF_SIN - JERRYSCRIPT_MASK_OFF_COS - JERRYSCRIPT_MASK_OFF_TAN + JERRY_STACK_LIMIT=0 ) install_sdk_by_sh("${CMAKE_CURRENT_SOURCE_DIR}/include" "*") diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a index 9c6dd5196..f87abf35e 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a index c738f1f46..747f45171 100644 Binary files a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-xts/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/generate-bytecode.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/api/generate-bytecode.h similarity index 61% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/generate-bytecode.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/api/generate-bytecode.h index 0030a6dfc..b33dbba7b 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/generate-bytecode.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/api/generate-bytecode.h @@ -1,38 +1,61 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: Definition of header file for generating bytecode. - * Create: 2020/09/07 - */ - -#ifndef GENERATE_BYTECODE_H -#define GENERATE_BYTECODE_H - -#ifdef JERRY_FOR_IAR_CONFIG - -typedef enum { - EXCE_ACE_JERRY_EXEC_OK = 0, // program function OK - EXCE_ACE_JERRY_NULL_PATH, // null path for generateing snapshot - EXEC_ACE_JERRY_MALLOC_ERROR, // error when malloc - EXCE_ACE_JERRY_INPUT_PATH_ERROR, // passed input path is NULL OR open failed - EXCE_ACE_JERRY_INPUT_PATH_NOT_DIR, // passed input path is not a directory - EXCE_ACE_JERRY_OPEN_DIR_FAILED, // open directory failed - EXCE_ACE_JERRY_GENERATE_SNAPSHOT_FAILED, // jerry_generate_snapshot failed - EXCE_ACE_JERRY_OPEN_FILE_FAILED, // open file failed - EXCE_ACE_JERRY_WRITE_SNAPSHOT_FILE_FAILED, // write into snapshot file failed - EXCE_ACE_JERRY_READ_JSFILE_FAILED, // read .js file process failed - EXCE_ACE_JERRY_JSFILE_TOO_LARGE, // bytes of js file out of psRAM - EXCE_ACE_JERRY_SPLICE_PATH_ERROR, // error when splice path - EXCE_ACE_JERRY_SPLICE_OUTPUT_PATH_ERROR, // error when splice output file abs name - EXCE_ACE_JERRY_SPRINTFS_VERSION_ERROR, // error when sprintf_s for jerry_version - EXCE_ACE_JERRY_GET_FILE_STAT_ERROR, // error when getting file stat - EXCE_ACE_JERRY_LINKLIST_ERROR, // error when malloc for list node - EXEC_ACE_JERRY_UNLINKFILE_ERROR, // error when unlink bytecode file -} EXECRES; - -char* get_jerry_version_no(); -EXECRES walk_directory(char* filefolder); -EXECRES walk_del_bytecode(char* filefolder); - -#endif // end JERRY_FOR_IAR_CONFIG - -#endif // GENERATE_BYTECODE_H +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: Definition of header file for generating bytecode. + * Create: 2020/09/07 + */ + +#ifndef GENERATE_BYTECODE_H +#define GENERATE_BYTECODE_H + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef JERRY_FOR_IAR_CONFIG + +#include "jerryscript.h" +#include "jerry-snapshot.h" + +typedef enum { + EXCE_ACE_JERRY_EXEC_OK = 0, // program function OK + EXCE_ACE_JERRY_NULL_PATH, // null path for generateing snapshot + EXCE_ACE_JERRY_MALLOC_ERROR, // error when malloc + EXCE_ACE_JERRY_INPUT_PATH_ERROR, // passed input path is NULL OR open failed + EXCE_ACE_JERRY_INPUT_PATH_NOT_DIR, // passed input path is not a directory + EXCE_ACE_JERRY_OPEN_DIR_FAILED, // open directory failed + EXCE_ACE_JERRY_GENERATE_SNAPSHOT_FAILED, // jerry_generate_snapshot failed + EXCE_ACE_JERRY_OPEN_FILE_FAILED, // open file failed + EXCE_ACE_JERRY_WRITE_SNAPSHOT_FILE_FAILED, // write into snapshot file failed + EXCE_ACE_JERRY_READ_FILE_FAILED, // read .js file or snapshot file process failed + EXCE_ACE_JERRY_FILE_TOO_LARGE, // bytes of js or snapshot file out of psRAM buffer size for them + EXCE_ACE_JERRY_SPLICE_PATH_ERROR, // error when splice path + EXCE_ACE_JERRY_SPLICE_OUTPUT_PATH_ERROR, // error when splice output file abs name + EXCE_ACE_JERRY_SPRINTFS_VERSION_ERROR, // error when sprintf_s for jerry_version + EXCE_ACE_JERRY_GET_FILE_STAT_ERROR, // error when getting file stat + EXCE_ACE_JERRY_LINKLIST_ERROR, // error when malloc for list node + EXCE_ACE_JERRY_UNLINKFILE_ERROR, // error when unlink bytecode file + EXCE_ACE_JERRY_SNAPSHOT_VERSION_ERROR, // snapshot file version wrong +} EXECRES; + +typedef struct +{ + jerry_context_t *context_p; +} ContextRecord; + +char* get_jerry_version_no(); +EXECRES walk_directory(char* filefolder); +EXECRES walk_del_bytecode(char* filefolder); + +void bms_task_context_init (void); +void js_task_context_init (void); +void jerry_port_default_remove_current_context_record (); + +void jerry_external_context_init(uint32_t heap_size, jerry_context_alloc_t alloc, void *cb_data_p); + +#endif // JERRY_FOR_IAR_CONFIG + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif // GENERATE_BYTECODE_H diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerry-snapshot.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/api/jerry-snapshot.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerry-snapshot.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/api/jerry-snapshot.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/config.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/config.h similarity index 85% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/config.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/config.h index cf375a7c2..bae023347 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/config.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/config.h @@ -21,7 +21,7 @@ */ #if (!defined(_WIN32) && !defined(_WIN64)) -# define JERRY_BUILTIN_REGEXP 0 +# define JERRY_BUILTIN_REGEXP 1 # define JERRY_ES2015 0 #ifndef JERRY_NDEBUG # define JERRY_NDEBUG @@ -33,18 +33,25 @@ #ifndef JERRY_FOR_IAR_CONFIG # define JERRY_MEM_STATS 1 # define JERRY_LOGGING 1 -#endif +#endif /* JERRY_FOR_IAR_CONFIG */ #ifndef JERRY_GLOBAL_HEAP_SIZE //Maximum size of heap in kilobytes -# define JERRY_GLOBAL_HEAP_SIZE (48) +# define JERRY_GLOBAL_HEAP_SIZE (128) #endif #ifndef JERRY_BUILTIN_EVAL_DISABLED // disable builtin eval() function # define JERRY_BUILTIN_EVAL_DISABLED 1 #endif -#endif /* JERRY_FOR_IAR_CONFIG */ + +#if defined (__linux__) +#ifndef JERRY_SNAPSHOT_SAVE +# define JERRY_SNAPSHOT_SAVE 1 +#endif +#endif /* binary tool compiling in linux platform */ + +#endif /* !defined(_WIN32) && !defined(_WIN64) */ /* * Here define the special config for Win simulator build. @@ -64,9 +71,9 @@ # define JERRY_MEM_STATS 1 # define JERRY_SNAPSHOT_EXEC 1 # define JERRY_SNAPSHOT_SAVE 1 -# ifndef JERRY_LOGGING -# define JERRY_LOGGING 1 -# endif +#ifndef JERRY_LOGGING +# define JERRY_LOGGING 1 +#endif // following config controls temp changes in jerry for debugger function with IDE # define ACE_DEBUGGER_CUSTOM @@ -144,18 +151,10 @@ # define JERRY_ES2015 1 #endif /* !defined (JERRY_ES2015) */ -#ifndef JERRY_ES2015_BUILTIN -# define JERRY_ES2015_BUILTIN JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_BUILTIN) */ - #ifndef JERRY_ES2015_BUILTIN_DATAVIEW # define JERRY_ES2015_BUILTIN_DATAVIEW JERRY_ES2015 #endif /* !defined (JERRY_ES2015_BUILTIN_DATAVIEW) */ -#ifndef JERRY_ES2015_BUILTIN_ITERATOR -# define JERRY_ES2015_BUILTIN_ITERATOR JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_BUILTIN_ITERATOR) */ - #ifndef JERRY_ES2015_BUILTIN_MAP # define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015 #endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */ @@ -164,50 +163,34 @@ # define JERRY_ES2015_BUILTIN_SET JERRY_ES2015 #endif /* !defined (JERRY_ES2015_BUILTIN_SET) */ +#ifndef JERRY_ES2015_BUILTIN_WEAKMAP +# define JERRY_ES2015_BUILTIN_WEAKMAP JERRY_ES2015 +#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKMAP) */ + +#ifndef JERRY_ES2015_BUILTIN_WEAKSET +# define JERRY_ES2015_BUILTIN_WEAKSET JERRY_ES2015 +#endif /* !defined (JERRY_ES2015_BUILTIN_WEAKSET) */ + #ifndef JERRY_ES2015_BUILTIN_PROMISE # define JERRY_ES2015_BUILTIN_PROMISE JERRY_ES2015 #endif /* !defined (JERRY_ES2015_BUILTIN_PROMISE) */ -#ifndef JERRY_ES2015_BUILTIN_SYMBOL -# define JERRY_ES2015_BUILTIN_SYMBOL JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_BUILTIN_SYMBOL) */ +#ifndef JERRY_ES2015_BUILTIN_PROXY +# define JERRY_ES2015_BUILTIN_PROXY JERRY_ES2015 +#endif /* !defined (JERRY_ES2015_BUILTIN_PROXY) */ + +#ifndef JERRY_ES2015_BUILTIN_REFLECT +# define JERRY_ES2015_BUILTIN_REFLECT JERRY_ES2015 +#endif /* !defined (JERRY_ES2015_BUILTIN_REFLECT) */ #ifndef JERRY_ES2015_BUILTIN_TYPEDARRAY # define JERRY_ES2015_BUILTIN_TYPEDARRAY JERRY_ES2015 #endif /* !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ -#ifndef JERRY_ES2015_ARROW_FUNCTION -# define JERRY_ES2015_ARROW_FUNCTION JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_ARROW_FUNCTION) */ - -#ifndef JERRY_ES2015_CLASS -# define JERRY_ES2015_CLASS JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_CLASS) */ - -#ifndef JERRY_ES2015_FOR_OF -# define JERRY_ES2015_FOR_OF JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_FOR_OF) */ - -#ifndef JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER -# define JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) */ - -#ifndef JERRY_ES2015_FUNCTION_REST_PARAMETER -# define JERRY_ES2015_FUNCTION_REST_PARAMETER JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_FUNCTION_REST_PARAMETER) */ - -#ifndef JERRY_ES2015_OBJECT_INITIALIZER -# define JERRY_ES2015_OBJECT_INITIALIZER JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_OBJECT_INITIALIZER) */ - #ifndef JERRY_ES2015_MODULE_SYSTEM # define JERRY_ES2015_MODULE_SYSTEM JERRY_ES2015 #endif /* !defined (JERRY_ES2015_MODULE_SYSTEM) */ -#ifndef JERRY_ES2015_TEMPLATE_STRINGS -# define JERRY_ES2015_TEMPLATE_STRINGS JERRY_ES2015 -#endif /* !defined (JERRY_ES2015_TEMPLATE_STRINGS) */ - /** * Engine internal and misc configurations. */ @@ -294,6 +277,15 @@ # define JERRY_STACK_LIMIT (0) #endif /* !defined (JERRY_STACK_LIMIT) */ +/** + * Maximum depth of recursion during GC mark phase + * + * Default value: 8 + */ +#ifndef JERRY_GC_MARK_LIMIT +# define JERRY_GC_MARK_LIMIT (8) +#endif /* !defined (JERRY_GC_MARK_LIMIT) */ + /** * Enable/Disable property lookup cache. * @@ -539,7 +531,6 @@ # define JERRY_ATTR_GLOBAL_HEAP #endif /* !defined (JERRY_ATTR_GLOBAL_HEAP) */ - /** * Sanity check for macros to see if the values are 0 or 1 * @@ -600,18 +591,6 @@ || ((JERRY_ES2015 != 0) && (JERRY_ES2015 != 1)) # error "Invalid value for JERRY_ES2015 macro." #endif -#if !defined (JERRY_ES2015_ARROW_FUNCTION) \ -|| ((JERRY_ES2015_ARROW_FUNCTION != 0) && (JERRY_ES2015_ARROW_FUNCTION != 1)) -# error "Invalid value for JERRY_ES2015_ARROW_FUNCTION macro." -#endif -#if !defined (JERRY_ES2015_BUILTIN) \ -|| ((JERRY_ES2015_BUILTIN != 0) && (JERRY_ES2015_BUILTIN != 1)) -# error "Invalid value for JERRY_ES2015_BUILTIN macro." -#endif -#if !defined (JERRY_ES2015_BUILTIN_ITERATOR) \ -|| ((JERRY_ES2015_BUILTIN_ITERATOR != 0) && (JERRY_ES2015_BUILTIN_ITERATOR != 1)) -# error "Invalid value for JERRY_ES2015_BUILTIN_ITERATOR macro." -#endif #if !defined (JERRY_ES2015_BUILTIN_DATAVIEW) \ || ((JERRY_ES2015_BUILTIN_DATAVIEW != 0) && (JERRY_ES2015_BUILTIN_DATAVIEW != 1)) # error "Invalid value for JERRY_ES2015_BUILTIN_DATAVIEW macro." @@ -620,50 +599,38 @@ || ((JERRY_ES2015_BUILTIN_MAP != 0) && (JERRY_ES2015_BUILTIN_MAP != 1)) # error "Invalid value for JERRY_ES2015_BUILTIN_MAP macro." #endif +#if !defined (JERRY_ES2015_BUILTIN_REFLECT) \ +|| ((JERRY_ES2015_BUILTIN_REFLECT != 0) && (JERRY_ES2015_BUILTIN_REFLECT != 1)) +# error "Invalid value for JERRY_ES2015_BUILTIN_REFLECT macro." +#endif #if !defined (JERRY_ES2015_BUILTIN_SET) \ || ((JERRY_ES2015_BUILTIN_SET != 0) && (JERRY_ES2015_BUILTIN_SET != 1)) # error "Invalid value for JERRY_ES2015_BUILTIN_SET macro." #endif +#if !defined (JERRY_ES2015_BUILTIN_WEAKMAP) \ +|| ((JERRY_ES2015_BUILTIN_WEAKMAP != 0) && (JERRY_ES2015_BUILTIN_WEAKMAP != 1)) +# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKMAP macro." +#endif +#if !defined (JERRY_ES2015_BUILTIN_WEAKSET) \ +|| ((JERRY_ES2015_BUILTIN_WEAKSET != 0) && (JERRY_ES2015_BUILTIN_WEAKSET != 1)) +# error "Invalid value for JERRY_ES2015_BUILTIN_WEAKSET macro." +#endif #if !defined (JERRY_ES2015_BUILTIN_PROMISE) \ || ((JERRY_ES2015_BUILTIN_PROMISE != 0) && (JERRY_ES2015_BUILTIN_PROMISE != 1)) # error "Invalid value for JERRY_ES2015_BUILTIN_PROMISE macro." #endif -#if !defined (JERRY_ES2015_BUILTIN_SYMBOL) \ -|| ((JERRY_ES2015_BUILTIN_SYMBOL != 0) && (JERRY_ES2015_BUILTIN_SYMBOL != 1)) -# error "Invalid value for JERRY_ES2015_BUILTIN_SYMBOL macro." +#if !defined (JERRY_ES2015_BUILTIN_PROXY) \ +|| ((JERRY_ES2015_BUILTIN_PROXY != 0) && (JERRY_ES2015_BUILTIN_PROXY != 1)) +# error "Invalid value for JERRY_ES2015_BUILTIN_PROXY macro." #endif #if !defined (JERRY_ES2015_BUILTIN_TYPEDARRAY) \ || ((JERRY_ES2015_BUILTIN_TYPEDARRAY != 0) && (JERRY_ES2015_BUILTIN_TYPEDARRAY != 1)) # error "Invalid value for JERRY_ES2015_BUILTIN_TYPEDARRAY macro." #endif -#if !defined (JERRY_ES2015_CLASS) \ -|| ((JERRY_ES2015_CLASS != 0) && (JERRY_ES2015_CLASS != 1)) -# error "Invalid value for JERRY_ES2015_CLASS macro." -#endif -#if !defined (JERRY_ES2015_FOR_OF) \ -|| ((JERRY_ES2015_FOR_OF != 0) && (JERRY_ES2015_FOR_OF != 1)) -# error "Invalid value for JERRY_ES2015_FOR_OF macro." -#endif -#if !defined (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) \ -|| ((JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER != 0) && (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER != 1)) -# error "Invalid value for JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER macro." -#endif -#if !defined (JERRY_ES2015_FUNCTION_REST_PARAMETER) \ -|| ((JERRY_ES2015_FUNCTION_REST_PARAMETER != 0) && (JERRY_ES2015_FUNCTION_REST_PARAMETER != 1)) -# error "Invalid value for JERRY_ES2015_FUNCTION_REST_PARAMETER macro." -#endif -#if !defined (JERRY_ES2015_OBJECT_INITIALIZER) \ -|| ((JERRY_ES2015_OBJECT_INITIALIZER != 0) && (JERRY_ES2015_OBJECT_INITIALIZER != 1)) -# error "Invalid value for JERRY_ES2015_OBJECT_INITIALIZER macro." -#endif #if !defined (JERRY_ES2015_MODULE_SYSTEM) \ || ((JERRY_ES2015_MODULE_SYSTEM != 0) && (JERRY_ES2015_MODULE_SYSTEM != 1)) # error "Invalid value for JERRY_ES2015_MODULE_SYSTEM macro." #endif -#if !defined (JERRY_ES2015_TEMPLATE_STRINGS) \ -|| ((JERRY_ES2015_TEMPLATE_STRINGS != 0) && (JERRY_ES2015_TEMPLATE_STRINGS != 1)) -# error "Invalid value for JERRY_ES2015_TEMPLATE_STRINGS macro." -#endif /** * Internal options. @@ -693,6 +660,9 @@ #if !defined (JERRY_STACK_LIMIT) || (JERRY_STACK_LIMIT < 0) # error "Invalid value for 'JERRY_STACK_LIMIT' macro." #endif +#if !defined (JERRY_GC_MARK_LIMIT) || (JERRY_GC_MARK_LIMIT < 0) +# error "Invalid value for 'JERRY_GC_MARK_LIMIT' macro." +#endif #if !defined (JERRY_LCACHE) \ || ((JERRY_LCACHE != 0) && (JERRY_LCACHE != 1)) # error "Invalid value for 'JERRY_LCACHE' macro." @@ -762,7 +732,6 @@ # error "Invalid value for 'JERRY_VM_EXEC_STOP' macro." #endif - #define ENABLED(FEATURE) ((FEATURE) == 1) #define DISABLED(FEATURE) ((FEATURE) != 1) @@ -777,4 +746,14 @@ # error "Date does not support float32" #endif +/** + * Wrap container types into a single guard + */ +#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) +# define JERRY_ES2015_BUILTIN_CONTAINER 1 +#else +# define JERRY_ES2015_BUILTIN_CONTAINER 0 +#endif + #endif /* !JERRYSCRIPT_CONFIG_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-globals.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/ecma/base/ecma-globals.h similarity index 82% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-globals.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/ecma/base/ecma-globals.h index aa55b2ee6..d5a117aef 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-globals.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/ecma/base/ecma-globals.h @@ -36,6 +36,15 @@ */ #define ECMA_NULL_POINTER JMEM_CP_NULL +#if defined (JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY) + +/** + * JMEM_ALIGNMENT_LOG aligned pointers can be stored directly in ecma_value_t + */ +#define ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY + +#endif /* JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY */ + /** * @} */ @@ -62,6 +71,7 @@ typedef enum ECMA_STATUS_HIGH_PRESSURE_GC = (1u << 2), /**< last gc was under high pressure */ #endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */ ECMA_STATUS_EXCEPTION = (1u << 3), /**< last exception is a normal exception */ + ECMA_STATUS_ABORT = (1u << 4), /**< last exception is an abort */ } ecma_status_flag_t; /** @@ -88,23 +98,37 @@ typedef enum #endif /* ENABLED (JERRY_DEBUGGER) */ /** - * Option flags for script parsing. + * Option flags for parser_parse_script and internal flags for global_status_flags in parser context. * Note: - * The enum members must be kept in sync with parser_general_flags_t - * The last 16 bits are reserved for scope chain index + * the last 16 bits is reserved for internal parser flags, because the debugger uses these + * 16 bits to encode the scope chain skip index as well (see ECMA_PARSE_CHAIN_INDEX_SHIFT) */ typedef enum { ECMA_PARSE_NO_OPTS = 0, /**< no options passed */ - ECMA_PARSE_STRICT_MODE = (1u << 0), /**< enable strict mode */ - ECMA_PARSE_DIRECT_EVAL = (1u << 1), /**< eval is called directly (ECMA-262 v5, 15.1.2.1.1) */ - /* These four status flags must be in this order. See PARSER_CLASS_PARSE_OPTS_OFFSET. */ - ECMA_PARSE_CLASS_CONSTRUCTOR = (1u << 2), /**< a class constructor is being parsed (this value must be kept in - * in sync with PARSER_CLASS_CONSTRUCTOR) */ - ECMA_PARSE_HAS_SUPER = (1u << 3), /**< the current context has super reference */ - ECMA_PARSE_HAS_IMPL_SUPER = (1u << 4), /**< the current context has implicit parent class */ - ECMA_PARSE_HAS_STATIC_SUPER = (1u << 5), /**< the current context is a static class method */ - ECMA_PARSE_EVAL = (1u << 6), /**< eval is called */ + ECMA_PARSE_STRICT_MODE = (1u << 0), /**< enable strict mode, must be same as PARSER_IS_STRICT */ + ECMA_PARSE_MODULE = (1u << 1), /**< module is parsed */ + ECMA_PARSE_EVAL = (1u << 2), /**< eval is called */ + ECMA_PARSE_DIRECT_EVAL = (1u << 3), /**< eval is called directly (ECMA-262 v5, 15.1.2.1.1) */ + ECMA_PARSE_CLASS_CONSTRUCTOR = (1u << 4), /**< a class constructor is being parsed */ + + /* These four status flags must be in this order. The first three are also parser status flags. + * See PARSER_SAVE_STATUS_FLAGS / PARSER_RESTORE_STATUS_FLAGS. */ + ECMA_PARSE_ALLOW_SUPER = (1u << 5), /**< allow super property access */ + ECMA_PARSE_ALLOW_SUPER_CALL = (1u << 6), /**< allow super constructor call */ + ECMA_PARSE_ALLOW_NEW_TARGET = (1u << 7), /**< allow new.target access */ + ECMA_PARSE_FUNCTION_CONTEXT = (1u << 8), /**< function context is present (ECMA_PARSE_DIRECT_EVAL must be set) */ + + ECMA_PARSE_GENERATOR_FUNCTION = (1u << 9), /**< generator function is parsed */ + + /* These flags are internally used by the parser. */ +#ifndef JERRY_NDEBUG + /** + * This flag represents an error in for in/of statements, which cannot be set + * if the parsing is completed successfully. + */ + ECMA_PARSE_INTERNAL_FOR_IN_OFF_CONTEXT_ERROR = (1u << 30), +#endif /* !JERRY_NDEBUG */ } ecma_parse_opts_t; /** @@ -119,15 +143,6 @@ typedef uint32_t ecma_value_t; */ typedef int32_t ecma_integer_value_t; -#if UINTPTR_MAX <= UINT32_MAX - -/** - * JMEM_ALIGNMENT_LOG aligned pointers can be stored directly in ecma_value_t - */ -#define ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY - -#endif /* UINTPTR_MAX <= UINT32_MAX */ - /** * Mask for ecma types in ecma_value_t */ @@ -187,7 +202,11 @@ enum * ecma_op_object_find */ ECMA_VALUE_REGISTER_REF = ECMA_MAKE_VALUE (8), /**< register reference, * a special "base" value for vm */ - ECMA_VALUE_IMPLICIT_CONSTRUCTOR = ECMA_MAKE_VALUE (9), /**< special value for bound class constructors */ + ECMA_VALUE_RELEASE_LEX_ENV = ECMA_MAKE_VALUE (9), /**< if this error remains on the stack when an exception occours + the top lexical environment of the VM frame should be popped */ + ECMA_VALUE_UNINITIALIZED = ECMA_MAKE_VALUE (10), /**< a special value for uninitialized let/const declarations */ + ECMA_VALUE_SPREAD_ELEMENT = ECMA_MAKE_VALUE (11), /**< a special value for spread elements in array initialization + * or function call argument list */ }; #if !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) @@ -327,10 +346,11 @@ typedef enum * that are not indices */ ECMA_LIST_ENUMERABLE = (1 << 1), /**< exclude non-enumerable properties */ ECMA_LIST_PROTOTYPE = (1 << 2), /**< list properties from prototype chain */ -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties only */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - ECMA_LIST_CONVERT_FAST_ARRAYS = (1 << 4), /**< after listing the properties convert +#if ENABLED (JERRY_ES2015) + ECMA_LIST_SYMBOLS = (1 << 3), /**< list symbol properties */ + ECMA_LIST_SYMBOLS_ONLY = (1 << 4), /**< list symbol properties only */ +#endif /* ENABLED (JERRY_ES2015) */ + ECMA_LIST_CONVERT_FAST_ARRAYS = (1 << 5), /**< after listing the properties convert * the fast access mode array back to normal array */ } ecma_list_properties_options_t; @@ -390,6 +410,15 @@ typedef enum */ #define ECMA_PROPERTY_FIXED 0 +/** + * Default flag of length property. + */ +#if ENABLED (JERRY_ES2015) +#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FLAG_CONFIGURABLE +#else /* !ENABLED (JERRY_ES2015) */ +#define ECMA_PROPERTY_FLAG_DEFAULT_LENGTH ECMA_PROPERTY_FIXED +#endif /* ENABLED (JERRY_ES2015) */ + /** * Shift for property name part. */ @@ -593,6 +622,7 @@ typedef enum ECMA_PROPERTY_GET_NO_OPTIONS = 0, /**< no option flags for ecma_op_object_get_property */ ECMA_PROPERTY_GET_VALUE = 1u << 0, /**< fill virtual_value field for virtual properties */ ECMA_PROPERTY_GET_EXT_REFERENCE = 1u << 1, /**< get extended reference to the property */ + ECMA_PROPERTY_GET_HAS_OWN_PROP = 1u << 2, /**< internal [[HasOwnProperty]] method */ } ecma_property_get_option_bits_t; /** @@ -602,15 +632,13 @@ typedef enum { ECMA_OBJECT_TYPE_GENERAL = 0, /**< all objects that are not belongs to the sub-types below. */ ECMA_OBJECT_TYPE_CLASS = 1, /**< Objects with class property */ - ECMA_OBJECT_TYPE_FUNCTION = 2, /**< Function objects (15.3), created through 13.2 routine */ - ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION = 3, /**< External (host) function object */ - ECMA_OBJECT_TYPE_ARRAY = 4, /**< Array object (15.4) */ - ECMA_OBJECT_TYPE_BOUND_FUNCTION = 5, /**< Function objects (15.3), created through 15.3.4.5 routine */ - ECMA_OBJECT_TYPE_PSEUDO_ARRAY = 6, /**< Array-like object, such as Arguments object (10.6) */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) - ECMA_OBJECT_TYPE_ARROW_FUNCTION = 7, /**< arrow function objects */ -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ - + ECMA_OBJECT_TYPE_ARRAY = 2, /**< Array object (15.4) */ + ECMA_OBJECT_TYPE_PSEUDO_ARRAY = 3, /**< Array-like object, such as Arguments object (10.6) */ + ECMA_OBJECT_TYPE_PROXY = 4, /**< Proxy object ECMAScript v6 26.2 */ + /* Note: these 4 types must be in this order. See IsCallable operation. */ + ECMA_OBJECT_TYPE_FUNCTION = 5, /**< Function objects (15.3), created through 13.2 routine */ + ECMA_OBJECT_TYPE_BOUND_FUNCTION = 6, /**< Function objects (15.3), created through 15.3.4.5 routine */ + ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION = 7, /**< External (host) function object */ /* Types between 13-15 cannot have a built-in flag. See ecma_lexical_environment_type_t. */ ECMA_OBJECT_TYPE__MAX /**< maximum value */ @@ -641,15 +669,16 @@ typedef enum ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13, /**< declarative lexical environment */ ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 14, /**< object-bound lexical environment * with provideThis flag */ - ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND = 15, /**< object-bound lexical environment - * with provided super reference */ + ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND = 15, /**< object-bound lexical environment + * with provided home object reference */ ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical * environment type */ - ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND /**< maximum value */ + ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND /**< maximum value */ } ecma_lexical_environment_type_t; -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_ES2015) + /** * Types of array iterators. */ @@ -658,35 +687,37 @@ typedef enum ECMA_ITERATOR_KEYS, /**< List only key indices */ ECMA_ITERATOR_VALUES, /**< List only key values */ ECMA_ITERATOR_KEYS_VALUES, /**< List key indices and values */ -} ecma_iterator_type_t; -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ +} ecma_array_iterator_type_t; + +#endif /* ENABLED (JERRY_ES2015) */ /** * Offset for JERRY_CONTEXT (status_flags) top 8 bits. */ -#define ECMA_SUPER_EVAL_OPTS_OFFSET (32 - 8) +#define ECMA_LOCAL_PARSE_OPTS_OFFSET ((sizeof (uint32_t) - sizeof (uint8_t)) * JERRY_BITSINBYTE) /** * Set JERRY_CONTEXT (status_flags) top 8 bits to the specified 'opts'. */ -#define ECMA_SET_SUPER_EVAL_PARSER_OPTS(opts) \ +#define ECMA_SET_LOCAL_PARSE_OPTS(opts) \ do \ { \ - JERRY_CONTEXT (status_flags) |= ((uint32_t) opts << ECMA_SUPER_EVAL_OPTS_OFFSET) | ECMA_STATUS_DIRECT_EVAL; \ + JERRY_CONTEXT (status_flags) |= ((uint32_t) opts << ECMA_LOCAL_PARSE_OPTS_OFFSET) | ECMA_STATUS_DIRECT_EVAL; \ } while (0) /** * Get JERRY_CONTEXT (status_flags) top 8 bits. */ -#define ECMA_GET_SUPER_EVAL_PARSER_OPTS() (JERRY_CONTEXT (status_flags) >> ECMA_SUPER_EVAL_OPTS_OFFSET) +#define ECMA_GET_LOCAL_PARSE_OPTS() \ + (JERRY_CONTEXT (status_flags) >> (ECMA_LOCAL_PARSE_OPTS_OFFSET - JERRY_LOG2 (ECMA_PARSE_ALLOW_SUPER))) /** * Clear JERRY_CONTEXT (status_flags) top 8 bits. */ -#define ECMA_CLEAR_SUPER_EVAL_PARSER_OPTS() \ +#define ECMA_CLEAR_LOCAL_PARSE_OPTS() \ do \ { \ - JERRY_CONTEXT (status_flags) &= ((1 << ECMA_SUPER_EVAL_OPTS_OFFSET) - 1); \ + JERRY_CONTEXT (status_flags) &= ((1 << ECMA_LOCAL_PARSE_OPTS_OFFSET) - 1); \ } while (0) /** @@ -709,19 +740,32 @@ typedef enum /** * Non closure flag for debugger. */ -#if ENABLED (JERRY_DEBUGGER) -#define ECMA_OBJECT_FLAG_NON_CLOSURE 0x20 -#endif /* ENABLED (JERRY_DEBUGGER) */ +#define ECMA_OBJECT_FLAG_BLOCK ECMA_OBJECT_FLAG_EXTENSIBLE + +/** + * Bitshift index for an ecma-object reference count field + */ +#define ECMA_OBJECT_REF_SHIFT 6 + +/** + * Bitmask for an ecma-object reference count field + */ +#define ECMA_OBJECT_REF_MASK (((1u << 10) - 1) << ECMA_OBJECT_REF_SHIFT) /** * Value for increasing or decreasing the object reference counter. */ -#define ECMA_OBJECT_REF_ONE (1u << 6) +#define ECMA_OBJECT_REF_ONE (1u << ECMA_OBJECT_REF_SHIFT) /** - * Maximum value of the object reference counter (1023). + * Represents non-visited white object */ -#define ECMA_OBJECT_MAX_REF (0x3ffu << 6) +#define ECMA_OBJECT_NON_VISITED (0x3ffu << ECMA_OBJECT_REF_SHIFT) + +/** + * Maximum value of the object reference counter (1022). + */ +#define ECMA_OBJECT_MAX_REF (ECMA_OBJECT_NON_VISITED - ECMA_OBJECT_REF_ONE) /** * Description of ECMA-object or lexical environment @@ -732,8 +776,8 @@ typedef struct /** type : 4 bit : ecma_object_type_t or ecma_lexical_environment_type_t depending on ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV flags : 2 bit : ECMA_OBJECT_FLAG_BUILT_IN_OR_LEXICAL_ENV, - ECMA_OBJECT_FLAG_EXTENSIBLE or ECMA_OBJECT_FLAG_NON_CLOSURE - refs : 10 bit (max 1023) */ + ECMA_OBJECT_FLAG_EXTENSIBLE or ECMA_OBJECT_FLAG_BLOCK + refs : 10 bit (max 1022) */ uint16_t type_flags_refs; /** next in the object chain maintained by the garbage collector */ @@ -743,8 +787,9 @@ typedef struct union { jmem_cpointer_t property_list_cp; /**< compressed pointer to object's - * or declerative lexical environments's property list */ + * or declerative lexical environments's property list */ jmem_cpointer_t bound_object_cp; /**< compressed pointer to lexical environments's the bound object */ + jmem_cpointer_t home_object_cp; /**< compressed pointer to lexical environments's the home object */ } u1; /** object prototype or outer reference */ @@ -764,7 +809,15 @@ typedef struct uint8_t length_and_bitset_size; /**< length for built-in functions and * bit set size for all built-ins */ uint16_t routine_id; /**< routine id for built-in functions */ - uint32_t instantiated_bitset[1]; /**< bit set for instantiated properties */ + union + { + uint32_t instantiated_bitset[1]; /**< bit set for instantiated properties */ + struct + { + uint16_t name; /**< name of the built-in functions */ + uint16_t bitset; /**< bit set for instantiated properties of builtin functions */ + } builtin_routine; + } u; } ecma_built_in_props_t; /** @@ -804,6 +857,7 @@ typedef struct { ecma_value_t value; /**< value of the object (e.g. boolean, number, string, etc.) */ uint32_t length; /**< length related property (e.g. length of ArrayBuffer) */ + ecma_value_t target; /**< [[ProxyTarget]] internal property */ } u; } class_prop; @@ -812,7 +866,7 @@ typedef struct */ struct { - ecma_value_t scope_cp; /**< function scope */ + jmem_cpointer_tag_t scope_cp; /**< function scope */ ecma_value_t bytecode_cp; /**< function byte code */ } function; @@ -822,10 +876,13 @@ typedef struct struct { uint32_t length; /**< length property value */ - ecma_property_t length_prop; /**< length property */ - bool is_fast_mode; /**< true - if the array is a fast access mode array - * false - otherwise */ - uint8_t hole_count; /**< Number of array holes in a fast access mode array */ + union + { + ecma_property_t length_prop; /**< length property */ + uint32_t hole_count; /**< number of array holes in a fast access mode array + * multiplied ECMA_FAST_ACCESS_HOLE_ONE */ + } u; + } array; /** @@ -848,6 +905,7 @@ typedef struct ecma_value_t lex_env_cp; /**< for arguments: lexical environment */ ecma_value_t arraybuffer; /**< for typedarray: internal arraybuffer */ ecma_value_t iterated_value; /**< for %Iterator%: [[IteratedObject]] property */ + ecma_value_t spread_value; /**< for spread object: spreaded element */ } u2; } pseudo_array; @@ -856,7 +914,7 @@ typedef struct */ struct { - ecma_value_t target_function; /**< target function */ + jmem_cpointer_tag_t target_function; /**< target function */ ecma_value_t args_len_or_this; /**< length of arguments or this value */ } bound_function; @@ -885,7 +943,6 @@ typedef struct #define ECMA_FAST_ARRAY_ALIGN_LENGTH(length) \ (uint32_t) ((((length)) + ECMA_FAST_ARRAY_ALIGNMENT - 1) / ECMA_FAST_ARRAY_ALIGNMENT * ECMA_FAST_ARRAY_ALIGNMENT) - /** * Compiled byte code data. */ @@ -900,6 +957,17 @@ typedef struct * If regexp, the other flags must be RE_FLAG... */ } ecma_compiled_code_t; +/** + * Description of bound function objects. + */ +typedef struct +{ + ecma_extended_object_t header; /**< extended object header */ +#if ENABLED (JERRY_ES2015) + ecma_integer_value_t target_length; /**< length of target function */ +#endif /* ENABLED (JERRY_ES2015) */ +} ecma_bound_function_t; + #if ENABLED (JERRY_SNAPSHOT_EXEC) /** @@ -913,17 +981,16 @@ typedef struct #endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) +#if ENABLED (JERRY_ES2015) /** * Description of arrow function objects. */ typedef struct { - ecma_object_t object; /**< object header */ + ecma_extended_object_t header; /**< extended object header */ ecma_value_t this_binding; /**< value of 'this' binding */ - jmem_cpointer_t scope_cp; /**< function scope */ - jmem_cpointer_t bytecode_cp; /**< function byte code */ + ecma_value_t new_target; /**< value of new.target */ } ecma_arrow_function_t; #if ENABLED (JERRY_SNAPSHOT_EXEC) @@ -939,18 +1006,62 @@ typedef struct #endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */ -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ +#endif /* ENABLED (JERRY_ES2015) */ + +#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) +/** + * Flags for container objects + */ +typedef enum +{ + ECMA_CONTAINER_FLAGS_EMPTY = (0), /** empty flags */ + ECMA_CONTAINER_FLAGS_WEAK = (1 << 0) /** container object is weak */ +} ecma_container_flags_t; -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) /** - * Description of Map/Set objects. + * Description of map collection. */ typedef struct { - ecma_extended_object_t header; /**< header part */ - uint32_t size; /**< size of the map object */ -} ecma_map_object_t; -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) */ + ecma_value_t key; /**< key value */ + ecma_value_t value; /**< value of the key */ +} ecma_container_pair_t; + +/** + * Size of a single element (in ecma_value_t unit). + */ +#define ECMA_CONTAINER_VALUE_SIZE 1 + +/** + * Size of a key - value pair (in ecma_value_t unit). + */ +#define ECMA_CONTAINER_PAIR_SIZE 2 + +/** + * Size of the internal buffer. + */ +#define ECMA_CONTAINER_GET_SIZE(container_p) \ + (container_p->buffer_p[0]) + +/** + * Remove the size field of the internal buffer. + */ +#define ECMA_CONTAINER_SET_SIZE(container_p, size) \ + (container_p->buffer_p[0] = (ecma_value_t) (size)) + +/** + * Number of entries of the internal buffer. + */ +#define ECMA_CONTAINER_ENTRY_COUNT(collection_p) \ + (collection_p->item_count - 1) + +/** + * Pointer to the first entry of the internal buffer. + */ +#define ECMA_CONTAINER_START(collection_p) \ + (collection_p->buffer_p + 1) + +#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */ typedef enum { @@ -1148,6 +1259,26 @@ typedef union * See also: ECMA_262 v5, 15.7.3.2 */ # define ECMA_NUMBER_MAX_VALUE (FLT_MAX) +/** + * Number.EPSILON + * + * See also: ECMA_262 v6, 20.1.2.1 + */ +# define ECMA_NUMBER_EPSILON ((ecma_number_t) 1.1920928955078125e-7) + +/** + * Number.MAX_SAFE_INTEGER + * + * See also: ECMA_262 v6, 20.1.2.6 + */ +# define ECMA_NUMBER_MAX_SAFE_INTEGER ((ecma_number_t) 0xFFFFFF) + +/** + * Number.MIN_SAFE_INTEGER + * + * See also: ECMA_262 v6, 20.1.2.8 + */ +# define ECMA_NUMBER_MIN_SAFE_INTEGER ((ecma_number_t) -0xFFFFFF) #elif ENABLED (JERRY_NUMBER_TYPE_FLOAT64) /** * Number.MAX_VALUE (i.e., the maximum value of ecma-number) @@ -1155,29 +1286,36 @@ typedef union * See also: ECMA_262 v5, 15.7.3.2 */ # define ECMA_NUMBER_MAX_VALUE ((ecma_number_t) 1.7976931348623157e+308) + /** * Number.MIN_VALUE (i.e., the smallest positive value of ecma-number) * * See also: ECMA_262 v5, 15.7.3.3 */ # define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324) -#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -#if ENABLED (JERRY_ES2015_BUILTIN) + /** * Number.EPSILON * * See also: ECMA_262 v6, 20.1.2.1 */ # define ECMA_NUMBER_EPSILON ((ecma_number_t) 2.2204460492503130808472633361816e-16) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ -#if ENABLED (JERRY_ES2015_BUILTIN) + /** * Number.MAX_SAFE_INTEGER * - * See also: ECMA_262 v6, 20.1.2.1 + * See also: ECMA_262 v6, 20.1.2.6 */ # define ECMA_NUMBER_MAX_SAFE_INTEGER ((ecma_number_t) 0x1FFFFFFFFFFFFF) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ + +/** + * Number.MIN_SAFE_INTEGER + * + * See also: ECMA_262 v6, 20.1.2.8 + */ +# define ECMA_NUMBER_MIN_SAFE_INTEGER ((ecma_number_t) -0x1FFFFFFFFFFFFF) +#endif /* !ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ + /** * Euler number */ @@ -1363,9 +1501,7 @@ typedef enum ECMA_STRING_CONTAINER_SYMBOL, /**< the ecma-string is a symbol */ - ECMA_STRING_CONTAINER_MAP_KEY, /**< the ecma-string is a map key string */ - - ECMA_STRING_CONTAINER__MAX = ECMA_STRING_CONTAINER_MAP_KEY /**< maximum value */ + ECMA_STRING_CONTAINER__MAX = ECMA_STRING_CONTAINER_SYMBOL /**< maximum value */ } ecma_string_container_t; /** @@ -1622,12 +1758,12 @@ typedef struct /** * Function callback descriptor of a %TypedArray% object getter */ -typedef ecma_number_t (*ecma_typedarray_getter_fn_t)(lit_utf8_byte_t *src); +typedef ecma_number_t (*ecma_typedarray_getter_fn_t) (lit_utf8_byte_t *src); /** * Function callback descriptor of a %TypedArray% object setter */ -typedef void (*ecma_typedarray_setter_fn_t)(lit_utf8_byte_t *src, ecma_number_t value); +typedef void (*ecma_typedarray_setter_fn_t) (lit_utf8_byte_t *src, ecma_number_t value); /** * Builtin id for the different types of TypedArray's @@ -1703,6 +1839,27 @@ typedef struct #endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ +#if ENABLED (JERRY_ES2015) + +/** + * Executable (e.g. generator, async) object flags. + */ +typedef enum +{ + ECMA_EXECUTABLE_OBJECT_COMPLETED = (1u << 0), /**< executable object is completed and cannot be resumed */ + ECMA_EXECUTABLE_OBJECT_RUNNING = (1u << 1), /**< executable object is currently running */ + /* Generator specific flags. */ + ECMA_GENERATOR_ITERATE_AND_YIELD = (1u << 2), /**< the generator performs a yield* operation */ +} ecma_executable_object_flags_t; + +/** + * Checks whether the executable object is waiting for resuming. + */ +#define ECMA_EXECUTABLE_OBJECT_IS_SUSPENDED(extra_info) \ + (!((extra_info) & (ECMA_EXECUTABLE_OBJECT_COMPLETED | ECMA_EXECUTABLE_OBJECT_RUNNING))) + +#endif /* ENABLED (JERRY_ES2015) */ + #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) /** * Description of DataView objects. @@ -1735,6 +1892,23 @@ typedef struct #define ECMA_SYMBOL_HASH_SHIFT 2 #if (JERRY_STACK_LIMIT != 0) +/** + * Set the jerry context stack limit for IAR. + */ +#define JERRY_IAR_MEM_STACK_LIMIT (4480) // > 4136b, 3500; < 4.5 * 1024 = 4608 + +/** + * Check the current jerry context stack usage. + */ +#define CHECK_JERRY_STACK_USAGE(context_p) \ +do \ +{ \ + if (ecma_get_current_stack_usage () > JERRY_IAR_MEM_STACK_LIMIT) \ + { \ + parser_raise_error (context_p, PARSER_ERR_JERRY_STACK_LIMIT_REACHED); \ + } \ +} while (0) + /** * Check the current stack usage. If the limit is reached a RangeError is raised. */ @@ -1751,8 +1925,35 @@ do \ * If the stack limit is unlimited, this check is an empty macro. */ #define ECMA_CHECK_STACK_USAGE() +#define CHECK_JERRY_STACK_USAGE(context_p) #endif /* (JERRY_STACK_LIMIT != 0) */ +/** + * Invalid object pointer which represents abrupt completion + */ +#define ECMA_OBJECT_POINTER_ERROR ((ecma_object_t *) 0x01) + +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) +/** + * Description of Proxy objects. + */ +typedef struct +{ + ecma_object_t header; /**< header part */ + ecma_value_t target; /**< [[ProxyTarget]] internal slot */ + ecma_value_t handler; /**< [[ProxyHandler]] internal slot */ +} ecma_proxy_object_t; + +/** + * Description of Proxy objects. + */ +typedef struct +{ + ecma_extended_object_t header; /**< header part */ + ecma_value_t proxy; /**< [[RevocableProxy]] internal slot */ +} ecma_revocable_proxy_object_t; +#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */ + /** * @} * @} diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-compiler.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-compiler.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-compiler.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-compiler.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-core.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-core.h similarity index 89% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-core.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-core.h index c732d970c..a5c71197c 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-core.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-core.h @@ -39,7 +39,7 @@ extern "C" /** * Minor version of JerryScript API. */ -#define JERRY_API_MINOR_VERSION 1 +#define JERRY_API_MINOR_VERSION 3 /** * Patch version of JerryScript API. @@ -99,6 +99,11 @@ typedef enum JERRY_FEATURE_LOGGING, /**< logging */ JERRY_FEATURE_SYMBOL, /**< symbol support */ JERRY_FEATURE_DATAVIEW, /**< DataView support */ + JERRY_FEATURE_PROXY, /**< Proxy support */ + JERRY_FEATURE_MAP, /**< Map support */ + JERRY_FEATURE_SET, /**< Set support */ + JERRY_FEATURE_WEAKMAP, /**< WeakMap support */ + JERRY_FEATURE_WEAKSET, /**< WeakSet support */ JERRY_FEATURE__COUNT /**< number of features. NOTE: must be at the end of the list */ } jerry_feature_t; @@ -327,6 +332,11 @@ typedef enum JERRY_BIN_OP_GREATER, /**< greater relation (>) */ JERRY_BIN_OP_GREATER_EQUAL, /**< greater or equal relation (>=)*/ JERRY_BIN_OP_INSTANCEOF, /**< instanceof operation */ + JERRY_BIN_OP_ADD, /**< addition operator (+) */ + JERRY_BIN_OP_SUB, /**< subtraction operator (-) */ + JERRY_BIN_OP_MUL, /**< multiplication operator (*) */ + JERRY_BIN_OP_DIV, /**< division operator (/) */ + JERRY_BIN_OP_REM, /**< remainder operator (%) */ } jerry_binary_operation_t; /** @@ -380,6 +390,7 @@ bool jerry_value_is_number (const jerry_value_t value); bool jerry_value_is_null (const jerry_value_t value); bool jerry_value_is_object (const jerry_value_t value); bool jerry_value_is_promise (const jerry_value_t value); +bool jerry_value_is_proxy (const jerry_value_t value); bool jerry_value_is_string (const jerry_value_t value); bool jerry_value_is_symbol (const jerry_value_t value); bool jerry_value_is_undefined (const jerry_value_t value); @@ -494,6 +505,7 @@ jerry_value_t jerry_create_number_nan (void); jerry_value_t jerry_create_null (void); jerry_value_t jerry_create_object (void); jerry_value_t jerry_create_promise (void); +jerry_value_t jerry_create_proxy (const jerry_value_t target, const jerry_value_t handler); jerry_value_t jerry_create_regexp (const jerry_char_t *pattern, uint16_t flags); jerry_value_t jerry_create_regexp_sz (const jerry_char_t *pattern, jerry_size_t pattern_size, uint16_t flags); jerry_value_t jerry_create_string_from_utf8 (const jerry_char_t *str_p); @@ -508,15 +520,20 @@ jerry_value_t jerry_create_undefined (void); */ jerry_value_t jerry_has_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); jerry_value_t jerry_has_own_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); +bool jerry_has_internal_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); bool jerry_delete_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); bool jerry_delete_property_by_index (const jerry_value_t obj_val, uint32_t index); +bool jerry_delete_internal_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); jerry_value_t jerry_get_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); jerry_value_t jerry_get_property_by_index (const jerry_value_t obj_val, uint32_t index); +jerry_value_t jerry_get_internal_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val); jerry_value_t jerry_set_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val, const jerry_value_t value_to_set); jerry_value_t jerry_set_property_by_index (const jerry_value_t obj_val, uint32_t index, const jerry_value_t value_to_set); +bool jerry_set_internal_property (const jerry_value_t obj_val, const jerry_value_t prop_name_val, + const jerry_value_t value_to_set); void jerry_init_property_descriptor_fields (jerry_property_descriptor_t *prop_desc_p); jerry_value_t jerry_define_own_property (const jerry_value_t obj_val, @@ -556,10 +573,24 @@ bool jerry_foreach_object_property (const jerry_value_t obj_val, jerry_object_pr void *user_data_p); /** - * Promise resolve/reject functions. + * Promise functions. */ jerry_value_t jerry_resolve_or_reject_promise (jerry_value_t promise, jerry_value_t argument, bool is_resolve); +/** + * Enum values representing various Promise states. + */ +typedef enum +{ + JERRY_PROMISE_STATE_NONE = 0u, /**< Invalid/Unknown state (possibly called on a non-promise object). */ + JERRY_PROMISE_STATE_PENDING, /**< Promise is in "Pending" state. */ + JERRY_PROMISE_STATE_FULFILLED, /**< Promise is in "Fulfilled" state. */ + JERRY_PROMISE_STATE_REJECTED, /**< Promise is in "Rejected" state. */ +} jerry_promise_state_t; + +jerry_value_t jerry_get_promise_result (const jerry_value_t promise); +jerry_promise_state_t jerry_get_promise_state (const jerry_value_t promise); + /** * Symbol functions. */ @@ -587,6 +618,8 @@ jerry_context_t *jerry_create_context (uint32_t heap_size, jerry_context_alloc_t */ void jerry_set_vm_exec_stop_callback (jerry_vm_exec_stop_callback_t stop_cb, void *user_p, uint32_t frequency); jerry_value_t jerry_get_backtrace (uint32_t max_depth); +jerry_value_t jerry_get_resource_name (const jerry_value_t value); +jerry_value_t jerry_get_new_target (void); /** * Array buffer components. @@ -606,6 +639,8 @@ jerry_length_t jerry_arraybuffer_read (const jerry_value_t value, jerry_length_t buf_size); jerry_length_t jerry_get_arraybuffer_byte_length (const jerry_value_t value); uint8_t *jerry_get_arraybuffer_pointer (const jerry_value_t value); +jerry_value_t jerry_is_arraybuffer_detachable (const jerry_value_t value); +jerry_value_t jerry_detach_arraybuffer (const jerry_value_t value); /** * DataView functions. @@ -644,6 +679,17 @@ typedef enum JERRY_TYPEDARRAY_FLOAT64, } jerry_typedarray_type_t; +/** + * Container types. + */ +typedef enum +{ + JERRY_CONTAINER_TYPE_INVALID = 0, /**< Invalid container */ + JERRY_CONTAINER_TYPE_MAP, /**< Map type */ + JERRY_CONTAINER_TYPE_SET, /**< Set type */ + JERRY_CONTAINER_TYPE_WEAKMAP, /**< WeakMap type */ + JERRY_CONTAINER_TYPE_WEAKSET, /**< WeakSet type */ +} jerry_container_type_t; bool jerry_value_is_typedarray (jerry_value_t value); jerry_value_t jerry_create_typedarray (jerry_typedarray_type_t type_name, jerry_length_t length); @@ -660,6 +706,19 @@ jerry_value_t jerry_get_typedarray_buffer (jerry_value_t value, jerry_length_t *byte_length); jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t string_size); jerry_value_t jerry_json_stringify (const jerry_value_t object_to_stringify); +jerry_value_t jerry_create_container (jerry_container_type_t container_type, + const jerry_value_t *arguments_list_p, + jerry_length_t arguments_list_len); +jerry_container_type_t jerry_get_container_type (const jerry_value_t value); + +#if defined(JERRY_HEAPDUMP) +void JerryHeapdumpRun(const char* filepath); +#endif + +#if defined(JERRY_REF_TRACKER) +void JerryRefTrackerStart(const char* filepath); +void JerryRefTrackerStop(void); +#endif /** * @} diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-debugger.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-debugger.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-port.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-port.h similarity index 99% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-port.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-port.h index 9a9e4463e..37609fd4d 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-port.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-port.h @@ -51,6 +51,7 @@ typedef enum ERR_OUT_OF_MEMORY = 10, ERR_REF_COUNT_LIMIT = 12, ERR_DISABLED_BYTE_CODE = 13, + ERR_UNTERMINATED_GC_LOOPS = 14, ERR_FAILED_INTERNAL_ASSERTION = 120 } jerry_fatal_code_t; diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-snapshot.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-snapshot.h similarity index 98% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-snapshot.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-snapshot.h index 12f21315e..1dfbf1219 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-snapshot.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript-snapshot.h @@ -30,7 +30,7 @@ extern "C" /** * Jerry snapshot format version. */ -#define JERRY_SNAPSHOT_VERSION (24u) +#define JERRY_SNAPSHOT_VERSION (49u) /** * Flags for jerry_generate_snapshot and jerry_generate_function_snapshot. diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript.h similarity index 90% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript.h index 041ac7ea3..150eef4f5 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/include/jerryscript.h @@ -20,4 +20,8 @@ #include "jerryscript-debugger.h" #include "jerryscript-snapshot.h" +#ifdef JERRY_IAR_JUPITER +#include "ohos_mem_pool.h" +#endif // JERRY_IAR_JUPITER + #endif /* !JERRYSCRIPT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jmem/jmem.h similarity index 73% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jmem/jmem.h index 18ad2f383..a89f705df 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jmem/jmem.h @@ -40,6 +40,37 @@ */ #define JMEM_ALIGNMENT (1u << JMEM_ALIGNMENT_LOG) +/** + * Pointer value can be directly stored without compression + */ +#if UINTPTR_MAX <= UINT32_MAX +#define JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY +#endif /* UINTPTR_MAX <= UINT32_MAX */ + +/** + * Mask for tag part in jmem_cpointer_tag_t + */ +#define JMEM_TAG_MASK 0x7u + +/** + * Shift for tag part in jmem_cpointer_tag_t + */ +#if defined (JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY) && ENABLED (JERRY_CPOINTER_32_BIT) +#define JMEM_TAG_SHIFT 0 +#else /* !JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY || !ENABLED (JERRY_CPOINTER_32_BIT) */ +#define JMEM_TAG_SHIFT 3 +#endif /* JMEM_CAN_STORE_POINTER_VALUE_DIRECTLY && ENABLED (JERRY_CPOINTER_32_BIT) */ + +/** + * Bit mask for tag part in jmem_cpointer_tag_t + */ +enum +{ + JMEM_FIRST_TAG_BIT_MASK = (1u << 0), /**< first tag bit mask **/ + JMEM_SECOND_TAG_BIT_MASK = (1u << 1), /**< second tag bit mask **/ + JMEM_THIRD_TAG_BIT_MASK = (1u << 2), /**< third tag bit mask **/ +}; + /** * Compressed pointer representations * @@ -69,6 +100,11 @@ typedef uint32_t jmem_cpointer_t; typedef uint16_t jmem_cpointer_t; #endif /* ENABLED (JERRY_CPOINTER_32_BIT) */ +/** + * Compressed pointer with tag value + */ +typedef uint32_t jmem_cpointer_tag_t; + /** * Memory usage pressure for reclaiming unused memory. * @@ -223,6 +259,44 @@ void * JERRY_ATTR_PURE jmem_decompress_pointer (uintptr_t compressed_pointer); } \ } while (false); +/** + * Set value of pointer-tag value so that it will correspond + * to specified non_compressed_pointer along with tag + */ +#define JMEM_CP_SET_NON_NULL_POINTER_TAG(cp_value, pointer, tag) \ + do \ + { \ + JERRY_ASSERT ((uintptr_t) tag < (uintptr_t) (JMEM_ALIGNMENT)); \ + jmem_cpointer_tag_t compressed_ptr = jmem_compress_pointer (pointer); \ + (cp_value) = (jmem_cpointer_tag_t) ((compressed_ptr << JMEM_TAG_SHIFT) | tag); \ + } while (false); + +/** + * Extract value of pointer from specified pointer-tag value + */ +#define JMEM_CP_GET_NON_NULL_POINTER_FROM_POINTER_TAG(type, cp_value) \ + ((type *) (jmem_decompress_pointer ((cp_value & ~JMEM_TAG_MASK) >> JMEM_TAG_SHIFT))) + +/** + * Get value of each tag from specified pointer-tag value + */ +#define JMEM_CP_GET_FIRST_BIT_FROM_POINTER_TAG(cp_value) \ + (cp_value & JMEM_FIRST_TAG_BIT_MASK) /**< get first tag bit **/ +#define JMEM_CP_GET_SECOND_BIT_FROM_POINTER_TAG(cp_value) \ + (cp_value & JMEM_SECOND_TAG_BIT_MASK) /**< get second tag bit **/ +#define JMEM_CP_GET_THIRD_BIT_FROM_POINTER_TAG(cp_value) \ + (cp_value & JMEM_THIRD_TAG_BIT_MASK) /**< get third tag bit **/ + +/** + * Set value of each tag to specified pointer-tag value + */ +#define JMEM_CP_SET_FIRST_BIT_TO_POINTER_TAG(cp_value) \ + (cp_value) = (cp_value | JMEM_FIRST_TAG_BIT_MASK) /**< set first tag bit **/ +#define JMEM_CP_SET_SECOND_BIT_TO_POINTER_TAG(cp_value) \ + (cp_value) = (cp_value | JMEM_SECOND_TAG_BIT_MASK) /**< set second tag bit **/ +#define JMEM_CP_SET_THIRD_BIT_TO_POINTER_TAG(cp_value) \ + (cp_value) = (cp_value | JMEM_THIRD_TAG_BIT_MASK) /**< set third tag bit **/ + /** * @} * \addtogroup poolman Memory pool manager diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-types.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jrt/jrt-types.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-types.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jrt/jrt-types.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jrt/jrt.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/jrt/jrt.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-globals.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-globals.h similarity index 100% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-globals.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-globals.h diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.h similarity index 92% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.h index faf636b40..1ab61aa28 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.h @@ -41,13 +41,15 @@ typedef enum LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_RESOLVE, /**< [[Resolve]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_REJECT, /**< [[Reject]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_CAPABILITY, /**< [[Capability]] property */ - LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_HANDLER, /**< [[Handler]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_ALREADY_CALLED, /**< [[AlreadyCalled]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_INDEX, /**< [[Index]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_VALUE, /**< [[Values]] property */ LIT_INTERNAL_MAGIC_STRING_PROMISE_PROPERTY_REMAINING_ELEMENT, /**< [[RemainingElement]] property */ LIT_INTERNAL_MAGIC_STRING_ITERATOR_NEXT_INDEX, /**< [[%Iterator%NextIndex]] property */ LIT_INTERNAL_MAGIC_STRING_MAP_KEY, /**< Property key used when an object is a key in a map object */ + LIT_INTERNAL_MAGIC_API_INTERNAL, /**< Property key used to add non-visible JS properties from the public API */ + LIT_INTERNAL_MAGIC_STRING_ARRAY_PROTOTYPE_VALUES, /**< %ArrayProto_values% intrinsic routine */ + LIT_INTERNAL_MAGIC_THIS_BINDING_VALUE, /**< FunctionEnvironmentRecord [[ThisBindingValue]] internal slot */ /* List of well known symbols */ LIT_GLOBAL_SYMBOL_HAS_INSTANCE, /**< @@hasInstance well known symbol */ LIT_GLOBAL_SYMBOL_IS_CONCAT_SPREADABLE, /**< @@isConcatSpreadable well known symbol */ @@ -68,7 +70,8 @@ typedef enum LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER, /**< native pointer info associated with an object */ LIT_FIRST_INTERNAL_MAGIC_STRING = LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER, /**< first index of internal * magic strings */ - LIT_INTERNAL_MAGIC_STRING_CLASS_THIS_BINDING, /**< the this binding of the class constructor */ + LIT_INTERNAL_MAGIC_STRING_WEAK_REFS, /**< Weak references to the current object */ + LIT_INTERNAL_MAGIC_STRING_INTERNAL_OBJECT, /**< Internal object ID for internal properties */ LIT_MAGIC_STRING__COUNT /**< number of magic strings */ } lit_magic_string_id_t; diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.inc.h similarity index 81% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.inc.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.inc.h index be61e7810..5c8b6c4fc 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-magic-strings.inc.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-core/lit/lit-magic-strings.inc.h @@ -16,17 +16,15 @@ /* This file is automatically generated by the gen-magic-strings.py script * from lit-magic-strings.ini. Do not edit! */ - LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__EMPTY, "") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPACE_CHAR, " ") -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_PAREN, ")") -#endif #if ENABLED (JERRY_ES2015_MODULE_SYSTEM) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASTERIX_CHAR, "*") #endif +#if ENABLED (JERRY_BUILTIN_ARRAY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMMA_CHAR, ",") -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COLON_CHAR, ":") +#endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_E_U, "E") #endif @@ -35,18 +33,22 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RIGHT_SQUARE_CHAR, "]") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PI_U, "PI") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS, "is") +#endif +#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OF, "of") #endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LN2_U, "LN2") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) +#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_MAP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAP_UL, "Map") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAN, "NaN") -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) \ +#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ || ENABLED (JERRY_ES2015_BUILTIN_SET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UL, "Set") #endif @@ -56,7 +58,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UTC_U, "UTC") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ABS, "abs") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SET) +#if ENABLED (JERRY_ES2015) && ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_SET) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ADD, "add") #endif #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) @@ -66,12 +70,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ALL, "all") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COS, "cos") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXP, "exp") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FOR, "for") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET, "get") #if ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SET) +|| ENABLED (JERRY_ES2015_BUILTIN_PROXY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_REFLECT) \ +|| ENABLED (JERRY_ES2015_BUILTIN_SET) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS, "has") #endif #if ENABLED (JERRY_BUILTIN_MATH) @@ -94,6 +102,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POP, "pop") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POW, "pow") #endif +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RAW, "raw") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET, "set") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIN, "sin") @@ -118,33 +129,44 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN, "atan") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BIND, "bind") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CALL, "call") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CBRT, "cbrt") +#endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CEIL, "ceil") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COSH, "cosh") +#endif +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DONE, "done") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL, "eval") #if ENABLED (JERRY_BUILTIN_REGEXP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXEC, "exec") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILL, "fill") -#endif -#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015_BUILTIN) \ +#if ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILL, "fill") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FIND, "find") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM, "from") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IMUL, "imul") +#endif #if ENABLED (JERRY_BUILTIN_ARRAY) \ || ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_JOIN, "join") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_KEYS, "keys") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG2, "log2") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NAME, "name") -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ +#if ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_MAP) \ || ENABLED (JERRY_ES2015_BUILTIN_SET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEXT, "next") @@ -157,8 +179,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PUSH, "push") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RACE, "race") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEAL, "seal") -#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SIGN, "sign") +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SINH, "sinh") #endif #if ENABLED (JERRY_ES2015_BUILTIN_MAP) \ || ENABLED (JERRY_ES2015_BUILTIN_SET) @@ -172,6 +195,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SORT, "sort") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT, "sqrt") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TANH, "tanh") +#endif #if ENABLED (JERRY_BUILTIN_REGEXP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TEST, "test") #endif @@ -186,12 +212,26 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_UL, "Array") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ERROR_UL, "Error") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG2E_U, "LOG2E") +#endif +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROXY_UL, "Proxy") +#endif +#if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT2_U, "SQRT2") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ACOSH, "acosh") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_APPLY, "apply") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASINH, "asinh") +#endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATAN2, "atan2") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ATANH, "atanh") +#endif #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CATCH, "catch") #endif @@ -199,10 +239,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CATCH, "catch") || ENABLED (JERRY_ES2015_BUILTIN_SET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CLEAR, "clear") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CLZ32, "clz32") +#endif #if ENABLED (JERRY_BUILTIN_ARRAY) \ || ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVERY, "every") #endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EXPM1, "expm1") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FALSE, "false") #if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLAGS, "flags") @@ -210,22 +256,29 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLAGS, "flags") #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOOR, "floor") #endif -#if ENABLED (JERRY_BUILTIN_REGEXP) \ -|| ENABLED (JERRY_BUILTIN_STRING) -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX, "index") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HYPOT, "hypot") #endif #if ENABLED (JERRY_BUILTIN_REGEXP) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX, "index") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INPUT, "input") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_NAN, "isNaN") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG10, "log10") +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LOG1P, "log1p") +#endif #if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_BUILTIN_STRING) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +|| ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MATCH, "match") #endif #if ENABLED (JERRY_BUILTIN_DATE) \ || ENABLED (JERRY_BUILTIN_JSON) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE, "parse") #endif +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROXY, "proxy") +#endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ROUND, "round") #endif @@ -238,10 +291,13 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SHIFT, "shift") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SLICE, "slice") #endif #if ENABLED (JERRY_BUILTIN_STRING) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +|| ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLIT, "split") #endif -#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_THROW, "throw") +#endif +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TRUNC, "trunc") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUE, "value") @@ -255,10 +311,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NUMBER_UL, "Number") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OBJECT_UL, "Object") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REGEXP_UL, "RegExp") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING_UL, "String") -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL_UL, "Symbol") -#endif -#if ENABLED (JERRY_ES2015_BUILTIN) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ASSIGN, "assign") #endif #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) \ @@ -276,7 +330,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONCAT, "concat") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CREATE, "create") #if ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SET) +|| ENABLED (JERRY_ES2015_BUILTIN_SET) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DELETE, "delete") #endif #if ENABLED (JERRY_BUILTIN_ANNEXB) @@ -287,19 +343,19 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ESCAPE, "escape") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FILTER, "filter") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FREEZE, "freeze") +#if ENABLED (JERRY_BUILTIN_MATH) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROUND, "fround") +#endif #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_DAY_UL, "getDay") #endif -#if !ENABLED (JERRY_ES2015) && ENABLED (JERRY_BUILTIN_REGEXP) \ -|| ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_BUILTIN_STRING) \ -|| ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_ES2015) \ -|| ENABLED (JERRY_BUILTIN_REGEXP) && !( ENABLED (JERRY_ES2015)) +#if ENABLED (JERRY_BUILTIN_REGEXP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GLOBAL, "global") #endif #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_VIEW_UL, "isView") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_KEY_FOR, "keyFor") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LENGTH, "length") @@ -315,11 +371,17 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REDUCE, "reduce") #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REJECT, "reject") #endif -#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPEAT, "repeat") #endif +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RETURN, "return") +#endif +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REVOKE, "revoke") +#endif #if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_BUILTIN_STRING) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +|| ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SEARCH, "search") #endif #if !ENABLED (JERRY_ES2015) && ENABLED (JERRY_BUILTIN_REGEXP) \ @@ -330,45 +392,55 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SOURCE, "source") #if ENABLED (JERRY_BUILTIN_ARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPLICE, "splice") #endif +#if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_BUILTIN_REGEXP) && !( !ENABLED (JERRY_ES2015)) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STICKY, "sticky") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING, "string") #if ENABLED (JERRY_BUILTIN_ANNEXB) && ENABLED (JERRY_BUILTIN_STRING) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SUBSTR, "substr") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_PROMISE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL, "symbol") #endif #if ENABLED (JERRY_BUILTIN_DATE) \ || ENABLED (JERRY_BUILTIN_JSON) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_JSON_UL, "toJSON") #endif -#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_SET) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_VALUES, "values") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN_UL, "Boolean") +#if ENABLED (JERRY_BUILTIN_NUMBER) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EPSILON_U, "EPSILON") +#endif #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROMISE_UL, "Promise") #endif +#if ENABLED (JERRY_ES2015_BUILTIN_REFLECT) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REFLECT_UL, "Reflect") +#endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SQRT1_2_U, "SQRT1_2") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL_LEFT_PAREN_UL, "Symbol(") -LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYMBOL_DOT_UL, "Symbol.") +#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_WEAKMAP_UL, "WeakMap") +#endif +#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_WEAKSET_UL, "WeakSet") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BOOLEAN, "boolean") #if ENABLED (JERRY_BUILTIN_ANNEXB) && ENABLED (JERRY_BUILTIN_REGEXP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COMPILE, "compile") #endif -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) +#if ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_MODULE_SYSTEM) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFAULT, "default") #endif -#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_SET) \ -|| ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) && ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENTRIES, "entries") #endif #if ENABLED (JERRY_BUILTIN_ARRAY) \ @@ -398,8 +470,12 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INDEX_OF_UL, "indexOf") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_ARRAY_UL, "isArray") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MESSAGE, "message") +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_REFLECT) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_OWN_KEYS_UL, "ownKeys") +#endif #if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_BUILTIN_STRING) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +|| ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPLACE, "replace") #endif #if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) @@ -421,12 +497,15 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_TIME_UL, "setTime") #if ENABLED (JERRY_BUILTIN_ANNEXB) && ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_YEAR_UL, "setYear") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPECIES, "species") #endif #if ENABLED (JERRY_BUILTIN_NUMBER) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_FIXED_UL, "toFixed") #endif +#if ENABLED (JERRY_BUILTIN_REGEXP) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNICODE, "unicode") +#endif #if ENABLED (JERRY_BUILTIN_ARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSHIFT, "unshift") #endif @@ -439,7 +518,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INFINITY_UL, "Infinity") #if ENABLED (JERRY_BUILTIN_ERRORS) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_URI_ERROR_UL, "URIError") #endif -#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENDS_WITH, "endsWith") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FUNCTION, "function") @@ -456,17 +535,19 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MONTH_UL, "getMonth") #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT8_UL, "getUint8") #endif -#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INCLUDES, "includes") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FINITE, "isFinite") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_FROZEN_UL, "isFrozen") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_SEALED_UL, "isSealed") -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ -|| ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ITERATOR, "iterator") #endif +#if ENABLED (JERRY_ES2015) \ +|| !( ENABLED (JERRY_ES2015)) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_INT, "parseInt") +#endif #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_HOURS_UL, "setHours") #endif @@ -493,6 +574,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS_UL, "Arguments") #if ENABLED (JERRY_BUILTIN_ERRORS) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_EVAL_ERROR_UL, "EvalError") #endif +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GENERATOR_UL, "Generator") +#endif #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INT8_ARRAY_UL, "Int8Array") #endif @@ -504,10 +588,15 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MIN_VALUE_U, "MIN_VALUE") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TYPE_ERROR_UL, "TypeError") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNDEFINED_UL, "Undefined") +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__PROTO__, "__proto__") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARGUMENTS, "arguments") +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_REFLECT) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCT, "construct") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DECODE_URI, "decodeURI") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI, "encodeURI") -#if ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015_BUILTIN) \ +#if ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FIND_INDEX, "findIndex") #endif @@ -518,7 +607,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DAY_UL, "getUTCDay") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT16_UL, "getUint16") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UINT32_UL, "getUint32") #endif -#if ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_INTEGER, "isInteger") #endif #if ENABLED (JERRY_BUILTIN_REGEXP) @@ -530,6 +619,9 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_LASTINDEX_UL, "lastIndex") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MULTILINE, "multiline") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROTOTYPE, "prototype") +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REVOCABLE, "revocable") +#endif #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UINT16_UL, "setUint16") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UINT32_UL, "setUint32") @@ -560,7 +652,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTE_OFFSET_UL, "byteOffset") #if ENABLED (JERRY_BUILTIN_STRING) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, "charCodeAt") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#if ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COPY_WITHIN, "copyWithin") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENUMERABLE, "enumerable") @@ -580,7 +673,10 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_DATE_UL, "getUTCDate") || ENABLED (JERRY_BUILTIN_REGEXP) && !( ENABLED (JERRY_ES2015)) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IGNORECASE_UL, "ignoreCase") #endif +#if ENABLED (JERRY_ES2015) \ +|| !( ENABLED (JERRY_ES2015)) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PARSE_FLOAT, "parseFloat") +#endif #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_FLOAT_32_UL, "setFloat32") #endif @@ -592,12 +688,10 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MINUTES_UL, "setMinutes") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_SECONDS_UL, "setSeconds") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_DATE_UL, "setUTCDate") #endif -#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STARTS_WITH, "startsWith") #endif -#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_RESOURCE_ANON, "") -#endif #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) \ || ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_BUFFER_UL, "ArrayBuffer") @@ -609,13 +703,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SYNTAX_ERROR_UL, "SyntaxError") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT16_ARRAY_UL, "Uint16Array") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UINT32_ARRAY_UL, "Uint32Array") #endif +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CODE_POINT_AT, "codePointAt") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_CONSTRUCTOR, "constructor") #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FULL_YEAR_UL, "getFullYear") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_HOURS_UL, "getUTCHours") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MONTH_UL, "getUTCMonth") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_INSTANCE, "hasInstance") #endif #if ENABLED (JERRY_BUILTIN_ARRAY) \ @@ -644,7 +741,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOWER_CASE_UL, "toLowerCase") #if ENABLED (JERRY_BUILTIN_NUMBER) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_PRECISION_UL, "toPrecision") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_PRIMITIVE, "toPrimitive") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_STRING_TAG, "toStringTag") #endif @@ -654,7 +751,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UTC_STRING_UL, "toUTCString") #if ENABLED (JERRY_BUILTIN_STRING) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, "toUpperCase") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSCOPABLES, "unscopables") #endif #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) @@ -666,11 +763,11 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, "Float64Array") #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INVALID_DATE_UL, "Invalid Date") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ +#if ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_MAP) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAP_ITERATOR_UL, "Map Iterator") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ +#if ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_SET) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_ITERATOR_UL, "Set Iterator") #endif @@ -682,11 +779,16 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_EXTENSIBLE, "isExtensible") #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_DATE_STRING_UL, "toDateString") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_TIME_STRING_UL, "toTimeString") +#endif +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FROM_CODE_POINT_UL, "fromCodePoint") +#endif +#if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MINUTES_UL, "getUTCMinutes") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_SECONDS_UL, "getUTCSeconds") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, "isPrototypeOf") -#if ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_SAFE_INTEGER, "isSafeInteger") #endif #if ENABLED (JERRY_BUILTIN_STRING) @@ -699,36 +801,49 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_SECONDS_UL, "setUTCSeconds") #if ENABLED (JERRY_BUILTIN_NUMBER) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, "toExponential") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, "Array Iterator") #endif #if ENABLED (JERRY_BUILTIN_ERRORS) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REFERENCE_ERROR_UL, "ReferenceError") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, "defineProperty") +#if ENABLED (JERRY_ES2015_BUILTIN_PROXY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_REFLECT) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DELETE_PROPERTY_UL, "deleteProperty") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, "getPrototypeOf") #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL, "getUTCFullYear") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, "hasOwnProperty") -#if ENABLED (JERRY_ES2015_BUILTIN) +#if ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_PROXY) \ +|| ENABLED (JERRY_ES2015_BUILTIN_REFLECT) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, "setPrototypeOf") #endif #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, "setUTCFullYear") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, "toLocaleString") -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_STRING_ITERATOR_UL, "String Iterator") #endif #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MILLISECONDS_UL, "getMilliseconds") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MILLISECONDS_UL, "setMilliseconds") #endif +#if ENABLED (JERRY_BUILTIN_NUMBER) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U, "MAX_SAFE_INTEGER") +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_MIN_SAFE_INTEGER_U, "MIN_SAFE_INTEGER") +#endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, "defineProperties") #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, "BYTES_PER_ELEMENT") #endif +#if ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL, "GeneratorFunction") +#endif #if ENABLED (JERRY_BUILTIN_NUMBER) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, "NEGATIVE_INFINITY") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, "POSITIVE_INFINITY") @@ -749,7 +864,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, "encodeURIComponent #if ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL, "getUTCMilliseconds") #endif -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_IS_CONCAT_SPREADABLE, "isConcatSpreadable") #endif #if ENABLED (JERRY_BUILTIN_DATE) @@ -759,7 +874,7 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL, "toLocaleTimeSt #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, "getOwnPropertyNames") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, "propertyIsEnumerable") -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, "getOwnPropertySymbols") #endif LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, "getOwnPropertyDescriptor") @@ -769,20 +884,23 @@ LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (0, LIT_MAGIC_STRING__EMPTY) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (1, LIT_MAGIC_STRING_SPACE_CHAR) #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_PI_U) -#elif ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#elif ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_IS) +#elif ENABLED (JERRY_BUILTIN_ARRAY) && ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_OF) #elif ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_LN2_U) -#elif ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) +#elif ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_MAP) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_MAP_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (2, LIT_MAGIC_STRING_NAN) #endif #if ENABLED (JERRY_BUILTIN_MATH) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_LN2_U) -#elif ENABLED (JERRY_ES2015_BUILTIN_MAP) \ -|| ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) +#elif ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) \ +|| ENABLED (JERRY_ES2015_BUILTIN_MAP) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_MAP_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (3, LIT_MAGIC_STRING_NAN) @@ -818,60 +936,60 @@ LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_TYPED_ARRAY_UL) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_BYTE_LENGTH_UL) #elif ENABLED (JERRY_BUILTIN_STRING) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_CHAR_CODE_AT_UL) -#elif ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) +#elif ENABLED (JERRY_ES2015) \ +|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_COPY_WITHIN) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_ENUMERABLE) #endif -#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_RESOURCE_ANON) -#elif ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) \ -|| ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_ARRAY_BUFFER_UL) -#elif ENABLED (JERRY_BUILTIN_ERRORS) -LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_SYNTAX_ERROR_UL) -#elif ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_UINT16_ARRAY_UL) -#else -LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_CONSTRUCTOR) -#endif #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT32_ARRAY_UL) #elif ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) && ENABLED (JERRY_NUMBER_TYPE_FLOAT64) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT64_ARRAY_UL) #elif ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_INVALID_DATE_UL) -#elif ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ +#elif ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_MAP) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_MAP_ITERATOR_UL) -#elif ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) \ +#elif ENABLED (JERRY_ES2015) \ || ENABLED (JERRY_ES2015_BUILTIN_SET) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_SET_ITERATOR_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_CONFIGURABLE) #endif -#if ENABLED (JERRY_BUILTIN_DATE) +#if ENABLED (JERRY_BUILTIN_STRING) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_FROM_CODE_POINT_UL) +#elif ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_GET_UTC_MINUTES_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (13, LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL) #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_ARRAY_ITERATOR_UL) #elif ENABLED (JERRY_BUILTIN_ERRORS) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_REFERENCE_ERROR_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (14, LIT_MAGIC_STRING_DEFINE_PROPERTY_UL) #endif -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_STRING_ITERATOR_UL) #elif ENABLED (JERRY_BUILTIN_DATE) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_GET_MILLISECONDS_UL) +#elif ENABLED (JERRY_BUILTIN_NUMBER) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (15, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL) #endif +#if ENABLED (JERRY_BUILTIN_NUMBER) && ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_MAX_SAFE_INTEGER_U) +#else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (16, LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL) +#endif #if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U) +#elif ENABLED (JERRY_ES2015) +LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_GENERATOR_FUNCTION_UL) #elif ENABLED (JERRY_BUILTIN_NUMBER) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_NEGATIVE_INFINITY_U) #elif ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) @@ -884,7 +1002,7 @@ LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (17, LIT_MAGIC_STRING_PREVENT_EXTENSIONS LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (18, LIT_MAGIC_STRING_DECODE_URI_COMPONENT) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (19, LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (20, LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL) -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) +#if ENABLED (JERRY_ES2015) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (21, LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL) #else LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (21, LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL) diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handler.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-ext/include/jerryscript-ext/handler.h similarity index 95% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handler.h rename to code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-ext/include/jerryscript-ext/handler.h index 41bfeeb88..c36b6b871 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handler.h +++ b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerry-ext/include/jerryscript-ext/handler.h @@ -44,6 +44,8 @@ jerry_value_t jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_v const jerry_value_t args_p[], const jerry_length_t args_cnt); jerry_value_t jerryx_handler_print (const jerry_value_t func_obj_val, const jerry_value_t this_p, const jerry_value_t args_p[], const jerry_length_t args_cnt); +jerry_value_t jerryx_handler_resource_name (const jerry_value_t func_obj_val, const jerry_value_t this_p, + const jerry_value_t args_p[], const jerry_length_t args_cnt); /** * Struct used by the `jerryx_set_functions` method to diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Config_Full.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Config_Full.h deleted file mode 100644 index 851119732..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Config_Full.h +++ /dev/null @@ -1,23 +0,0 @@ -/* DLib configuration. */ -/* Copyright 2003-2017 IAR Systems AB. */ - -#ifndef _DLIB_CONFIG_H -#define _DLIB_CONFIG_H - -#ifndef _SYSTEM_BUILD - #pragma system_include -#endif - -/* Turn on locale support. */ -#define _DLIB_FULL_LOCALE_SUPPORT 1 - -/* Turn on FILE descriptor support. */ -#define _DLIB_FILE_DESCRIPTOR 1 - -/* Turn on multibyte formatting. */ -#define _DLIB_FORMATTED_MULTIBYTE 1 - -/* Turn on support for hex-floats in strtod. */ -#define _DLIB_STRTOD_HEX_FLOAT 1 - -#endif /* _DLIB_CONFIG_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Defaults.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Defaults.h deleted file mode 100644 index 829b8a50e..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Defaults.h +++ /dev/null @@ -1,599 +0,0 @@ -/*************************************************** - * - * DLib_Defaults.h is the library configuration manager. - * - * Copyright 2003-2017 IAR Systems AB. - * - * This configuration header file performs the following tasks: - * - * 1. Includes the configuration header file, defined by _DLIB_CONFIG_FILE, - * that sets up a particular runtime environment. - * - * 2. Includes the product configuration header file, DLib_Product.h, that - * specifies default values for the product and makes sure that the - * configuration is valid. - * - * 3. Sets up default values for all remaining configuration symbols. - * - * This configuration header file, the one defined by _DLIB_CONFIG_FILE, and - * DLib_Product.h configures how the runtime environment should behave. This - * includes all system headers and the library itself, i.e. all system headers - * includes this configuration header file, and the library has been built - * using this configuration header file. - * - *************************************************** - * - * DO NOT MODIFY THIS FILE! - * - ***************************************************/ - -#ifndef _DLIB_DEFAULTS_H -#define _DLIB_DEFAULTS_H - -#ifndef _SYSTEM_BUILD - #pragma system_include -#endif - -/* Include the main configuration header file. */ -#if defined(_DLIB_CONFIG_FILE_HEADER_NAME) - #include _DLIB_CONFIG_FILE_HEADER_NAME - /* _DLIB_CONFIG_FILE_STRING is the quoted variant of above */ -#elif defined(_DLIB_CONFIG_FILE) - #include _STRINGIFY(_DLIB_CONFIG_FILE) -#else - #pragma message("Library configuration file is not specified. Use\ - --dlib_config, please see the compiler reference guide for details.") -#endif - -/* Include the product specific header file. */ -#ifndef __NO_DLIB_PRODUCT_FILE - #include -#endif - - -/* - * The remainder of the file sets up defaults for a number of - * configuration symbols, each corresponds to a feature in the - * libary. - * - * The value of the symbols should either be 1, if the feature should - * be supported, or 0 if it shouldn't. (Except where otherwise - * noted.) - */ - - -/* - * File handling - * - * Determines whether FILE descriptors and related functions exists or not. - * When this feature is selected, i.e. set to 1, then FILE descriptors and - * related functions (e.g. fprintf, fopen) exist. All files, even stdin, - * stdout, and stderr will then be handled with a file system mechanism that - * buffers files before accessing the lowlevel I/O interface (__open, __read, - * __write, etc). - * - * If not selected, i.e. set to 0, then FILE descriptors and related functions - * (e.g. fprintf, fopen) does not exist. All functions that normally uses - * stderr will use stdout instead. Functions that uses stdout and stdin (like - * printf and scanf) will access the lowlevel I/O interface directly (__open, - * __read, __write, etc), i.e. there will not be any buffering. - * - * The default is not to have support for FILE descriptors. - */ - -#ifndef _DLIB_FILE_DESCRIPTOR - #define _DLIB_FILE_DESCRIPTOR 0 -#endif - - -/* - * Use static buffers for stdout - * - * This setting controls whether the stream stdout uses a static 80 bytes - * buffer or uses a one byte buffer allocated in the file descriptor. This - * setting is only applicable if the FILE descriptors are enabled above. - * - * Default is to use a static 80 byte buffer. - */ - -#ifndef _DLIB_STDOUT_USES_STATIC_BUFFER - #define _DLIB_STDOUT_USES_STATIC_BUFFER 1 -#endif - - -/* - * Support of locale interface - * - * "Locale" is the system in C that support language- and - * contry-specific settings for a number of areas, including currency - * symbols, date and time, and multibyte encodings. - * - * This setting determines whether the locale interface exist or not. - * When this feature is selected, i.e. set to 1, the locale interface exist - * (setlocale, etc). A number of preselected locales can be activated during - * runtime. The preselected locales and encodings are choosen at linkage. The - * application will start with the "C" locale choosen. (Single byte encoding is - * always supported in this mode.) - * - * - * If not selected, i.e. set to 0, the locale interface (setlocale, etc) does - * not exist. The C locale is then preset and cannot be changed. - * - * The default is not to have support for the locale interface with the "C" - * locale and the single byte encoding. - */ - -#ifndef _DLIB_FULL_LOCALE_SUPPORT - #define _DLIB_FULL_LOCALE_SUPPORT 0 -#endif - -/* - * Define what memory to place the locale table segment (.iar.locale_table) - * in. - */ -#ifndef _DLIB_LOCALE_TABLE_MEMORY - #define _DLIB_LOCALE_TABLE_MEMORY -#endif - -/* - * Wide character and multi byte character support in library. - */ - -#ifndef _DLIB_WIDE_CHARACTERS - #define _DLIB_WIDE_CHARACTERS 1 -#endif -#ifndef _DLIB_CONFIG_AGNOSTIC - #if _DLIB_FILE_DESCRIPTOR && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_FILE_DESCRIPTOR == 0 if wide characters are disabled" - #endif - #if _DLIB_FULL_LOCALE_SUPPORT && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_FULL_LOCALE_SUPPORT == 0 if wide characters are disabled" - #endif -#endif - -/* - * Support of multibytes in printf- and scanf-like functions - * - * This is the default value for _DLIB_PRINTF_MULTIBYTE and - * _DLIB_SCANF_MULTIBYTE. See them for a description. - * - * Default is to not have support for multibytes in printf- and scanf-like - * functions. - */ - -#ifndef _DLIB_FORMATTED_MULTIBYTE - #define _DLIB_FORMATTED_MULTIBYTE 0 -#endif -#ifndef _DLIB_CONFIG_AGNOSTIC - #if _DLIB_FORMATTED_MULTIBYTE && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_FORMATTED_MULTIBYTE == 0 if wide characters are disabled" - #endif -#endif - -/* - * Hexadecimal floating-point numbers in strtod - * - * If selected, i.e. set to 1, strtod supports C99 hexadecimal floating-point - * numbers. This also enables hexadecimal floating-points in internal functions - * used for converting strings and wide strings to float, double, and long - * double. - * - * If not selected, i.e. set to 0, C99 hexadecimal floating-point numbers - * aren't supported. - * - * Default is not to support hexadecimal floating-point numbers. - */ - -#ifndef _DLIB_STRTOD_HEX_FLOAT - #define _DLIB_STRTOD_HEX_FLOAT 0 -#endif - - -/* - * Printf configuration symbols. - * - * All the configuration symbols described further on controls the behaviour - * of printf, sprintf, and the other printf variants. - * - * The library proves four formatters for printf: 'tiny', 'small', - * 'large', and 'default'. The setup in this file controls all except - * 'tiny'. Note that both small' and 'large' explicitly removes - * some features. - */ - -/* - * Handle multibytes in printf - * - * This setting controls whether multibytes and wchar_ts are supported in - * printf. Set to 1 to support them, otherwise set to 0. - * - * See _DLIB_FORMATTED_MULTIBYTE for the default setting. - */ -#ifndef _DLIB_PRINTF_MULTIBYTE - #define _DLIB_PRINTF_MULTIBYTE _DLIB_FORMATTED_MULTIBYTE -#endif -#ifndef _DLIB_CONFIG_AGNOSTIC - #if _DLIB_PRINTF_MULTIBYTE && !_DLIB_FULL_LOCALE_SUPPORT - #error "_DLIB_PRINTF_MULTIBYTE needs full locale" - #endif - #if _DLIB_PRINTF_MULTIBYTE && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_PRINTF_MULTIBYTE == 0 if wide characters are disabled" - #endif -#endif - -/* - * Support of formatting anything larger than int in printf - * - * This setting controls if 'int' should be used internally in printf, rather - * than the largest existing integer type. If 'int' is used, any integer or - * pointer type formatting use 'int' as internal type even though the - * formatted type is larger. Set to 1 to use 'int' as internal type, otherwise - * set to 0. - * - * See also next configuration. - * - * Default is to internally use largest existing internally type. - */ -#ifndef _DLIB_PRINTF_INT_TYPE_IS_INT - #define _DLIB_PRINTF_INT_TYPE_IS_INT 0 -#endif - -/* - * Support of formatting anything larger than long in printf - * - * This setting controls if 'long' should be used internally in printf, rather - * than the largest existing integer type. If 'long' is used, any integer or - * pointer type formatting use 'long' as internal type even though the - * formatted type is larger. Set to 1 to use 'long' as internal type, - * otherwise set to 0. - * - * See also previous configuration. - * - * Default is to internally use largest existing internally type. - */ -#ifndef _DLIB_PRINTF_INT_TYPE_IS_LONG - #define _DLIB_PRINTF_INT_TYPE_IS_LONG 0 -#endif - -#if _DLIB_PRINTF_INT_TYPE_IS_INT && _DLIB_PRINTF_INT_TYPE_IS_LONG - #error "At most one of _DLIB_PRINTF_INT_TYPE_IS_INT and _DLIB_PRINTF_INT_TYPE_IS_LONG can be defined." -#endif - -/* - * Emit a char a time in printf - * - * This setting controls internal output handling. If selected, i.e. set to 1, - * then printf emits one character at a time, which requires less code but - * can be slightly slower for some types of output. - * - * If not selected, i.e. set to 0, then printf buffers some outputs. - * - * Note that it is recommended to either use full file support (see - * _DLIB_FILE_DESCRIPTOR) or -- for debug output -- use the linker - * option "-e__write_buffered=__write" to enable buffered I/O rather - * than deselecting this feature. - */ -#ifndef _DLIB_PRINTF_CHAR_BY_CHAR - #define _DLIB_PRINTF_CHAR_BY_CHAR 1 -#endif - - -/* - * Scanf configuration symbols. - * - * All the configuration symbols described here controls the - * behaviour of scanf, sscanf, and the other scanf variants. - * - * The library proves three formatters for scanf: 'small', 'large', - * and 'default'. The setup in this file controls all, however both - * 'small' and 'large' explicitly removes some features. - */ - -/* - * Handle multibytes in scanf - * - * This setting controls whether multibytes and wchar_t:s are supported in - * scanf. Set to 1 to support them, otherwise set to 0. - * - * See _DLIB_FORMATTED_MULTIBYTE for the default. - */ -#ifndef _DLIB_SCANF_MULTIBYTE - #define _DLIB_SCANF_MULTIBYTE _DLIB_FORMATTED_MULTIBYTE -#endif -#ifndef _DLIB_CONFIG_AGNOSTIC - #if _DLIB_SCANF_MULTIBYTE && !_DLIB_FULL_LOCALE_SUPPORT - #error "_DLIB_SCANF_MULTIBYTE needs full locale" - #endif - #if _DLIB_SCANF_MULTIBYTE && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_SCANF_MULTIBYTE == 0 if wide characters are disabled" - #endif -#endif - -/* - * Handle multibytes in asctime and strftime. - * - * This setting controls whether multibytes and wchar_ts are - * supported.Set to 1 to support them, otherwise set to 0. - * - * See _DLIB_FORMATTED_MULTIBYTE for the default setting. - */ -#ifndef _DLIB_STRFTIME_MULTIBYTE - #define _DLIB_STRFTIME_MULTIBYTE _DLIB_FORMATTED_MULTIBYTE -#endif -#ifndef _DLIB_CONFIG_AGNOSTIC - #if _DLIB_STRFTIME_MULTIBYTE && !_DLIB_FULL_LOCALE_SUPPORT - #error "_DLIB_STRFTIME_MULTIBYTE needs full locale" - #endif - #if _DLIB_STRFTIME_MULTIBYTE && !_DLIB_WIDE_CHARACTERS - #error "_DLIB_STRFTIME_MULTIBYTE == 0 if wide characters are disabled" - #endif -#endif - -/* - * Implement "qsort" using a bubble sort algorithm. - * - * Bubble sort is less efficient than quick sort but requires less RAM - * and ROM resources. - */ - -#ifndef _DLIB_QSORT_USE_BUBBLE_SORT - #define _DLIB_QSORT_USE_BUBBLE_SORT 0 -#endif - - -/* - * Set Buffert size used in qsort - */ - -#ifndef _DLIB_QSORT_BUF_SIZE - #define _DLIB_QSORT_BUF_SIZE 256 -#endif - - -/* - * Use a simple rand implementation to reduce memory footprint. - * - * The default "rand" function uses an array of 32 32-bit integers of memory to - * store the current state. - * - * The simple "rand" function uses only a single 32-bit integer. However, the - * quality of the generated psuedo-random numbers are not as good as - * the default implementation. - */ - -#ifndef _DLIB_RAND_USE_SIMPLE - #define _DLIB_RAND_USE_SIMPLE 0 -#endif - - -/* - * Set attributes for the function used by the C-SPY debug interface to stop at. - */ - -#ifndef _DLIB_DEBUG_BREAK_FUNCTION_ATTRIBUTE - #define _DLIB_DEBUG_BREAK_FUNCTION_ATTRIBUTE -#endif - -/* - * Used by products where one runtime library can be used by applications - * with different data models, in order to reduce the total number of - * libraries required. Typically, this is used when the pointer types does - * not change over the data models used, but the placement of data variables - * or/and constant variables do. - * - * If defined, this symbol is typically defined to the memory attribute that - * is used by the runtime library. The actual define must use a - * _Pragma("type_attribute = xxx") construct. In the header files, it is used - * on all statically linked data objects seen by the application. - */ -#ifndef _DLIB_DATA_ATTR - #define _DLIB_DATA_ATTR -#endif - -#ifndef _DLIB_CONST_ATTR - #ifdef _DLIB_DATA_ATTR - #define _DLIB_CONST_ATTR _DLIB_DATA_ATTR - #else - #define _DLIB_CONST_ATTR - #endif -#endif - - -/* - * Turn on support for the Target-specific ABI. The ABI is based on the - * ARM AEABI. A target, except ARM, may deviate from it. - */ - -#ifndef _DLIB_SUPPORT_FOR_AEABI - #ifdef __EDG_IA64_ABI - #define _DLIB_SUPPORT_FOR_AEABI 1 - #else - #define _DLIB_SUPPORT_FOR_AEABI 0 - #endif -#endif - -#if _DLIB_SUPPORT_FOR_AEABI == 1 - /* Possible AEABI deviations */ - #ifndef _DLIB_MBSTATET_IS_UNSIGNED_LONG - #if __INT_SIZE__ != 4 - #define _DLIB_MBSTATET_USES_UNSIGNED_LONG 1 - #else - #define _DLIB_MBSTATET_USES_UNSIGNED_LONG 0 - #endif - #endif - - #ifndef _DLIB_TIME_USES_LONG - #if __INT_SIZE__ != 4 - #define _DLIB_TIME_USES_LONG 1 - #else - #define _DLIB_TIME_USES_LONG 0 - #endif - #endif - - /* - * The "difunc" table contains information about C++ objects that - * should be dynamically initialized, where each entry in the table - * represents an initialization function that should be called. When - * the symbol _DLIB_AEABI_DIFUNC_CONTAINS_OFFSETS is true, each - * entry in the table is encoded as an offset from the entry - * location. When false, the entries contain the actual addresses to - * call. - */ - #ifndef _DLIB_AEABI_DIFUNC_CONTAINS_OFFSETS - #define _DLIB_AEABI_DIFUNC_CONTAINS_OFFSETS 1 - #endif -#endif /* _DLIB_SUPPORT_FOR_AEABI == 1 */ - -/* - * Only use IA64 functions - * - * Remove the C++ __aeabi functions when using the IA64 interface. Used in - * ARM AARCH64 mode. - * - */ -#ifndef _DLIB_ONLY_USE_CXA_FUNCTIONS -#if defined(__ICCARM__) && defined(__aarch64__) - #define _DLIB_ONLY_USE_CXA_FUNCTIONS 1 - #else - #define _DLIB_ONLY_USE_CXA_FUNCTIONS 0 - #endif -#endif - -/* - * Turn on usage of a pragma to tell the linker the number of elements used - * in a setjmp jmp_buf. - */ - -#ifndef _DLIB_USE_RTMODEL_JMP_BUF_NUM_ELEMENTS - #define _DLIB_USE_RTMODEL_JMP_BUF_NUM_ELEMENTS 0 -#endif - - -/* - * If true, the product supplies a "DLib_Product_string.h" file that - * is included from "string.h". - */ - -#ifndef _DLIB_PRODUCT_STRING - #define _DLIB_PRODUCT_STRING 0 -#endif - -/* - * Determine whether the math fma routines are fast or not. - */ -#ifndef _DLIB_FAST_FMA - #define _DLIB_FAST_FMA 0 -#endif - - -/* - * Favor speed versus some size enlargements in floating point functions. - */ -#ifndef _DLIB_SPEEDY_FLOATS - #define _DLIB_SPEEDY_FLOATS 0 -#endif - - -/* - * Include dlmalloc as an alternative heap manager in the product. - * - * Typically, an application will use a "malloc" heap manager that is - * relatively small but not that efficient. An application can - * optionally use the "dlmalloc" package, which provides a more - * effective "malloc" heap manager, if it is included in the product - * and supported by the settings. - * - * See the product documentation on how to use it, and whether or not - * it is included in the product. - */ - -#ifndef _DLIB_INCLUDE_DLMALLOC_ALTERNATIVE - /* size_t/ptrdiff_t must be a 4 bytes unsigned integer. */ - #if __SIZE_T_MAX__ < 0xfffffffful - #define _DLIB_INCLUDE_DLMALLOC_ALTERNATIVE 0 - #else - #define _DLIB_INCLUDE_DLMALLOC_ALTERNATIVE 1 - #endif -#endif - - -/* - * Make sure certain C++ functions use the soft floating point variant. - */ - -#ifndef __SOFTFP - #define __SOFTFP -#endif - - -/* - * Allow the 64-bit time_t interface? - * - * Default is yes if long long is 64 bits. - */ - -#ifndef _DLIB_TIME_ALLOW_64 - #if __LONG_LONG_SIZE__ == 8 - #define _DLIB_TIME_ALLOW_64 1 - #else - #define _DLIB_TIME_ALLOW_64 0 - #endif -#endif - - -/* - * Is time_t 64 or 32 bits? - * - * Default is 32 bits. - */ - -#ifndef _DLIB_TIME_USES_64_DEFAULT - #define _DLIB_TIME_USES_64_DEFAULT 0 -#endif - - -/* - * Do we include math functions that demands lots of constant bytes? - * (like erf, erfc, expm1, fma, lgamma, tgamma, and *_accurate) - * - */ - -#ifndef _DLIB_ALLOW_LARGE_CONSTANT_TABLES_FOR_MATH - #define _DLIB_ALLOW_LARGE_CONSTANT_TABLES_FOR_MATH 1 -#endif - - -/* - * Support of weak. - * - * __weak must be supported. Support of weak means that the call to - * a weak declared function that isn't part of the application will be - * executed as a nop instruction. - * - */ - -#ifndef __WEAK - #if !defined(__HAS_WEAK__) || !__HAS_WEAK__ - #error "Compiler must support __weak" - #endif - #define __WEAK _Pragma("object_attribute = __weak") - #define __WEAK_DEFS 1 -#endif - - -/* - * Deleted options - */ -#ifdef _DLIB_FLOAT_ENVIRONMENT - #error "Option has been removed" -#endif - -#ifdef _DLIB_SMALL_TARGET - #error "Option has been removed" -#endif - -#ifdef _DLIB_THREAD_SUPPORT - #error "Option has been removed" -#endif - -#endif /* _DLIB_DEFAULTS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product.h deleted file mode 100644 index b06e19271..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright 2017 IAR Systems AB. */ - -#ifndef _DLIB_PRODUCTS_H_ -#define _DLIB_PRODUCTS_H_ - -#ifndef _SYSTEM_BUILD - #pragma system_include -#endif - - -/********************************************************************* -* -* Configuration -* -*********************************************************************/ - -/* Wide character and multi byte character support in library. - * This is not allowed to vary over configurations, since math-library - * is built with wide character support. - */ -#define _DLIB_WIDE_CHARACTERS 1 - -/* This ensures that the standard header file "string.h" includes - * the Arm-specific file "DLib_Product_string.h". */ -#define _DLIB_PRODUCT_STRING 1 - -/* This ensures that the standard header file "fenv.h" includes - * the Arm-specific file "DLib_Product_fenv.h". */ -#define _DLIB_PRODUCT_FENV 1 - -/* This ensures that the standard header file "stdlib.h" includes - * the Arm-specific file "DLib_Product_stdlib.h". */ -#define _DLIB_PRODUCT_STDLIB 1 - -/* Max buffer used for swap in qsort */ -#if !defined(_DLIB_QSORT_BUF_SIZE) -#define _DLIB_QSORT_BUF_SIZE 128 -#endif - -#if defined(__RWPI__) - /* No thread local storage with RWPI */ - #define _THREAD_LOCAL -#endif - -/* Enable AEABI support */ -#define _DLIB_SUPPORT_FOR_AEABI 1 - -/* Enable rtmodel for setjump buffer size */ -#define _DLIB_USE_RTMODEL_JMP_BUF_NUM_ELEMENTS 1 - -/* Enable parsing of hex floats */ -#if !defined(_DLIB_STRTOD_HEX_FLOAT) -#define _DLIB_STRTOD_HEX_FLOAT 1 -#elif _DLIB_STRTOD_HEX_FLOAT != 1 -#error "_DLIB_STRTOD_HEX_FLOAT must be 1 to match the math-library" -#endif - -/* Special placement for locale structures when building ropi libraries */ -#if defined(__ROPI__) -#define _LOCALE_PLACEMENT_ static -#endif - -/* Use atomic if possible */ -#ifndef __STDC_NO_ATOMICS__ - #define _USE_ATOMIC_OPS 1 -#endif - -/* CPP-library uses software floatingpoint interface */ -#define __SOFTFP _Pragma( "type_attribute=__softfp" ) - -/* functions for setting errno should be __no_scratch */ -#define __NO_SCRATCH _Pragma( "type_attribute=__no_scratch" ) - -/* Use speedy implementation of floats (simple quad). */ -#define _DLIB_SPEEDY_FLOATS 1 - -/* Configure generic ELF init routines. */ -#define _DLIB_ELF_INIT_STATIC_BASE_DECLARATION __no_init uint32_t __iar_SB @ r9 -#define _DLIB_ELF_INIT_STATIC_BASE __iar_SB -#define _DLIB_ELF_INIT_FUNCTION_ATTRIBUTES \ - _Pragma("type_attribute=__interwork __thumb") -#define _DLIB_ELF_INIT_TABLE_MEMORY __data -#define _DLIB_ELF_INIT_SOURCE_MEMORY __data -#define _DLIB_ELF_INIT_DESTINATION_MEMORY __data -#define _DLIB_ELF_INIT_USE_RELATIVE_ROM_ADDRESSES 1 -#define _DLIB_ELF_INIT_REGION_COUNT_TYPE uint32_t -#ifdef AVOID_ROPI -#define _DLIB_ELF_INIT_MODULE_ATTRIBUTES \ - _Pragma("build_attribute vfpcc_compatible") \ - _Pragma("build_attribute arm_thumb_compatible") \ - _Pragma("build_attribute rwpi_compatible") \ - _Pragma("diag_suppress=Pa107") \ - _Pragma("rtmodel=\"CppFlavor\",\"*\"") \ - _Pragma("diag_default=Pa107") -#else -#define _DLIB_ELF_INIT_MODULE_ATTRIBUTES \ - _Pragma("build_attribute vfpcc_compatible") \ - _Pragma("build_attribute arm_thumb_compatible") \ - _Pragma("build_attribute ropi_compatible") \ - _Pragma("build_attribute rwpi_compatible") \ - _Pragma("diag_suppress=Pa107") \ - _Pragma("rtmodel=\"CppFlavor\",\"*\"") \ - _Pragma("diag_default=Pa107") -#endif -#define _DLIB_ELF_INIT_INTERFACE_VERSION 3 - -#define _DLIB_USE_RTMODEL_JMP_BUF_NUM_ELEMENTS 1 - -#define _XMATHWRAPPERS_DEF xarmmathwrappers.h - -#define _CPPINIT_ATTR _Pragma("no_bounds") - -#endif - diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_stdlib.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_stdlib.h deleted file mode 100644 index f731f6571..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_stdlib.h +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************** - * - * ARM-specific configuration for stdlib.h in DLib. - * - * Copyright 2017 IAR Systems AB. - * - **************************************************/ - -#ifndef _DLIB_PRODUCTS_STDLIB_H_ -#define _DLIB_PRODUCTS_STDLIB_H_ - -#ifndef _SYSTEM_BUILD - #pragma system_include -#endif - -#ifndef _NO_DEFINITIONS_IN_HEADER_FILES - -#ifdef __cplusplus -extern "C" { -#endif - -#pragma type_attribute=__value_in_regs -div_t __aeabi_idivmod(int n, int d); - -#if !_DLIB_ONLY_C89 - #pragma type_attribute=__value_in_regs - lldiv_t __aeabi_ldivmod(long long n, long long d); -#endif - -#pragma inline=forced_no_body -__ATTRIBUTES -div_t div(int a, int b) -{ -#if __ARM_FEATURE_IDIV - int q = a / b; - int r = a - (q*b); - div_t d; - d.quot = q; - d.rem = r; - return d; -#else - return __aeabi_idivmod(a, b); -#endif -} - -#pragma inline=forced_no_body -__ATTRIBUTES -ldiv_t ldiv(long a, long b) -{ -#if __ARM_FEATURE_IDIV - int q = a / b; - int r = a - (q*b); - ldiv_t ld; - ld.quot = q; - ld.rem = r; -#else - div_t d = __aeabi_idivmod(a, b); - ldiv_t ld; - ld.quot = d.quot; - ld.rem = d.rem; -#endif - return ld; -} - -#if !_DLIB_ONLY_C89 - #pragma inline=forced_no_body - __ATTRIBUTES - lldiv_t lldiv(long long a, long long b) - { - return __aeabi_ldivmod(a, b); - } -#endif - -#ifdef __cplusplus -}; -#endif - -#endif /* _NO_DEFINITIONS_IN_HEADER_FILES */ - -#endif /* _DLIB_PRODUCTS_STDLIB_H_ */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_string.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_string.h deleted file mode 100644 index 290da39ca..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/DLib_Product_string.h +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************** - * - * ARM-specific configuration for string.h in DLib. - * - * Copyright 2006-2017 IAR Systems AB. - * - * $Id: DLib_Product_string.h 126465 2018-03-21 15:15:50Z mats $ - * - **************************************************/ - -#ifndef _DLIB_PRODUCTS_STRING_H_ -#define _DLIB_PRODUCTS_STRING_H_ - -#ifndef _SYSTEM_BUILD - #pragma system_include -#endif - -#ifndef _NO_DEFINITIONS_IN_HEADER_FILES - - /* - * The following is pre-declared by the compiler. - * - * __INTRINSIC void __aeabi_memset (void *, size_t, int); - * __INTRINSIC void __aeabi_memcpy (void *, const void *, size_t); - * __INTRINSIC void __aeabi_memmove(void *, const void *, size_t); - */ - - - /* - * Inhibit inline definitions for routines with an effective - * ARM-specific implementation. - * - * Not in Cortex-M1 and Cortex-MS1 - */ - - #if __CORE__ != 11 && __CORE__ != 12 - - #define _DLIB_STRING_SKIP_INLINE_MEMCHR - #define _DLIB_STRING_SKIP_INLINE_MEMCMP - #define _DLIB_STRING_SKIP_INLINE_STRCHR - #define _DLIB_STRING_SKIP_INLINE_STRCMP - #define _DLIB_STRING_SKIP_INLINE_STRLEN - #define _DLIB_STRING_SKIP_INLINE_STRNCPY - - #endif - - /* - * Redirect calls to standard functions to the corresponding - * __aeabi_X function. - */ -#ifndef __AS_BOUNDS__ -_EXTERN_C - - #define _DLIB_STRING_SKIP_INLINE_MEMCPY - #pragma inline=forced_no_body - __EFF_NENR1NW2R1 __ATTRIBUTES void * memcpy(void * _D, const void * _S, size_t _N) - { - __aeabi_memcpy(_D, _S, _N); - return _D; - } - - #define _DLIB_STRING_SKIP_INLINE_MEMMOVE - #pragma inline=forced_no_body - __EFF_NENR1NW2R1 __ATTRIBUTES void * memmove(void * _D, const void * _S, size_t _N) - { - __aeabi_memmove(_D, _S, _N); - return _D; - } - - #define _DLIB_STRING_SKIP_INLINE_MEMSET - #pragma inline=forced_no_body - __EFF_NENR1R1 __ATTRIBUTES void * memset(void * _D, int _C, size_t _N) - { - __aeabi_memset(_D, _N, _C); - return _D; - } - -_EXTERN_C_END -#endif /* __AS_BOUNDS__ */ -#endif /* _NO_DEFINITIONS_IN_HEADER_FILES */ - -#endif /* _DLIB_PRODUCTS_STRING_H_ */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg-internal.h deleted file mode 100644 index 3f9c4fe07..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg-internal.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_INTERNAL_H -#define JERRYX_ARG_INTERNAL_H - -#include "jerryscript.h" - -/** - * The iterator structor for JS arguments. - */ -struct jerryx_arg_js_iterator_t -{ - const jerry_value_t *js_arg_p; /**< the JS arguments */ - const jerry_length_t js_arg_cnt; /**< the total num of JS arguments */ - jerry_length_t js_arg_idx; /**< current index of JS argument */ -}; - -#endif /* !JERRYX_ARG_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.h deleted file mode 100644 index 8171bcf3c..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.h +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_H -#define JERRYX_ARG_H - -#include -#include -#include -#include "jerryscript.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** - * The forward declaration of jerryx_arg_t. - */ -typedef struct jerryx_arg_t jerryx_arg_t; - -/** - * The forward declaration of jerryx_arg_js_iterator_t - */ -typedef struct jerryx_arg_js_iterator_t jerryx_arg_js_iterator_t; - -/** - * Signature of the transform function. - */ -typedef jerry_value_t (*jerryx_arg_transform_func_t) (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */ - const jerryx_arg_t *c_arg_p); /**< native arg */ - -/** - * The structure used in jerryx_arg_object_properties - */ -typedef struct -{ - const jerry_char_t **name_p; /**< property name list of the JS object */ - jerry_length_t name_cnt; /**< count of the name list */ - const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */ - jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */ -} jerryx_arg_object_props_t; - -/** - * The structure used in jerryx_arg_array - */ -typedef struct -{ - const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */ - jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */ -} jerryx_arg_array_items_t; - -/** - * The structure defining a single validation & transformation step. - */ -struct jerryx_arg_t -{ - jerryx_arg_transform_func_t func; /**< the transform function */ - void *dest; /**< pointer to destination where func should store the result */ - uintptr_t extra_info; /**< extra information, specific to func */ -}; - -jerry_value_t jerryx_arg_transform_this_and_args (const jerry_value_t this_val, - const jerry_value_t *js_arg_p, - const jerry_length_t js_arg_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -jerry_value_t jerryx_arg_transform_args (const jerry_value_t *js_arg_p, - const jerry_length_t js_arg_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -jerry_value_t jerryx_arg_transform_object_properties (const jerry_value_t obj_val, - const jerry_char_t **name_p, - const jerry_length_t name_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); -jerry_value_t jerryx_arg_transform_array (const jerry_value_t array_val, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -/** - * Indicates whether an argument is allowed to be coerced into the expected JS type. - */ -typedef enum -{ - JERRYX_ARG_COERCE, /**< the transform inside will invoke toNumber, toBoolean or toString */ - JERRYX_ARG_NO_COERCE /**< the type coercion is not allowed. */ -} jerryx_arg_coerce_t; - -/** - * Indicates whether an argument is optional or required. - */ -typedef enum -{ - /** - * The argument is optional. If the argument is `undefined` the transform is - * successful and `c_arg_p->dest` remains untouched. - */ - JERRYX_ARG_OPTIONAL, - /** - * The argument is required. If the argument is `undefined` the transform - * will fail and `c_arg_p->dest` remains untouched. - */ - JERRYX_ARG_REQUIRED -} jerryx_arg_optional_t; - -/** - * Indicates the rounding policy which will be chosen to transform an integer. - */ -typedef enum -{ - JERRYX_ARG_ROUND, /**< round */ - JERRYX_ARG_FLOOR, /**< floor */ - JERRYX_ARG_CEIL /**< ceil */ -} jerryx_arg_round_t; - -/** - * Indicates the clamping policy which will be chosen to transform an integer. - * If the policy is NO_CLAMP, and the number is out of range, - * then the transformer will throw a range error. - */ -typedef enum -{ - JERRYX_ARG_CLAMP,/**< clamp the number when it is out of range */ - JERRYX_ARG_NO_CLAMP /**< throw a range error */ -} jerryx_arg_clamp_t; - -/* Inline functions for initializing jerryx_arg_t */ - -#define JERRYX_ARG_INTEGER(type) \ - static inline jerryx_arg_t \ - jerryx_arg_ ## type (type ## _t *dest, \ - jerryx_arg_round_t round_flag, \ - jerryx_arg_clamp_t clamp_flag, \ - jerryx_arg_coerce_t coerce_flag, \ - jerryx_arg_optional_t opt_flag); - -JERRYX_ARG_INTEGER (uint8) -JERRYX_ARG_INTEGER (int8) -JERRYX_ARG_INTEGER (uint16) -JERRYX_ARG_INTEGER (int16) -JERRYX_ARG_INTEGER (uint32) -JERRYX_ARG_INTEGER (int32) - -#undef JERRYX_ARG_INTEGER - -static inline jerryx_arg_t -jerryx_arg_number (double *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_boolean (bool *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_string (char *dest, uint32_t size, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_utf8_string (char *dest, uint32_t size, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_function (jerry_value_t *dest, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_native_pointer (void **dest, const jerry_object_native_info_t *info_p, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_ignore (void); -static inline jerryx_arg_t -jerryx_arg_custom (void *dest, uintptr_t extra_info, jerryx_arg_transform_func_t func); -static inline jerryx_arg_t -jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props_p, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, jerryx_arg_optional_t opt_flag); - -jerry_value_t -jerryx_arg_transform_optional (jerryx_arg_js_iterator_t *js_arg_iter_p, - const jerryx_arg_t *c_arg_p, - jerryx_arg_transform_func_t func); - -/* Helper functions for transform functions. */ -jerry_value_t jerryx_arg_js_iterator_pop (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_value_t jerryx_arg_js_iterator_restore (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_value_t jerryx_arg_js_iterator_peek (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_length_t jerryx_arg_js_iterator_index (jerryx_arg_js_iterator_t *js_arg_iter_p); - -#include "arg.impl.h" - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_ARG_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.impl.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.impl.h deleted file mode 100644 index 1b3111e5a..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/arg.impl.h +++ /dev/null @@ -1,443 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_IMPL_H -#define JERRYX_ARG_IMPL_H - -/* transform functions for each type. */ - -#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL(type) \ - jerry_value_t jerryx_arg_transform_ ## type (jerryx_arg_js_iterator_t *js_arg_iter_p, \ - const jerryx_arg_t *c_arg_p); \ - jerry_value_t jerryx_arg_transform_ ## type ## _optional (jerryx_arg_js_iterator_t *js_arg_iter_p, \ - const jerryx_arg_t *c_arg_p); - -#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT(type) \ - JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type) \ - JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type ## _strict) - -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint8) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int8) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint16) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int16) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint32) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int32) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (number) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (string) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (utf8_string) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (boolean) - -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (function) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (native_pointer) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (object_props) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (array_items) - -jerry_value_t jerryx_arg_transform_ignore (jerryx_arg_js_iterator_t *js_arg_iter_p, - const jerryx_arg_t *c_arg_p); - -#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL -#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT - -/** - * The structure indicates the options used to transform integer argument. - * It will be passed into jerryx_arg_t's extra_info field. - */ -typedef struct -{ - uint8_t round; /**< rounding policy */ - uint8_t clamp; /**< clamping policy */ -} jerryx_arg_int_option_t; - -/** - * The macro used to generate jerryx_arg_xxx for int type. - */ -#define JERRYX_ARG_INT(type) \ - static inline jerryx_arg_t \ - jerryx_arg_ ## type (type ## _t *dest, \ - jerryx_arg_round_t round_flag, \ - jerryx_arg_clamp_t clamp_flag, \ - jerryx_arg_coerce_t coerce_flag, \ - jerryx_arg_optional_t opt_flag) \ - { \ - jerryx_arg_transform_func_t func; \ - if (coerce_flag == JERRYX_ARG_NO_COERCE) \ - { \ - if (opt_flag == JERRYX_ARG_OPTIONAL) \ - { \ - func = jerryx_arg_transform_ ## type ## _strict_optional; \ - } \ - else \ - { \ - func = jerryx_arg_transform_ ## type ## _strict; \ - } \ - } \ - else \ - { \ - if (opt_flag == JERRYX_ARG_OPTIONAL) \ - { \ - func = jerryx_arg_transform_ ## type ## _optional; \ - } \ - else \ - { \ - func = jerryx_arg_transform_ ## type; \ - } \ - } \ - union \ - { \ - jerryx_arg_int_option_t int_option; \ - uintptr_t extra_info; \ - } u = { .int_option = { .round = (uint8_t) round_flag, .clamp = (uint8_t) clamp_flag } }; \ - return (jerryx_arg_t) \ - { \ - .func = func, \ - .dest = (void *) dest, \ - .extra_info = u.extra_info \ - }; \ - } - -JERRYX_ARG_INT (uint8) -JERRYX_ARG_INT (int8) -JERRYX_ARG_INT (uint16) -JERRYX_ARG_INT (int16) -JERRYX_ARG_INT (uint32) -JERRYX_ARG_INT (int32) - -#undef JERRYX_ARG_INT - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `number` JS argument and stores it into a C `double`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_number (double *dest, /**< pointer to the double where the result should be stored */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_number_strict_optional; - } - else - { - func = jerryx_arg_transform_number_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_number_optional; - } - else - { - func = jerryx_arg_transform_number; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_number */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `boolean` JS argument and stores it into a C `bool`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_boolean (bool *dest, /**< points to the native bool */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_boolean_strict_optional; - } - else - { - func = jerryx_arg_transform_boolean_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_boolean_optional; - } - else - { - func = jerryx_arg_transform_boolean; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_boolean */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `string` JS argument and stores it into a C `char` array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_string (char *dest, /**< pointer to the native char array where the result should be stored */ - uint32_t size, /**< the size of native char array */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_string_strict_optional; - } - else - { - func = jerryx_arg_transform_string_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_string_optional; - } - else - { - func = jerryx_arg_transform_string; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) size - }; -} /* jerryx_arg_string */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `string` JS argument and stores it into a C utf8 `char` array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_utf8_string (char *dest, /**< [out] pointer to the native char array where the result should be stored */ - uint32_t size, /**< the size of native char array */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_utf8_string_strict_optional; - } - else - { - func = jerryx_arg_transform_utf8_string_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_utf8_string_optional; - } - else - { - func = jerryx_arg_transform_utf8_string; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) size - }; -} /* jerryx_arg_utf8_string */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `function` JS argument and stores it into a C `jerry_value_t`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_function (jerry_value_t *dest, /**< pointer to the jerry_value_t where the result should be stored */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_function_optional; - } - else - { - func = jerryx_arg_transform_function; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_function */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `object` JS argument that is 'backed' with a native pointer with - * a given type info. In case the native pointer info matches, the transform - * will succeed and the object's native pointer will be assigned to *dest. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_native_pointer (void **dest, /**< pointer to where the resulting native pointer should be stored */ - const jerry_object_native_info_t *info_p, /**< expected the type info */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_native_pointer_optional; - } - else - { - func = jerryx_arg_transform_native_pointer; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) info_p - }; -} /* jerryx_arg_native_pointer */ - -/** - * Create a jerryx_arg_t instance for ignored argument. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_ignore (void) -{ - return (jerryx_arg_t) - { - .func = jerryx_arg_transform_ignore - }; -} /* jerryx_arg_ignore */ - -/** - * Create a jerryx_arg_t instance with custom transform. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_custom (void *dest, /**< pointer to the native argument where the result should be stored */ - uintptr_t extra_info, /**< the extra parameter, specific to the transform function */ - jerryx_arg_transform_func_t func) /**< the custom transform function */ -{ - return (jerryx_arg_t) - { - .func = func, - .dest = dest, - .extra_info = extra_info - }; -} /* jerryx_arg_custom */ - -/** - * Create a jerryx_arg_t instance for object properties. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props, /**< pointer to object property mapping */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_object_props_optional; - } - else - { - func = jerryx_arg_transform_object_props; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = NULL, - .extra_info = (uintptr_t) object_props - }; -} /* jerryx_arg_object_properties */ - -/** - * Create a jerryx_arg_t instance for array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, /**< pointer to array items mapping */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_array_items_optional; - } - else - { - func = jerryx_arg_transform_array_items; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = NULL, - .extra_info = (uintptr_t) array_items_p - }; -} /* jerryx_arg_array */ - -#endif /* !JERRYX_ARG_IMPL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/byte-code.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/byte-code.h deleted file mode 100644 index 57a626a03..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/byte-code.h +++ /dev/null @@ -1,735 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef BYTE_CODE_H -#define BYTE_CODE_H - -#include "ecma-globals.h" - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_bytecode Bytecode - * @{ - */ - -/** - * Compact byte code (CBC) is a byte code representation - * of EcmaScript which is designed for low memory - * environments. Most opcodes are only one or sometimes - * two byte long so the CBC provides a small binary size. - * - * The execution engine of CBC is a stack machine, where - * the maximum stack size is known in advance for each - * function. - */ - -/** - * Byte code flags. Only the lower 5 bit can be used - * since the stack change is encoded in the upper - * three bits for each instruction between -4 and 3 - * (except for call / construct opcodes). - */ -#define CBC_STACK_ADJUST_BASE 4 -#define CBC_STACK_ADJUST_SHIFT 5 -#define CBC_STACK_ADJUST_VALUE(value) \ - (((value) >> CBC_STACK_ADJUST_SHIFT) - CBC_STACK_ADJUST_BASE) - -#define CBC_NO_FLAG 0x00u -#define CBC_HAS_LITERAL_ARG 0x01u -#define CBC_HAS_LITERAL_ARG2 0x02u -#define CBC_HAS_BYTE_ARG 0x04u -#define CBC_HAS_BRANCH_ARG 0x08u - -/* These flags are shared */ -#define CBC_FORWARD_BRANCH_ARG 0x10u -#define CBC_POP_STACK_BYTE_ARG 0x10u - -#define CBC_ARG_TYPES (CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2 | CBC_HAS_BYTE_ARG | CBC_HAS_BRANCH_ARG) - -#define CBC_HAS_POP_STACK_BYTE_ARG (CBC_HAS_BYTE_ARG | CBC_POP_STACK_BYTE_ARG) - -#if ENABLED (JERRY_ES2015_CLASS) -/** - * Checks whether the current opcode is a super constructor call - */ -#define CBC_SUPER_CALL_OPERATION(opcode) \ - ((opcode) >= PARSER_TO_EXT_OPCODE (CBC_EXT_SUPER_CALL) \ - && (opcode) <= PARSER_TO_EXT_OPCODE (CBC_EXT_SUPER_CALL_BLOCK)) -#else /* !ENABLED (JERRY_ES2015_CLASS) */ -/** - * Checks whether the current opcode is a super constructor call - */ -#define CBC_SUPER_CALL_OPERATION(opcode) false -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -/* Debug macro. */ -#define CBC_ARGS_EQ(op, types) \ - ((cbc_flags[op] & CBC_ARG_TYPES) == (types)) - -/* Debug macro. */ -#define CBC_SAME_ARGS(op1, op2) \ - (CBC_SUPER_CALL_OPERATION (op1) ? ((cbc_ext_flags[PARSER_GET_EXT_OPCODE (op1)] & CBC_ARG_TYPES) \ - == (cbc_ext_flags[PARSER_GET_EXT_OPCODE (op2)] & CBC_ARG_TYPES)) \ - : ((cbc_flags[op1] & CBC_ARG_TYPES) == (cbc_flags[op2] & CBC_ARG_TYPES))) - -#define CBC_UNARY_OPERATION(name, group) \ - CBC_OPCODE (name, CBC_NO_FLAG, 0, \ - (VM_OC_ ## group) | VM_OC_GET_STACK | VM_OC_PUT_STACK) \ - CBC_OPCODE (name ## _LITERAL, CBC_HAS_LITERAL_ARG, 1, \ - (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_STACK) - -#define CBC_BINARY_OPERATION(name, group) \ - CBC_OPCODE (name, CBC_NO_FLAG, -1, \ - (VM_OC_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \ - CBC_OPCODE (name ## _RIGHT_LITERAL, CBC_HAS_LITERAL_ARG, 0, \ - (VM_OC_ ## group) | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (name ## _TWO_LITERALS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \ - (VM_OC_ ## group) | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK) - -#define CBC_UNARY_LVALUE_OPERATION(name, group) \ - CBC_OPCODE (name, CBC_NO_FLAG, -2, \ - (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE) \ - CBC_OPCODE (name ## _PUSH_RESULT, CBC_NO_FLAG, -1, \ - (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \ - CBC_OPCODE (name ## _BLOCK, CBC_NO_FLAG, -2, \ - (VM_OC_PROP_ ## group) | VM_OC_GET_STACK_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (name ## _IDENT, CBC_HAS_LITERAL_ARG, 0, \ - (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT) \ - CBC_OPCODE (name ## _IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 1, \ - (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \ - CBC_OPCODE (name ## _IDENT_BLOCK, CBC_HAS_LITERAL_ARG, 0, \ - (VM_OC_ ## group) | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK) - -#define CBC_UNARY_LVALUE_WITH_IDENT 3 - -#define CBC_BINARY_WITH_LITERAL 1 -#define CBC_BINARY_WITH_TWO_LITERALS 2 - -/** - * Several opcodes (mostly call and assignment opcodes) have - * two forms: one which does not push a return value onto - * the stack, and another which does. The reason is that - * the return value of these opcodes are often not used - * and the first form provides smaller byte code. - * - * The following rules must be kept by the code generator: - * - only the opcode without return value can be emitted - * by the code generator - * - the first form can be converted to the second form - * by adding 1 to the opcode - * - after the conversion the opcode must be immediately - * flushed, so no further changes are possible - * - * Hence CBC_NO_RESULT_OPERATION (context_p->last_cbc_opcode) - * cannot be true for an opcode which has a result - */ -#define CBC_NO_RESULT_OPERATION(opcode) \ - (((opcode) >= CBC_PRE_INCR && (opcode) < CBC_END) || CBC_SUPER_CALL_OPERATION ((opcode))) - -/** - * Branch instructions are organized in group of 8 opcodes. - * - 1st opcode: unused, can be used for other purpose - * - 2nd opcode: forward branch with 1 byte offset - * - 3rd opcode: forward branch with 2 byte offset - * - 4th opcode: forward branch with 3 byte offset - * - 5th opcode: unused, can be used for other purpose - * - 6th opcode: backward branch with 1 byte offset - * - 7th opcode: backward branch with 2 byte offset - * - 8th opcode: backward branch with 3 byte offset - * - * Reasons: - * The branch_opcode & 0x3 tells the length in bytes of the offset - * If branch offset & 0x4 == 0, it is a forward branch. Otherwise - * it is backward. - * - * The offset bytes are encoded in higher to lower order. - */ - -#define CBC_FORWARD_BRANCH(name, stack, vm_oc) \ - CBC_OPCODE (name, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH) \ - CBC_OPCODE (name ## _2, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH) \ - CBC_OPCODE (name ## _3, CBC_HAS_BRANCH_ARG | CBC_FORWARD_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH) - -#define CBC_BACKWARD_BRANCH(name, stack, vm_oc) \ - CBC_OPCODE (name, CBC_HAS_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH) \ - CBC_OPCODE (name ## _2, CBC_HAS_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH) \ - CBC_OPCODE (name ## _3, CBC_HAS_BRANCH_ARG, stack, \ - (vm_oc) | VM_OC_GET_BRANCH | VM_OC_BACKWARD_BRANCH) - -#define CBC_BRANCH_OFFSET_LENGTH(opcode) \ - ((opcode) & 0x3) - -#define CBC_BRANCH_IS_BACKWARD(flags) \ - (!((flags) & CBC_FORWARD_BRANCH_ARG)) - -#define CBC_BRANCH_IS_FORWARD(flags) \ - ((flags) & CBC_FORWARD_BRANCH_ARG) - -/* Stack consumption of opcodes with context. */ - -/* PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION must be <= 3 */ -#define PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION 3 -/* PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION must be <= 4 */ -#define PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION 4 -/* PARSER_WITH_CONTEXT_STACK_ALLOCATION must be <= 4 */ -#define PARSER_WITH_CONTEXT_STACK_ALLOCATION 1 -/* PARSER_SUPER_CLASS_CONTEXT_STACK_ALLOCATION must be <= 4 */ -#define PARSER_SUPER_CLASS_CONTEXT_STACK_ALLOCATION 1 -/* PARSER_TRY_CONTEXT_STACK_ALLOCATION must be <= 3 */ -#define PARSER_TRY_CONTEXT_STACK_ALLOCATION 2 - -/** - * Opcode definitions. - */ -#define CBC_OPCODE_LIST \ - /* Branch opcodes first. Some other opcodes are mixed. */ \ - CBC_OPCODE (CBC_EXT_OPCODE, CBC_NO_FLAG, 0, \ - VM_OC_NONE) \ - CBC_FORWARD_BRANCH (CBC_JUMP_FORWARD, 0, \ - VM_OC_JUMP) \ - CBC_OPCODE (CBC_POP, CBC_NO_FLAG, -1, \ - VM_OC_POP) \ - CBC_BACKWARD_BRANCH (CBC_JUMP_BACKWARD, 0, \ - VM_OC_JUMP) \ - CBC_OPCODE (CBC_POP_BLOCK, CBC_NO_FLAG, -1, \ - VM_OC_POP_BLOCK | VM_OC_PUT_BLOCK) \ - CBC_FORWARD_BRANCH (CBC_BRANCH_IF_TRUE_FORWARD, -1, \ - VM_OC_BRANCH_IF_TRUE) \ - CBC_OPCODE (CBC_THROW, CBC_NO_FLAG, -1, \ - VM_OC_THROW | VM_OC_GET_STACK) \ - CBC_BACKWARD_BRANCH (CBC_BRANCH_IF_TRUE_BACKWARD, -1, \ - VM_OC_BRANCH_IF_TRUE) \ - CBC_OPCODE (CBC_CONTEXT_END, CBC_NO_FLAG, 0, \ - VM_OC_CONTEXT_END) \ - CBC_FORWARD_BRANCH (CBC_BRANCH_IF_FALSE_FORWARD, -1, \ - VM_OC_BRANCH_IF_FALSE) \ - CBC_OPCODE (CBC_CREATE_OBJECT, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_OBJECT | VM_OC_PUT_STACK) \ - CBC_BACKWARD_BRANCH (CBC_BRANCH_IF_FALSE_BACKWARD, -1, \ - VM_OC_BRANCH_IF_FALSE) \ - CBC_OPCODE (CBC_SET_PROPERTY, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_PROPERTY | VM_OC_NON_STATIC_FLAG | VM_OC_GET_STACK_LITERAL) \ - CBC_FORWARD_BRANCH (CBC_JUMP_FORWARD_EXIT_CONTEXT, 0, \ - VM_OC_JUMP_AND_EXIT_CONTEXT) \ - CBC_OPCODE (CBC_CREATE_ARRAY, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_ARRAY | VM_OC_PUT_STACK) \ - CBC_FORWARD_BRANCH (CBC_BRANCH_IF_LOGICAL_TRUE, -1, \ - VM_OC_BRANCH_IF_LOGICAL_TRUE) \ - CBC_OPCODE (CBC_ARRAY_APPEND, CBC_HAS_POP_STACK_BYTE_ARG, 0, \ - VM_OC_APPEND_ARRAY) \ - CBC_FORWARD_BRANCH (CBC_BRANCH_IF_LOGICAL_FALSE, -1, \ - VM_OC_BRANCH_IF_LOGICAL_FALSE) \ - CBC_OPCODE (CBC_PUSH_ELISION, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_ELISON | VM_OC_PUT_STACK) \ - CBC_FORWARD_BRANCH (CBC_BRANCH_IF_STRICT_EQUAL, -1, \ - VM_OC_BRANCH_IF_STRICT_EQUAL) \ - \ - /* Basic opcodes. Note: These 4 opcodes must me in this order */ \ - CBC_OPCODE (CBC_PUSH_LITERAL, CBC_HAS_LITERAL_ARG, 1, \ - VM_OC_PUSH | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_PUSH_TWO_LITERALS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 2, \ - VM_OC_PUSH_TWO | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_PUSH_THIS_LITERAL, CBC_HAS_LITERAL_ARG, 2, \ - VM_OC_PUSH_TWO | VM_OC_GET_THIS_LITERAL) \ - CBC_OPCODE (CBC_PUSH_THREE_LITERALS, CBC_HAS_LITERAL_ARG2, 3, \ - VM_OC_PUSH_THREE | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_PUSH_UNDEFINED, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_UNDEFINED | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_TRUE, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_TRUE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_FALSE, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_FALSE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_NULL, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_NULL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_THIS, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_THIS | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_NUMBER_0, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_0 | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_NUMBER_POS_BYTE, CBC_HAS_BYTE_ARG, 1, \ - VM_OC_PUSH_POS_BYTE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_NUMBER_NEG_BYTE, CBC_HAS_BYTE_ARG, 1, \ - VM_OC_PUSH_NEG_BYTE | VM_OC_PUT_STACK) \ - /* Note: These 4 opcodes must me in this order */ \ - CBC_OPCODE (CBC_PUSH_PROP, CBC_NO_FLAG, -1, \ - VM_OC_PROP_GET | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_LITERAL, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_PROP_GET | VM_OC_GET_STACK_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_LITERAL_LITERAL, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \ - VM_OC_PROP_GET | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_THIS_LITERAL, CBC_HAS_LITERAL_ARG, 1, \ - VM_OC_PROP_GET | VM_OC_GET_THIS_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_IDENT_REFERENCE, CBC_HAS_LITERAL_ARG, 3, \ - VM_OC_IDENT_REFERENCE | VM_OC_PUT_STACK) \ - /* Note: These 4 opcodes must me in this order */ \ - CBC_OPCODE (CBC_PUSH_PROP_REFERENCE, CBC_NO_FLAG, 1, \ - VM_OC_PROP_REFERENCE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG, 2, \ - VM_OC_PROP_REFERENCE | VM_OC_GET_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_LITERAL_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 3, \ - VM_OC_PROP_REFERENCE | VM_OC_GET_LITERAL_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_PUSH_PROP_THIS_LITERAL_REFERENCE, CBC_HAS_LITERAL_ARG, 3, \ - VM_OC_PROP_REFERENCE | VM_OC_GET_THIS_LITERAL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_NEW, CBC_HAS_POP_STACK_BYTE_ARG, 0, \ - VM_OC_NEW | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_NEW0, CBC_NO_FLAG, 0, \ - VM_OC_NEW | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_NEW1, CBC_NO_FLAG, -1, \ - VM_OC_NEW | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EVAL, CBC_NO_FLAG, 0, \ - VM_OC_EVAL) \ - CBC_OPCODE (CBC_DEFINE_VARS, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_NONE) \ - CBC_OPCODE (CBC_INITIALIZE_VAR, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_NONE) \ - CBC_OPCODE (CBC_INITIALIZE_VARS, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_NONE) \ - CBC_OPCODE (CBC_SET_BYTECODE_PTR, CBC_NO_FLAG, 0, \ - VM_OC_NONE) \ - CBC_OPCODE (CBC_RETURN, CBC_NO_FLAG, -1, \ - VM_OC_RET | VM_OC_GET_STACK) \ - CBC_OPCODE (CBC_RETURN_WITH_BLOCK, CBC_NO_FLAG, 0, \ - VM_OC_RET) \ - CBC_OPCODE (CBC_RETURN_WITH_LITERAL, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_RET | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_SET_LITERAL_PROPERTY, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_PROPERTY | VM_OC_NON_STATIC_FLAG | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_BREAKPOINT_ENABLED, CBC_NO_FLAG, 0, \ - VM_OC_BREAKPOINT_ENABLED) \ - CBC_OPCODE (CBC_BREAKPOINT_DISABLED, CBC_NO_FLAG, 0, \ - VM_OC_BREAKPOINT_DISABLED) \ - \ - /* Unary opcodes. */ \ - CBC_UNARY_OPERATION (CBC_PLUS, \ - PLUS) \ - CBC_UNARY_OPERATION (CBC_NEGATE, \ - MINUS) \ - CBC_UNARY_OPERATION (CBC_LOGICAL_NOT, \ - NOT) \ - CBC_UNARY_OPERATION (CBC_BIT_NOT, \ - BIT_NOT) \ - CBC_UNARY_OPERATION (CBC_VOID, \ - VOID) \ - CBC_OPCODE (CBC_TYPEOF, CBC_NO_FLAG, 0, \ - VM_OC_TYPEOF | VM_OC_GET_STACK | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_TYPEOF_IDENT, CBC_HAS_LITERAL_ARG, 1, \ - VM_OC_TYPEOF_IDENT | VM_OC_PUT_STACK) \ - \ - /* Binary opcodes. */ \ - CBC_BINARY_OPERATION (CBC_BIT_OR, \ - BIT_OR) \ - CBC_BINARY_OPERATION (CBC_BIT_XOR, \ - BIT_XOR) \ - CBC_BINARY_OPERATION (CBC_BIT_AND, \ - BIT_AND) \ - CBC_BINARY_OPERATION (CBC_EQUAL, \ - EQUAL) \ - CBC_BINARY_OPERATION (CBC_NOT_EQUAL, \ - NOT_EQUAL) \ - CBC_BINARY_OPERATION (CBC_STRICT_EQUAL, \ - STRICT_EQUAL) \ - CBC_BINARY_OPERATION (CBC_STRICT_NOT_EQUAL, \ - STRICT_NOT_EQUAL) \ - CBC_BINARY_OPERATION (CBC_LESS, \ - LESS) \ - CBC_BINARY_OPERATION (CBC_GREATER, \ - GREATER) \ - CBC_BINARY_OPERATION (CBC_LESS_EQUAL, \ - LESS_EQUAL) \ - CBC_BINARY_OPERATION (CBC_GREATER_EQUAL, \ - GREATER_EQUAL) \ - CBC_BINARY_OPERATION (CBC_IN, \ - IN) \ - CBC_BINARY_OPERATION (CBC_INSTANCEOF, \ - INSTANCEOF) \ - CBC_BINARY_OPERATION (CBC_LEFT_SHIFT, \ - LEFT_SHIFT) \ - CBC_BINARY_OPERATION (CBC_RIGHT_SHIFT, \ - RIGHT_SHIFT) \ - CBC_BINARY_OPERATION (CBC_UNS_RIGHT_SHIFT, \ - UNS_RIGHT_SHIFT) \ - CBC_BINARY_OPERATION (CBC_ADD, \ - ADD) \ - CBC_BINARY_OPERATION (CBC_SUBTRACT, \ - SUB) \ - CBC_BINARY_OPERATION (CBC_MULTIPLY, \ - MUL) \ - CBC_BINARY_OPERATION (CBC_DIVIDE, \ - DIV) \ - CBC_BINARY_OPERATION (CBC_MODULO, \ - MOD) \ - \ - /* Unary lvalue opcodes. */ \ - CBC_OPCODE (CBC_DELETE_PUSH_RESULT, CBC_NO_FLAG, -1, \ - VM_OC_PROP_DELETE | VM_OC_GET_STACK_STACK | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_DELETE_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 1, \ - VM_OC_DELETE | VM_OC_PUT_STACK) \ - CBC_UNARY_LVALUE_OPERATION (CBC_PRE_INCR, \ - PRE_INCR) \ - CBC_UNARY_LVALUE_OPERATION (CBC_PRE_DECR, \ - PRE_DECR) \ - CBC_UNARY_LVALUE_OPERATION (CBC_POST_INCR, \ - POST_INCR) \ - CBC_UNARY_LVALUE_OPERATION (CBC_POST_DECR, \ - POST_DECR) \ - \ - /* Call opcodes. */ \ - CBC_OPCODE (CBC_CALL, CBC_HAS_POP_STACK_BYTE_ARG, -1, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL_PUSH_RESULT, CBC_HAS_POP_STACK_BYTE_ARG, 0, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL_BLOCK, CBC_HAS_POP_STACK_BYTE_ARG, -1, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL_PROP, CBC_HAS_POP_STACK_BYTE_ARG, -3, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL_PROP_PUSH_RESULT, CBC_HAS_POP_STACK_BYTE_ARG, -2, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL_PROP_BLOCK, CBC_HAS_POP_STACK_BYTE_ARG, -3, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL0, CBC_NO_FLAG, -1, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL0_PUSH_RESULT, CBC_NO_FLAG, 0, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL0_BLOCK, CBC_NO_FLAG, -1, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL0_PROP, CBC_NO_FLAG, -3, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL0_PROP_PUSH_RESULT, CBC_NO_FLAG, -2, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL0_PROP_BLOCK, CBC_NO_FLAG, -3, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL1, CBC_NO_FLAG, -2, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL1_PUSH_RESULT, CBC_NO_FLAG, -1, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL1_BLOCK, CBC_NO_FLAG, -2, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL1_PROP, CBC_NO_FLAG, -4, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL1_PROP_PUSH_RESULT, CBC_NO_FLAG, -3, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL1_PROP_BLOCK, CBC_NO_FLAG, -4, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL2, CBC_NO_FLAG, -3, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL2_PUSH_RESULT, CBC_NO_FLAG, -2, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL2_BLOCK, CBC_NO_FLAG, -3, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_CALL2_PROP, CBC_NO_FLAG, -4, \ - VM_OC_CALL) \ - CBC_OPCODE (CBC_CALL2_PROP_PUSH_RESULT, CBC_NO_FLAG, -3, \ - VM_OC_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_CALL2_PROP_BLOCK, CBC_NO_FLAG, -4, \ - VM_OC_CALL | VM_OC_PUT_BLOCK) \ - \ - /* Binary assignment opcodes. */ \ - CBC_OPCODE (CBC_ASSIGN, CBC_NO_FLAG, -3, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE) \ - CBC_OPCODE (CBC_ASSIGN_PUSH_RESULT, CBC_NO_FLAG, -2, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_ASSIGN_BLOCK, CBC_NO_FLAG, -3, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_ASSIGN_SET_IDENT, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT) \ - CBC_OPCODE (CBC_ASSIGN_SET_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_ASSIGN_SET_IDENT_BLOCK, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_ASSIGN | VM_OC_GET_STACK | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT) \ - CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT_PUSH_RESULT, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \ - VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_ASSIGN_LITERAL_SET_IDENT_BLOCK, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_ASSIGN | VM_OC_GET_LITERAL | VM_OC_PUT_IDENT | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL, CBC_HAS_LITERAL_ARG, -2, \ - VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE) \ - CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL_PUSH_RESULT, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_ASSIGN_PROP_LITERAL_BLOCK, CBC_HAS_LITERAL_ARG, -2, \ - VM_OC_ASSIGN_PROP | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE) \ - CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL_PUSH_RESULT, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_ASSIGN_PROP_THIS_LITERAL_BLOCK, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_ASSIGN_PROP_THIS | VM_OC_GET_LITERAL | VM_OC_PUT_REFERENCE | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_MOV_IDENT, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_MOV_IDENT | VM_OC_GET_STACK | VM_OC_PUT_IDENT) \ - \ - /* Last opcode (not a real opcode). */ \ - CBC_OPCODE (CBC_END, CBC_NO_FLAG, 0, \ - VM_OC_NONE) - -/* All EXT branches are statement block end - * marks, so they are always forward branches. */ - -#define CBC_EXT_OPCODE_LIST \ - /* Branch opcodes first. Some other opcodes are mixed. */ \ - CBC_OPCODE (CBC_EXT_NOP, CBC_NO_FLAG, 0, \ - VM_OC_NONE) \ - CBC_FORWARD_BRANCH (CBC_EXT_WITH_CREATE_CONTEXT, \ - -1 + PARSER_WITH_CONTEXT_STACK_ALLOCATION, VM_OC_WITH) \ - CBC_OPCODE (CBC_EXT_FOR_IN_GET_NEXT, CBC_NO_FLAG, 1, \ - VM_OC_FOR_IN_GET_NEXT | VM_OC_PUT_STACK) \ - CBC_FORWARD_BRANCH (CBC_EXT_FOR_IN_CREATE_CONTEXT, \ - -1 + PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION, VM_OC_FOR_IN_CREATE_CONTEXT) \ - CBC_OPCODE (CBC_EXT_SET_GETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_GETTER | VM_OC_NON_STATIC_FLAG | VM_OC_GET_LITERAL_LITERAL) \ - CBC_BACKWARD_BRANCH (CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT, 0, \ - VM_OC_FOR_IN_HAS_NEXT) \ - CBC_OPCODE (CBC_EXT_FOR_OF_GET_NEXT, CBC_NO_FLAG, 1, \ - VM_OC_FOR_OF_GET_NEXT | VM_OC_PUT_STACK) \ - CBC_FORWARD_BRANCH (CBC_EXT_FOR_OF_CREATE_CONTEXT, \ - -1 + PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION, VM_OC_FOR_OF_CREATE_CONTEXT) \ - CBC_OPCODE (CBC_EXT_PUSH_NAMED_FUNC_EXPRESSION, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 1, \ - VM_OC_PUSH_NAMED_FUNC_EXPR | VM_OC_GET_LITERAL_LITERAL) \ - CBC_BACKWARD_BRANCH (CBC_EXT_BRANCH_IF_FOR_OF_HAS_NEXT, 0, \ - VM_OC_FOR_OF_HAS_NEXT) \ - CBC_OPCODE (CBC_EXT_SET_SETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_SETTER | VM_OC_NON_STATIC_FLAG | VM_OC_GET_LITERAL_LITERAL) \ - CBC_FORWARD_BRANCH (CBC_EXT_TRY_CREATE_CONTEXT, PARSER_TRY_CONTEXT_STACK_ALLOCATION, \ - VM_OC_TRY) \ - CBC_OPCODE (CBC_EXT_THROW_REFERENCE_ERROR, CBC_NO_FLAG, 1, \ - VM_OC_THROW_REFERENCE_ERROR) \ - CBC_FORWARD_BRANCH (CBC_EXT_CATCH, 1, \ - VM_OC_CATCH) \ - CBC_OPCODE (CBC_EXT_PUSH_UNDEFINED_BASE, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_UNDEFINED_BASE | VM_OC_PUT_STACK) \ - CBC_FORWARD_BRANCH (CBC_EXT_FINALLY, 0, \ - VM_OC_FINALLY) \ - CBC_OPCODE (CBC_EXT_CLASS_EXPR_CONTEXT_END, CBC_NO_FLAG, 0, \ - VM_OC_CLASS_EXPR_CONTEXT_END) \ - CBC_FORWARD_BRANCH (CBC_EXT_SUPER_CLASS_CREATE_CONTEXT, \ - -1 + PARSER_SUPER_CLASS_CONTEXT_STACK_ALLOCATION, VM_OC_CLASS_HERITAGE) \ - \ - /* Basic opcodes. */ \ - CBC_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_0, CBC_HAS_LITERAL_ARG, 2, \ - VM_OC_PUSH_LIT_0 | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_POS_BYTE, CBC_HAS_LITERAL_ARG | CBC_HAS_BYTE_ARG, 2, \ - VM_OC_PUSH_LIT_POS_BYTE | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_NEG_BYTE, CBC_HAS_LITERAL_ARG | CBC_HAS_BYTE_ARG, 2, \ - VM_OC_PUSH_LIT_NEG_BYTE | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_EXT_RESOURCE_NAME, CBC_NO_FLAG, 0, \ - VM_OC_RESOURCE_NAME) \ - CBC_OPCODE (CBC_EXT_LINE, CBC_NO_FLAG, 0, \ - VM_OC_LINE) \ - CBC_OPCODE (CBC_EXT_SET_COMPUTED_PROPERTY, CBC_NO_FLAG, -2, \ - VM_OC_SET_COMPUTED_PROPERTY | VM_OC_NON_STATIC_FLAG | VM_OC_GET_STACK_STACK) \ - CBC_OPCODE (CBC_EXT_SET_COMPUTED_PROPERTY_LITERAL, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_COMPUTED_PROPERTY | VM_OC_NON_STATIC_FLAG | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_COMPUTED_GETTER, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_GETTER | VM_OC_NON_STATIC_FLAG | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_COMPUTED_SETTER, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_SETTER | VM_OC_NON_STATIC_FLAG | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_PROPERTY_LITERAL, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_PROPERTY | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_COMPUTED_PROPERTY_LITERAL, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_COMPUTED_PROPERTY | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_GETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_GETTER | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_SETTER, CBC_HAS_LITERAL_ARG | CBC_HAS_LITERAL_ARG2, 0, \ - VM_OC_SET_SETTER | VM_OC_GET_LITERAL_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_COMPUTED_GETTER, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_GETTER | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_SET_STATIC_COMPUTED_SETTER, CBC_HAS_LITERAL_ARG, -1, \ - VM_OC_SET_SETTER | VM_OC_GET_STACK_LITERAL) \ - CBC_OPCODE (CBC_EXT_RESOLVE_BASE, CBC_NO_FLAG, 0, \ - VM_OC_RESOLVE_BASE_FOR_CALL) \ - \ - /* Class opcodes */ \ - CBC_OPCODE (CBC_EXT_INHERIT_AND_SET_CONSTRUCTOR, CBC_NO_FLAG, 0, \ - VM_OC_CLASS_INHERITANCE) \ - CBC_OPCODE (CBC_EXT_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE, CBC_NO_FLAG, 2, \ - VM_OC_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_IMPLICIT_CONSTRUCTOR_CALL, CBC_NO_FLAG, 0, \ - VM_OC_PUSH_IMPL_CONSTRUCTOR) \ - CBC_OPCODE (CBC_EXT_SET_CLASS_LITERAL, CBC_HAS_LITERAL_ARG, 0, \ - VM_OC_SET_CLASS_CONSTRUCTOR | VM_OC_GET_LITERAL) \ - CBC_OPCODE (CBC_EXT_CLASS_EVAL, CBC_HAS_BYTE_ARG, 0, \ - VM_OC_CLASS_EVAL) \ - CBC_OPCODE (CBC_EXT_SUPER_CALL, CBC_HAS_POP_STACK_BYTE_ARG, -1, \ - VM_OC_SUPER_CALL) \ - CBC_OPCODE (CBC_EXT_SUPER_CALL_PUSH_RESULT, CBC_HAS_POP_STACK_BYTE_ARG, 0, \ - VM_OC_SUPER_CALL | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_SUPER_CALL_BLOCK, CBC_HAS_POP_STACK_BYTE_ARG, -1, \ - VM_OC_SUPER_CALL | VM_OC_PUT_BLOCK) \ - CBC_OPCODE (CBC_EXT_PUSH_CONSTRUCTOR_SUPER, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_CONSTRUCTOR_SUPER | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_PUSH_CONSTRUCTOR_SUPER_PROP, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_CONSTRUCTOR_SUPER | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_PUSH_SUPER, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_SUPER | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_PUSH_STATIC_SUPER, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_SUPER | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_PUSH_CONSTRUCTOR_THIS, CBC_NO_FLAG, 1, \ - VM_OC_PUSH_CONSTRUCTOR_THIS | VM_OC_PUT_STACK) \ - CBC_OPCODE (CBC_EXT_SUPER_PROP_CALL, CBC_NO_FLAG, 0, \ - VM_OC_SUPER_PROP_REFERENCE) \ - CBC_OPCODE (CBC_EXT_SUPER_PROP_ASSIGN, CBC_NO_FLAG, 0, \ - VM_OC_SUPER_PROP_REFERENCE) \ - CBC_OPCODE (CBC_EXT_CONSTRUCTOR_RETURN, CBC_NO_FLAG, -1, \ - VM_OC_CONSTRUCTOR_RET | VM_OC_GET_STACK) \ - CBC_OPCODE (CBC_EXT_ERROR, CBC_NO_FLAG, 0, \ - VM_OC_ERROR) \ - \ - /* Last opcode (not a real opcode). */ \ - CBC_OPCODE (CBC_EXT_END, CBC_NO_FLAG, 0, \ - VM_OC_NONE) - -#define CBC_MAXIMUM_BYTE_VALUE 255 -#define CBC_MAXIMUM_SMALL_VALUE 510 -#define CBC_MAXIMUM_FULL_VALUE 32767 - -#define CBC_PUSH_NUMBER_BYTE_RANGE_END 256 - -#define CBC_HIGHEST_BIT_MASK 0x80 -#define CBC_LOWER_SEVEN_BIT_MASK 0x7f - -/** - * Literal encoding limit when full literal encoding mode is enabled - */ -#define CBC_FULL_LITERAL_ENCODING_LIMIT 128 - -/** - * Literal encoding delta when full literal encoding mode is enabled - */ -#define CBC_FULL_LITERAL_ENCODING_DELTA 0x8000 - -/** - * Literal encoding limit when full literal encoding mode is disabled - */ -#define CBC_SMALL_LITERAL_ENCODING_LIMIT 255 - -/** - * Literal encoding delta when full literal encoding mode is disabled - */ -#define CBC_SMALL_LITERAL_ENCODING_DELTA 0xfe01 - -/** - * Literal indicies belong to one of the following groups: - * - * 0 <= index < argument_end : arguments - * argument_end <= index < register_end : registers - * register_end <= index < ident_end : identifiers - * ident_end <= index < const_literal_end : constant literals - * const_literal_end <= index < literal_end : template literals - */ - -/** - * Compiled byte code arguments. - */ -typedef struct -{ - ecma_compiled_code_t header; /**< compiled code header */ - uint8_t stack_limit; /**< maximum number of values stored on the stack */ - uint8_t argument_end; /**< number of arguments expected by the function */ - uint8_t register_end; /**< end position of the register group */ - uint8_t ident_end; /**< end position of the identifier group */ - uint8_t const_literal_end; /**< end position of the const literal group */ - uint8_t literal_end; /**< end position of the literal group */ -} cbc_uint8_arguments_t; - -/** - * Compiled byte code arguments. - */ -typedef struct -{ - ecma_compiled_code_t header; /**< compiled code header */ - uint16_t stack_limit; /**< maximum number of values stored on the stack */ - uint16_t argument_end; /**< number of arguments expected by the function */ - uint16_t register_end; /**< end position of the register group */ - uint16_t ident_end; /**< end position of the identifier group */ - uint16_t const_literal_end; /**< end position of the const literal group */ - uint16_t literal_end; /**< end position of the literal group */ - uint16_t padding; /**< an unused value */ -} cbc_uint16_arguments_t; - -/** - * Compact byte code status flags. - */ -typedef enum -{ - CBC_CODE_FLAGS_FUNCTION = (1u << 0), /**< compiled code is JavaScript function */ - CBC_CODE_FLAGS_FULL_LITERAL_ENCODING = (1u << 1), /**< full literal encoding mode is enabled */ - CBC_CODE_FLAGS_UINT16_ARGUMENTS = (1u << 2), /**< compiled code data is cbc_uint16_arguments_t */ - CBC_CODE_FLAGS_STRICT_MODE = (1u << 3), /**< strict mode is enabled */ - CBC_CODE_FLAGS_ARGUMENTS_NEEDED = (1u << 4), /**< arguments object must be constructed */ - CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED = (1u << 5), /**< no need to create a lexical environment */ - CBC_CODE_FLAGS_ARROW_FUNCTION = (1u << 6), /**< this function is an arrow function */ - CBC_CODE_FLAGS_STATIC_FUNCTION = (1u << 7), /**< this function is a static snapshot function */ - CBC_CODE_FLAGS_DEBUGGER_IGNORE = (1u << 8), /**< this function should be ignored by debugger */ - CBC_CODE_FLAGS_CONSTRUCTOR = (1u << 9), /**< this function is a constructor */ - CBC_CODE_FLAGS_REST_PARAMETER = (1u << 10), /**< this function has rest parameter */ -} cbc_code_flags; - -/** - * Non-strict arguments object must be constructed - */ -#define CBC_NON_STRICT_ARGUMENTS_NEEDED(compiled_code_p) \ - (((compiled_code_p)->status_flags & CBC_CODE_FLAGS_ARGUMENTS_NEEDED) \ - && !((compiled_code_p)->status_flags & CBC_CODE_FLAGS_STRICT_MODE)) - -#define CBC_OPCODE(arg1, arg2, arg3, arg4) arg1, - -/** - * Opcode list. - */ -typedef enum -{ - CBC_OPCODE_LIST /**< list of opcodes */ -} cbc_opcode_t; - -/** - * Extended opcode list. - */ -typedef enum -{ - CBC_EXT_OPCODE_LIST /**< list extended opcodes */ -} cbc_ext_opcode_t; - -#undef CBC_OPCODE - -/** - * Opcode flags. - */ -extern const uint8_t cbc_flags[]; -extern const uint8_t cbc_ext_flags[]; - -#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) - -/** - * Opcode names for debugging. - */ -extern const char * const cbc_names[]; -extern const char * const cbc_ext_names[]; - -#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */ - -/** - * @} - * @} - * @} - */ - -#endif /* !BYTE_CODE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/common.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/common.h deleted file mode 100644 index 184797722..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/common.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef COMMON_H -#define COMMON_H - -#include -#include -#include -#include -#include - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_utils Utility - * @{ - */ - -#include "config.h" -#include "ecma-globals.h" -#include "ecma-regexp-object.h" -#include "jmem.h" - -/* Immediate management. */ - -/** - * Literal types. - * - * The LEXER_UNUSED_LITERAL type is internal and - * used for various purposes. - */ -typedef enum -{ - /* The LEXER_IS_IDENT_OR_STRING macro must be updated if the order is changed. */ - LEXER_IDENT_LITERAL = 0, /**< identifier literal */ - LEXER_STRING_LITERAL = 1, /**< string literal */ - LEXER_NUMBER_LITERAL = 2, /**< number literal */ - LEXER_FUNCTION_LITERAL = 3, /**< function literal */ - LEXER_REGEXP_LITERAL = 4, /**< regexp literal */ - LEXER_UNUSED_LITERAL = 5, /**< unused literal, can only be - used by the byte code generator. */ -} lexer_literal_type_t; - -/** - * Checks whether the literal type is identifier or string. - */ -#define LEXER_IS_IDENT_OR_STRING(literal_type) ((literal_type) <= LEXER_STRING_LITERAL) - -/** - * Flag bits for status_flags member of lexer_literal_t. - */ -typedef enum -{ - LEXER_FLAG_VAR = (1 << 0), /**< local identifier (var, function arg) */ - LEXER_FLAG_NO_REG_STORE = (1 << 1), /**< this local identifier cannot be stored in register */ - LEXER_FLAG_INITIALIZED = (1 << 2), /**< this local identifier is initialized with a value */ - LEXER_FLAG_FUNCTION_ARGUMENT = (1 << 3), /**< this local identifier is a function argument */ - LEXER_FLAG_UNUSED_IDENT = (1 << 4), /**< this identifier is referenced by sub-functions, - * but not referenced by the currently parsed function */ - LEXER_FLAG_SOURCE_PTR = (1 << 5), /**< the literal is directly referenced in the source code - * (no need to allocate memory) */ - LEXER_FLAG_LATE_INIT = (1 << 6), /**< initialize this variable after the byte code is freed */ -} lexer_literal_status_flags_t; - -/** - * Type of property length. - */ -#if ENABLED (JERRY_CPOINTER_32_BIT) -typedef uint32_t prop_length_t; -#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */ -typedef uint16_t prop_length_t; -#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */ - -/** - * Literal data. - */ -typedef struct -{ - union - { - ecma_value_t value; /**< literal value (not processed by the parser) */ - const uint8_t *char_p; /**< character value */ - ecma_compiled_code_t *bytecode_p; /**< compiled function or regexp pointer */ - uint32_t source_data; /**< encoded source literal */ - } u; - -#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) - struct -#else /* !ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */ - union -#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */ - { - prop_length_t length; /**< length of ident / string literal */ - uint16_t index; /**< real index during post processing */ - } prop; - - uint8_t type; /**< type of the literal */ - uint8_t status_flags; /**< status flags */ -} lexer_literal_t; - -void util_free_literal (lexer_literal_t *literal_p); - -#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) -void util_print_literal (lexer_literal_t *); -#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */ - -/* TRY/CATCH block */ - -#define PARSER_TRY_CONTEXT(context_name) \ - jmp_buf context_name - -#define PARSER_THROW(context_name) \ - longjmp (context_name, 1); - -#define PARSER_TRY(context_name) \ - { \ - if (!setjmp (context_name)) \ - { \ - -#define PARSER_CATCH \ - } \ - else \ - { - -#define PARSER_TRY_END \ - } \ - } - -/** - * @} - * @} - * @} - */ - -#endif /* !COMMON_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/debugger.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/debugger.h deleted file mode 100644 index d18825632..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/debugger.h +++ /dev/null @@ -1,494 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef DEBUGGER_H -#define DEBUGGER_H - -#include "ecma-globals.h" -#include "jerryscript-debugger-transport.h" - -#if ENABLED (JERRY_DEBUGGER) - -/* JerryScript debugger protocol is a simplified version of RFC-6455 (WebSockets). */ - -/** - * Frequency of calling jerry_debugger_receive() by the VM. - */ -#define JERRY_DEBUGGER_MESSAGE_FREQUENCY 5 - -/** - * This constant represents that the string to be sent has no subtype. - */ -#define JERRY_DEBUGGER_NO_SUBTYPE 0 - -/** - * Limited resources available for the engine, so it is important to - * check the maximum buffer size. It needs to be between 64 and 256 bytes. - */ -#if JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE < 64 || JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE > 256 -#error Please define the MAX_BUFFER_SIZE between 64 and 256 bytes. -#endif /* JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE < 64 || JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE > 256 */ - -/** - * Calculate the maximum number of items for a given type - * which can be transmitted in one message. - */ -#define JERRY_DEBUGGER_SEND_MAX(type) \ - ((size_t) ((JERRY_CONTEXT (debugger_max_send_size) - sizeof (jerry_debugger_send_type_t)) / sizeof (type))) - -/** - * Calculate the size of a message when a count number of items transmitted. - */ -#define JERRY_DEBUGGER_SEND_SIZE(count, type) \ - ((size_t) ((count * sizeof (type)) + sizeof (jerry_debugger_send_type_t))) - -/** - * Debugger operation modes: - * - * The debugger has two operation modes: run mode and breakpoint mode. - * - * In run mode the debugger server accepts only a limited number of message - * types from the debugger client (e.g. stop execution, set breakpoint). - * - * In breakpoint mode the JavaScript execution is stopped at a breakpoint and - * more message types are accepted (e.g. get backtrace, evaluate expression). - * - * Switching between modes: - * - * When the JavaScript execution stops at a breakpoint the server sends a - * JERRY_DEBUGGER_BREAKPOINT_HIT message to the client. The client can only - * issue breakpoint mode commands after this message is received. - * - * Certain breakpoint mode commands (e.g. continue) resumes the JavaScript - * execution and the client must not send any breakpoint mode messages - * until the JERRY_DEBUGGER_BREAKPOINT_HIT is received again. - * - * The debugger server starts in run mode but stops at the first available - * breakpoint. - */ - -/** - * Debugger option flags. - */ -typedef enum -{ - JERRY_DEBUGGER_CONNECTED = 1u << 0, /**< debugger is connected */ - JERRY_DEBUGGER_BREAKPOINT_MODE = 1u << 1, /**< debugger waiting at a breakpoint */ - JERRY_DEBUGGER_VM_STOP = 1u << 2, /**< stop at the next breakpoint even if disabled */ - JERRY_DEBUGGER_VM_IGNORE = 1u << 3, /**< ignore all breakpoints */ - JERRY_DEBUGGER_VM_IGNORE_EXCEPTION = 1u << 4, /**< debugger doesn't stop at any exception */ - JERRY_DEBUGGER_VM_EXCEPTION_THROWN = 1u << 5, /**< no need to stop for this exception */ - JERRY_DEBUGGER_PARSER_WAIT = 1u << 6, /**< debugger should wait after parsing is completed */ - JERRY_DEBUGGER_PARSER_WAIT_MODE = 1u << 7, /**< debugger is waiting after parsing is completed */ - JERRY_DEBUGGER_CLIENT_SOURCE_MODE = 1u << 8, /**< debugger waiting for client code */ - JERRY_DEBUGGER_CLIENT_NO_SOURCE = 1u << 9, /**< debugger leaving the client source loop */ - JERRY_DEBUGGER_CONTEXT_RESET_MODE = 1u << 10, /**< debugger and engine reinitialization mode */ -#ifdef ACE_DEBUGGER_CUSTOM - JERRY_DEBUGGER_TRANSPORT_STARTED = 1u << 11, /**< only can send data to client after this flag set */ -#endif -} jerry_debugger_flags_t; - -/** - * Set debugger flags. - */ -#define JERRY_DEBUGGER_SET_FLAGS(flags) \ - JERRY_CONTEXT (debugger_flags) = (JERRY_CONTEXT (debugger_flags) | (uint32_t) (flags)) - -/** - * Clear debugger flags. - */ -#define JERRY_DEBUGGER_CLEAR_FLAGS(flags) \ - JERRY_CONTEXT (debugger_flags) = (JERRY_CONTEXT (debugger_flags) & (uint32_t) ~(flags)) - -/** - * Set and clear debugger flags. - */ -#define JERRY_DEBUGGER_UPDATE_FLAGS(flags_to_set, flags_to_clear) \ - JERRY_CONTEXT (debugger_flags) = ((JERRY_CONTEXT (debugger_flags) | (uint32_t) (flags_to_set)) \ - & (uint32_t) ~(flags_to_clear)) - -/** - * Types for the package. - */ -typedef enum -{ - /* Messages sent by the server to client. */ - /* This is a handshake message, sent once during initialization. */ - JERRY_DEBUGGER_CONFIGURATION = 1, /**< debugger configuration */ - /* These messages are sent by the parser. */ - JERRY_DEBUGGER_PARSE_ERROR = 2, /**< parse error */ - JERRY_DEBUGGER_BYTE_CODE_CP = 3, /**< byte code compressed pointer */ - JERRY_DEBUGGER_PARSE_FUNCTION = 4, /**< parsing a new function */ - JERRY_DEBUGGER_BREAKPOINT_LIST = 5, /**< list of line offsets */ - JERRY_DEBUGGER_BREAKPOINT_OFFSET_LIST = 6, /**< list of byte code offsets */ - JERRY_DEBUGGER_SOURCE_CODE = 7, /**< source code fragment */ - JERRY_DEBUGGER_SOURCE_CODE_END = 8, /**< source code last fragment */ - JERRY_DEBUGGER_SOURCE_CODE_NAME = 9, /**< source code name fragment */ - JERRY_DEBUGGER_SOURCE_CODE_NAME_END = 10, /**< source code name last fragment */ - JERRY_DEBUGGER_FUNCTION_NAME = 11, /**< function name fragment */ - JERRY_DEBUGGER_FUNCTION_NAME_END = 12, /**< function name last fragment */ - JERRY_DEBUGGER_WAITING_AFTER_PARSE = 13, /**< engine waiting for a parser resume */ - /* These messages are generic messages. */ - JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP = 14, /**< invalidate byte code compressed pointer */ - JERRY_DEBUGGER_MEMSTATS_RECEIVE = 15, /**< memstats sent to the client */ - JERRY_DEBUGGER_BREAKPOINT_HIT = 16, /**< notify breakpoint hit */ - JERRY_DEBUGGER_EXCEPTION_HIT = 17, /**< notify exception hit */ - JERRY_DEBUGGER_EXCEPTION_STR = 18, /**< exception string fragment */ - JERRY_DEBUGGER_EXCEPTION_STR_END = 19, /**< exception string last fragment */ - JERRY_DEBUGGER_BACKTRACE_TOTAL = 20, /**< number of total frames */ - JERRY_DEBUGGER_BACKTRACE = 21, /**< backtrace data */ - JERRY_DEBUGGER_BACKTRACE_END = 22, /**< last backtrace data */ - JERRY_DEBUGGER_EVAL_RESULT = 23, /**< eval result */ - JERRY_DEBUGGER_EVAL_RESULT_END = 24, /**< last part of eval result */ - JERRY_DEBUGGER_WAIT_FOR_SOURCE = 25, /**< engine waiting for source code */ - JERRY_DEBUGGER_OUTPUT_RESULT = 26, /**< output sent by the program to the debugger */ - JERRY_DEBUGGER_OUTPUT_RESULT_END = 27, /**< last output result data */ - JERRY_DEBUGGER_SCOPE_CHAIN = 28, /**< scope chain */ - JERRY_DEBUGGER_SCOPE_CHAIN_END = 29, /**< last output of scope chain */ - JERRY_DEBUGGER_SCOPE_VARIABLES = 30, /**< scope variables */ - JERRY_DEBUGGER_SCOPE_VARIABLES_END = 31, /**< last output of scope variables */ - JERRY_DEBUGGER_CLOSE_CONNECTION = 32, /**< close connection with the client */ - JERRY_DEBUGGER_MESSAGES_OUT_MAX_COUNT, /**< number of different type of output messages by the debugger */ - - /* Messages sent by the client to server. */ - - /* The following messages are accepted in both run and breakpoint modes. */ - JERRY_DEBUGGER_FREE_BYTE_CODE_CP = 1, /**< free byte code compressed pointer */ - JERRY_DEBUGGER_UPDATE_BREAKPOINT = 2, /**< update breakpoint status */ - JERRY_DEBUGGER_EXCEPTION_CONFIG = 3, /**< exception handler config */ - JERRY_DEBUGGER_PARSER_CONFIG = 4, /**< parser config */ - JERRY_DEBUGGER_MEMSTATS = 5, /**< list memory statistics */ - JERRY_DEBUGGER_STOP = 6, /**< stop execution */ - /* The following message is only available in waiting after parse mode. */ - JERRY_DEBUGGER_PARSER_RESUME = 7, /**< stop waiting after parse */ - /* The following four messages are only available in client switch mode. */ - JERRY_DEBUGGER_CLIENT_SOURCE = 8, /**< first message of client source */ - JERRY_DEBUGGER_CLIENT_SOURCE_PART = 9, /**< next message of client source */ - JERRY_DEBUGGER_NO_MORE_SOURCES = 10, /**< no more sources notification */ - JERRY_DEBUGGER_CONTEXT_RESET = 11, /**< context reset request */ - /* The following messages are only available in breakpoint - * mode and they switch the engine to run mode. */ - JERRY_DEBUGGER_CONTINUE = 12, /**< continue execution */ - JERRY_DEBUGGER_STEP = 13, /**< next breakpoint, step into functions */ - JERRY_DEBUGGER_NEXT = 14, /**< next breakpoint in the same context */ - JERRY_DEBUGGER_FINISH = 15, /**< Continue running just after the function in the current stack frame returns */ - /* The following messages are only available in breakpoint - * mode and this mode is kept after the message is processed. */ - JERRY_DEBUGGER_GET_BACKTRACE = 16, /**< get backtrace */ - JERRY_DEBUGGER_EVAL = 17, /**< first message of evaluating a string */ - JERRY_DEBUGGER_EVAL_PART = 18, /**< next message of evaluating a string */ - JERRY_DEBUGGER_GET_SCOPE_CHAIN = 19, /**< get type names of the scope chain */ - JERRY_DEBUGGER_GET_SCOPE_VARIABLES = 20, /**< get variables of a scope */ - JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT, /**< number of different type of input messages */ -} jerry_debugger_header_type_t; - -/** - * Debugger option flags. - */ -typedef enum -{ - JERRY_DEBUGGER_LITTLE_ENDIAN = 1u << 0, /**< little endian */ -} jerry_debugger_configuration_flags_t; - -/** - * Subtypes of eval. - */ -typedef enum -{ - JERRY_DEBUGGER_EVAL_EVAL = 0, /**< evaluate expression */ - JERRY_DEBUGGER_EVAL_THROW = 1, /**< evaluate expression and throw the result */ - JERRY_DEBUGGER_EVAL_ABORT = 2, /**< evaluate expression and abrot with the result */ -} jerry_debugger_eval_type_t; - -/** - * Subtypes of eval_result. - */ -typedef enum -{ - JERRY_DEBUGGER_EVAL_OK = 1, /**< eval result, no error */ - JERRY_DEBUGGER_EVAL_ERROR = 2, /**< eval result when an error has occurred */ -} jerry_debugger_eval_result_type_t; - -/** - * Subtypes of output_result. - * - * Note: - * This enum has to be kept in sync with jerry_log_level_t with an offset - * of +2. - */ -typedef enum -{ - JERRY_DEBUGGER_OUTPUT_OK = 1, /**< output result, no error */ - JERRY_DEBUGGER_OUTPUT_ERROR = 2, /**< output result, error */ - JERRY_DEBUGGER_OUTPUT_WARNING = 3, /**< output result, warning */ - JERRY_DEBUGGER_OUTPUT_DEBUG = 4, /**< output result, debug */ - JERRY_DEBUGGER_OUTPUT_TRACE = 5, /**< output result, trace */ -} jerry_debugger_output_subtype_t; - -/** - * Types of scopes. - */ -typedef enum -{ - JERRY_DEBUGGER_SCOPE_WITH = 1, /**< with */ - JERRY_DEBUGGER_SCOPE_LOCAL = 2, /**< local */ - JERRY_DEBUGGER_SCOPE_CLOSURE = 3, /**< closure */ - JERRY_DEBUGGER_SCOPE_GLOBAL = 4, /**< global */ - JERRY_DEBUGGER_SCOPE_NON_CLOSURE = 5 /**< non closure */ -} jerry_debugger_scope_chain_type_t; - -/** - * Type of scope variables. - */ -typedef enum -{ - JERRY_DEBUGGER_VALUE_NONE = 1, - JERRY_DEBUGGER_VALUE_UNDEFINED = 2, - JERRY_DEBUGGER_VALUE_NULL = 3, - JERRY_DEBUGGER_VALUE_BOOLEAN = 4, - JERRY_DEBUGGER_VALUE_NUMBER = 5, - JERRY_DEBUGGER_VALUE_STRING = 6, - JERRY_DEBUGGER_VALUE_FUNCTION = 7, - JERRY_DEBUGGER_VALUE_ARRAY = 8, - JERRY_DEBUGGER_VALUE_OBJECT = 9 -} jerry_debugger_scope_variable_type_t; - -/** - * Byte data for evaluating expressions and receiving client source. - */ -typedef struct -{ - uint32_t uint8_size; /**< total size of the client source */ - uint32_t uint8_offset; /**< current offset in the client source */ -} jerry_debugger_uint8_data_t; - -/** - * Delayed free of byte code data. - */ -typedef struct -{ - uint16_t size; /**< size of the byte code header divided by JMEM_ALIGNMENT */ - jmem_cpointer_t prev_cp; /**< previous byte code data to be freed */ -} jerry_debugger_byte_code_free_t; - -/** - * Outgoing message: JerryScript configuration. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t configuration; /**< configuration option bits */ - uint8_t version[sizeof (uint32_t)]; /**< debugger version */ - uint8_t max_message_size; /**< maximum incoming message size */ - uint8_t cpointer_size; /**< size of compressed pointers */ -} jerry_debugger_send_configuration_t; - -/** - * Outgoing message: message without arguments. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ -} jerry_debugger_send_type_t; - -/** - * Incoming message: message without arguments. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ -} jerry_debugger_receive_type_t; - -/** - * Outgoing message: string (Source file name or function name). - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t string[]; /**< string data */ -} jerry_debugger_send_string_t; - -/** - * Outgoing message: uint32 value. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t line[sizeof (uint32_t)]; /**< value data */ - uint8_t column[sizeof (uint32_t)]; /**< value data */ -} jerry_debugger_send_parse_function_t; - -/** - * Outgoing message: byte code compressed pointer. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */ -} jerry_debugger_send_byte_code_cp_t; - -/** - * Incoming message: byte code compressed pointer. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */ -} jerry_debugger_receive_byte_code_cp_t; - -/** - * Incoming message: update (enable/disable) breakpoint status. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t is_set_breakpoint; /**< set or clear breakpoint */ - uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */ - uint8_t offset[sizeof (uint32_t)]; /**< breakpoint offset */ -} jerry_debugger_receive_update_breakpoint_t; - -/** - * Outgoing message: send memory statistics - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t allocated_bytes[sizeof (uint32_t)]; /**< allocated bytes */ - uint8_t byte_code_bytes[sizeof (uint32_t)]; /**< byte code bytes */ - uint8_t string_bytes[sizeof (uint32_t)]; /**< string bytes */ - uint8_t object_bytes[sizeof (uint32_t)]; /**< object bytes */ - uint8_t property_bytes[sizeof (uint32_t)]; /**< property bytes */ -} jerry_debugger_send_memstats_t; - -/** - * Outgoing message: notify breakpoint hit. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */ - uint8_t offset[sizeof (uint32_t)]; /**< breakpoint offset */ -} jerry_debugger_send_breakpoint_hit_t; - -/** - * Stack frame descriptor for sending backtrace information. - */ -typedef struct -{ - uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */ - uint8_t offset[sizeof (uint32_t)]; /**< last breakpoint offset */ -} jerry_debugger_frame_t; - -/** - * Outgoing message: backtrace information. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - jerry_debugger_frame_t frames[]; /**< frames */ -} jerry_debugger_send_backtrace_t; - -/** - * Outgoing message: scope chain. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t scope_types[]; /**< scope types */ -} jerry_debugger_send_scope_chain_t; - -/** - * Outgoing message: number of total frames in backtrace. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t frame_count[sizeof (uint32_t)]; /**< total number of frames */ -} jerry_debugger_send_backtrace_total_t; - -/** - * Incoming message: set behaviour when exception occures. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t enable; /**< non-zero: enable stop at exception */ -} jerry_debugger_receive_exception_config_t; - -/** - * Incoming message: set parser configuration. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t enable_wait; /**< non-zero: wait after parsing is completed */ -} jerry_debugger_receive_parser_config_t; - -/** - * Incoming message: get backtrace. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t min_depth[sizeof (uint32_t)]; /**< minimum depth*/ - uint8_t max_depth[sizeof (uint32_t)]; /**< maximum depth (0 - unlimited) */ - uint8_t get_total_frame_count; /**< non-zero: if total frame count is also requested */ -} jerry_debugger_receive_get_backtrace_t; - -/** - * Incoming message: first message of evaluating expression. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t eval_size[sizeof (uint32_t)]; /**< total size of the message */ -} jerry_debugger_receive_eval_first_t; - -/** - * Incoming message: get scope variables -*/ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t chain_index[sizeof (uint32_t)]; /**< index element of the scope */ -} jerry_debugger_receive_get_scope_variables_t; - -/** - * Incoming message: first message of client source. - */ -typedef struct -{ - uint8_t type; /**< type of the message */ - uint8_t code_size[sizeof (uint32_t)]; /**< total size of the message */ -} jerry_debugger_receive_client_source_first_t; - -void jerry_debugger_free_unreferenced_byte_code (void); - -bool jerry_debugger_receive (jerry_debugger_uint8_data_t **message_data_p); - -void jerry_debugger_breakpoint_hit (uint8_t message_type); - -void jerry_debugger_send_type (jerry_debugger_header_type_t type); -bool jerry_debugger_send_configuration (uint8_t max_message_size); -void jerry_debugger_send_data (jerry_debugger_header_type_t type, const void *data, size_t size); -bool jerry_debugger_send_string (uint8_t message_type, uint8_t sub_type, const uint8_t *string_p, size_t string_length); -bool jerry_debugger_send_function_cp (jerry_debugger_header_type_t type, ecma_compiled_code_t *compiled_code_p); -bool jerry_debugger_send_parse_function (uint32_t line, uint32_t column); -void jerry_debugger_send_memstats (void); -bool jerry_debugger_send_exception_string (void); - -#endif /* ENABLED (JERRY_DEBUGGER) */ - -#endif /* !DEBUGGER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-alloc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-alloc.h deleted file mode 100644 index 437931781..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-alloc.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_ALLOC_H -#define ECMA_ALLOC_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaalloc Routines for allocation/freeing memory for ECMA data types - * @{ - */ - -/** - * Allocate memory for ecma-object - * - * @return pointer to allocated memory - */ -ecma_object_t *ecma_alloc_object (void); - -/** - * Dealloc memory from an ecma-object - */ -void ecma_dealloc_object (ecma_object_t *object_p); - -/** - * Allocate memory for extended object - * - * @return pointer to allocated memory - */ -ecma_extended_object_t *ecma_alloc_extended_object (size_t size); - -/** - * Dealloc memory of an extended object - */ -void ecma_dealloc_extended_object (ecma_object_t *object_p, size_t size); - -/** - * Allocate memory for ecma-number - * - * @return pointer to allocated memory - */ -ecma_number_t *ecma_alloc_number (void); - -/** - * Dealloc memory from an ecma-number - */ -void ecma_dealloc_number (ecma_number_t *number_p); - -/** - * Allocate memory for ecma-string descriptor - * - * @return pointer to allocated memory - */ -ecma_string_t *ecma_alloc_string (void); - -/** - * Dealloc memory from ecma-string descriptor - */ -void ecma_dealloc_string (ecma_string_t *string_p); - -/** - * Allocate memory for extended ecma-string descriptor - * - * @return pointer to allocated memory - */ -ecma_extended_string_t *ecma_alloc_extended_string (void); - -/** - * Dealloc memory from extended ecma-string descriptor - */ -void ecma_dealloc_extended_string (ecma_extended_string_t *string_p); - -/** - * Allocate memory for string with character data - * - * @return pointer to allocated memory - */ -ecma_string_t *ecma_alloc_string_buffer (size_t size); - -/** - * Dealloc memory of a string with character data - */ -void ecma_dealloc_string_buffer (ecma_string_t *string_p, size_t size); - -/** - * Allocate memory for ecma-property pair - * - * @return pointer to allocated memory - */ -ecma_property_pair_t *ecma_alloc_property_pair (void); - -/** - * Dealloc memory from an ecma-property pair - */ -void ecma_dealloc_property_pair (ecma_property_pair_t *property_pair_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_ALLOC_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-array-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-array-object.h deleted file mode 100644 index b5de122f9..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-array-object.h +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_ARRAY_OBJECT_H -#define ECMA_ARRAY_OBJECT_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaarrayobject ECMA Array object related routines - * @{ - */ - -/** - * Maximum number of array holes in a fast mode access array. - * If the number of holes exceeds this limit, the array is converted back - * to normal property list based array. - */ -#define ECMA_FAST_ARRAY_MAX_HOLE_COUNT 32 - -/** - * Flags for ecma_op_array_object_set_length - */ -typedef enum -{ - ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_IS_THROW = 1u << 0, /**< is_throw flag is set */ - ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_REJECT = 1u << 1, /**< reject later because the descriptor flags - * contains an unallowed combination */ - ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE_DEFINED = 1u << 2, /**< writable flag defined - * in the property descriptor */ - ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_WRITABLE = 1u << 3, /**< writable flag enabled - * in the property descriptor */ -} ecma_array_object_set_length_flags_t; - -ecma_object_t * -ecma_op_new_array_object (ecma_length_t length); - -ecma_object_t * -ecma_op_new_fast_array_object (ecma_length_t length); - -ecma_value_t * -ecma_fast_array_extend (ecma_object_t *object_p, uint32_t new_lengt); - -bool -ecma_fast_array_set_property (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value); - -void -ecma_array_object_delete_property (ecma_object_t *object_p, ecma_string_t *property_name_p, - ecma_property_value_t *prop_value_p); - -ecma_collection_t * -ecma_fast_array_get_property_names (ecma_object_t *object_p, uint32_t opts); - -void -ecma_fast_array_convert_to_normal (ecma_object_t *object_p); - -ecma_value_t -ecma_op_create_array_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len, - bool is_treat_single_arg_as_length); - -#if ENABLED (JERRY_ES2015_CLASS) -ecma_value_t -ecma_op_create_array_object_by_constructor (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len, - bool is_treat_single_arg_as_length, ecma_object_t *object_p); -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -ecma_value_t -ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint32_t flags); - -ecma_value_t -ecma_op_array_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p, - const ecma_property_descriptor_t *property_desc_p); - -void -ecma_op_array_list_lazy_property_names (ecma_object_t *obj_p, bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_ARRAY_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-arraybuffer-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-arraybuffer-object.h deleted file mode 100644 index a77deb500..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-arraybuffer-object.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_ARRAYBUFFER_OBJECT_H -#define ECMA_ARRAYBUFFER_OBJECT_H - -#include "ecma-globals.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines - * @{ - */ - -ecma_value_t -ecma_op_create_arraybuffer_object (const ecma_value_t *, ecma_length_t); - -/** - * Helper functions for arraybuffer. - */ -ecma_object_t * -ecma_arraybuffer_new_object (ecma_length_t lengh); -ecma_object_t * -ecma_arraybuffer_new_object_external (ecma_length_t length, - void *buffer_p, - ecma_object_native_free_callback_t free_cb); -lit_utf8_byte_t * JERRY_ATTR_PURE -ecma_arraybuffer_get_buffer (ecma_object_t *obj_p); -ecma_length_t JERRY_ATTR_PURE -ecma_arraybuffer_get_length (ecma_object_t *obj_p); -bool -ecma_is_arraybuffer (ecma_value_t val); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ -#endif /* !ECMA_ARRAYBUFFER_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-boolean-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-boolean-object.h deleted file mode 100644 index adf0353d8..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-boolean-object.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_BOOLEAN_OBJECT_H -#define ECMA_BOOLEAN_OBJECT_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmabooleanobject ECMA Boolean object related routines - * @{ - */ - -ecma_value_t ecma_op_create_boolean_object (ecma_value_t arg); - -/** - * @} - * @} - */ - -#endif /* !ECMA_BOOLEAN_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-iterator-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-iterator-prototype.inc.h deleted file mode 100644 index f7ec656ad..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-iterator-prototype.inc.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %ArrayIteratorPrototype% built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) - -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_ARRAY_ITERATOR_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_array_iterator_prototype_object_next, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-prototype.inc.h deleted file mode 100644 index ad86d85e7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array-prototype.inc.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Array.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ARRAY) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.4.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Number properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.4.4 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FLAG_WRITABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_ARRAY_PROTOTYPE_TO_LOCALE_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_CONCAT, ECMA_ARRAY_PROTOTYPE_CONCAT, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_JOIN, ECMA_ARRAY_PROTOTYPE_JOIN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_POP, ECMA_ARRAY_PROTOTYPE_POP, 0, 0) -ROUTINE (LIT_MAGIC_STRING_PUSH, ECMA_ARRAY_PROTOTYPE_PUSH, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_REVERSE, ECMA_ARRAY_PROTOTYPE_REVERSE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_SHIFT, ECMA_ARRAY_PROTOTYPE_SHIFT, 0, 0) -ROUTINE (LIT_MAGIC_STRING_SLICE, ECMA_ARRAY_PROTOTYPE_SLICE, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SORT, ECMA_ARRAY_PROTOTYPE_SORT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SPLICE, ECMA_ARRAY_PROTOTYPE_SPLICE, NON_FIXED, 2) -ROUTINE (LIT_MAGIC_STRING_UNSHIFT, ECMA_ARRAY_PROTOTYPE_UNSHIFT, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_INDEX_OF_UL, ECMA_ARRAY_PROTOTYPE_INDEX_OF, 2, 1) -ROUTINE (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, ECMA_ARRAY_PROTOTYPE_LAST_INDEX_OF, NON_FIXED, 1) -/* Note these 3 routines must be in this order */ -ROUTINE (LIT_MAGIC_STRING_EVERY, ECMA_ARRAY_PROTOTYPE_EVERY, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SOME, ECMA_ARRAY_PROTOTYPE_SOME, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ECMA_ARRAY_PROTOTYPE_FOR_EACH, 2, 1) -ROUTINE (LIT_MAGIC_STRING_MAP, ECMA_ARRAY_PROTOTYPE_MAP, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FILTER, ECMA_ARRAY_PROTOTYPE_FILTER, 2, 1) -/* Note these 2 routines must be in this order */ -ROUTINE (LIT_MAGIC_STRING_REDUCE, ECMA_ARRAY_PROTOTYPE_REDUCE, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ECMA_ARRAY_PROTOTYPE_REDUCE_RIGHT, NON_FIXED, 1) -#if ENABLED (JERRY_ES2015_BUILTIN) -ROUTINE (LIT_MAGIC_STRING_FIND, ECMA_ARRAY_PROTOTYPE_FIND, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ECMA_ARRAY_PROTOTYPE_FIND_INDEX, 2, 1) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_ARRAY_PROTOTYPE_ENTRIES, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_ARRAY_PROTOTYPE_VALUES, 0, 0) -ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_ARRAY_PROTOTYPE_KEYS, 0, 0) -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR, 0, 0) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array.inc.h deleted file mode 100644 index ccea4a5e6..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-array.inc.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Array description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ARRAY) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.4.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Number properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.4.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_IS_ARRAY_UL, ecma_builtin_array_object_is_array, 1, 1) - -#endif /* !(ENABLED (JERRY_BUILTIN_ARRAY)) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer-prototype.inc.h deleted file mode 100644 index 852e356ef..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer-prototype.inc.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * ArrayBuffer.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/* Object properties: - * (property name, object pointer getter) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_ARRAYBUFFER, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Readonly accessor properties */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL, - ecma_builtin_arraybuffer_prototype_bytelength_getter, - ECMA_PROPERTY_FIXED) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 24.1.4.4 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_ARRAY_BUFFER_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_SLICE, ecma_builtin_arraybuffer_prototype_object_slice, 2, 2) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer.inc.h deleted file mode 100644 index 2ed9fa4ad..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-arraybuffer.inc.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * ArrayBuffer built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ - -/* ES2015 24.1.3.1 */ -ROUTINE (LIT_MAGIC_STRING_IS_VIEW_UL, ecma_builtin_arraybuffer_object_is_view, 1, 1) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean-prototype.inc.h deleted file mode 100644 index c8f222358..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean-prototype.inc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Boolean.prototype description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_BOOLEAN) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.6.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_BOOLEAN, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_boolean_prototype_object_to_string, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_boolean_prototype_object_value_of, 0, 0) - -#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean.inc.h deleted file mode 100644 index a26f129d2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-boolean.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Boolean description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_BOOLEAN) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.6.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Number properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.6.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview-prototype.inc.h deleted file mode 100644 index 3dd9efde1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview-prototype.inc.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * DataView.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 24.2.3 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_DATAVIEW, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 23.2.4.21 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_DATAVIEW_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_GET_FLOAT_32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT32, 2, 1) -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) -ROUTINE (LIT_MAGIC_STRING_GET_FLOAT_64_UL, ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT64, 2, 1) -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -ROUTINE (LIT_MAGIC_STRING_GET_INT8_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT8, 1, 1) -ROUTINE (LIT_MAGIC_STRING_GET_INT16_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT16, 2, 1) -ROUTINE (LIT_MAGIC_STRING_GET_INT32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT32, 2, 1) -ROUTINE (LIT_MAGIC_STRING_GET_UINT8_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT8, 2, 1) -ROUTINE (LIT_MAGIC_STRING_GET_UINT16_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT16, 2, 1) -ROUTINE (LIT_MAGIC_STRING_GET_UINT32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT32, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SET_FLOAT_32_UL, ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT32, 2, 1) -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) -ROUTINE (LIT_MAGIC_STRING_SET_FLOAT_64_UL, ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT64, 2, 1) -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -ROUTINE (LIT_MAGIC_STRING_SET_INT8_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT8, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_INT16_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT16, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SET_INT32_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT32, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SET_UINT8_UL, ECMA_DATAVIEW_PROTOTYPE_SET_UINT8, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SET_UINT16_UL, ECMA_DATAVIEW_PROTOTYPE_SET_UINT16, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SET_UINT32_UL, ECMA_DATAVIEW_PROTOTYPE_SET_UINT32, 2, 1) - -/* ECMA-262 v6, 24.2.4.1 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BUFFER, - ECMA_DATAVIEW_PROTOTYPE_BUFFER_GETTER, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 24.2.4.2 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL, - ECMA_DATAVIEW_PROTOTYPE_BYTE_LENGTH_GETTER, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 24.2.4.3 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_OFFSET_UL, - ECMA_DATAVIEW_PROTOTYPE_BYTE_OFFSET_GETTER, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview.inc.h deleted file mode 100644 index 75fbc688f..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-dataview.inc.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * DataView built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v6, 23.1.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 3, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 23.1 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_DATAVIEW_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 23.1.2.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_DATAVIEW_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date-prototype.inc.h deleted file mode 100644 index 543080149..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date-prototype.inc.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Date.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_DATE) - -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_DATE, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_DATE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_DATE_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_TIME_STRING_UL, ECMA_DATE_PROTOTYPE_TO_TIME_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_DATE_STRING_UL, ECMA_DATE_PROTOTYPE_TO_DATE_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_TIME_STRING_UL, ECMA_DATE_PROTOTYPE_TO_TIME_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ECMA_DATE_PROTOTYPE_GET_TIME, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_TIME_UL, ECMA_DATE_PROTOTYPE_GET_TIME, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_FULL_YEAR, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_UTC_FULL_YEAR, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_MONTH_UL, ECMA_DATE_PROTOTYPE_GET_MONTH, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_MONTH_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MONTH, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_DATE_UL, ECMA_DATE_PROTOTYPE_GET_DATE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_DATE_UL, ECMA_DATE_PROTOTYPE_GET_UTC_DATE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_DAY_UL, ECMA_DATE_PROTOTYPE_GET_DAY, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_DAY_UL, ECMA_DATE_PROTOTYPE_GET_UTC_DAY, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_HOURS_UL, ECMA_DATE_PROTOTYPE_GET_HOURS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_HOURS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_HOURS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_MINUTES_UL, ECMA_DATE_PROTOTYPE_GET_MINUTES, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_MINUTES_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MINUTES, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_SECONDS_UL, ECMA_DATE_PROTOTYPE_GET_SECONDS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_SECONDS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_SECONDS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_GET_MILLISECONDS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_UTC_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_GET_UTC_MILLISECONDS, 0, 0) -ROUTINE (LIT_MAGIC_STRING_GET_TIMEZONE_OFFSET_UL, ECMA_DATE_PROTOTYPE_GET_UTC_TIMEZONE_OFFSET, 0, 0) -ROUTINE (LIT_MAGIC_STRING_SET_TIME_UL, ECMA_DATE_PROTOTYPE_SET_TIME, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_SET_MILLISECONDS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_MILLISECONDS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MILLISECONDS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_SECONDS_UL, ECMA_DATE_PROTOTYPE_SET_SECONDS, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_SECONDS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_SECONDS, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SET_MINUTES_UL, ECMA_DATE_PROTOTYPE_SET_MINUTES, NON_FIXED, 3) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_MINUTES_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MINUTES, NON_FIXED, 3) -ROUTINE (LIT_MAGIC_STRING_SET_HOURS_UL, ECMA_DATE_PROTOTYPE_SET_HOURS, NON_FIXED, 4) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_HOURS_UL, ECMA_DATE_PROTOTYPE_SET_UTC_HOURS, NON_FIXED, 4) -ROUTINE (LIT_MAGIC_STRING_SET_DATE_UL, ECMA_DATE_PROTOTYPE_SET_DATE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_DATE_UL, ECMA_DATE_PROTOTYPE_SET_UTC_DATE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET_MONTH_UL, ECMA_DATE_PROTOTYPE_SET_MONTH, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_MONTH_UL, ECMA_DATE_PROTOTYPE_SET_UTC_MONTH, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SET_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_FULL_YEAR, NON_FIXED, 3) -ROUTINE (LIT_MAGIC_STRING_SET_UTC_FULL_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_UTC_FULL_YEAR, NON_FIXED, 3) -ROUTINE (LIT_MAGIC_STRING_TO_UTC_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_ISO_STRING_UL, ECMA_DATE_PROTOTYPE_TO_ISO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_JSON_UL, ECMA_DATE_PROTOTYPE_TO_JSON, 1, 1) - -#if ENABLED (JERRY_BUILTIN_ANNEXB) - -ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ECMA_DATE_PROTOTYPE_GET_YEAR, 0, 0) -ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ECMA_DATE_PROTOTYPE_SET_YEAR, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ECMA_DATE_PROTOTYPE_TO_UTC_STRING, 0, 0) - -#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */ - -#endif /* ENABLED (JERRY_BUILTIN_DATE) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date.inc.h deleted file mode 100644 index fc38bf56b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-date.inc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Date built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_DATE) - -/* ECMA-262 v5, 15.9.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_DATE_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 7, - ECMA_PROPERTY_FIXED) - -ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_date_parse, 1, 1) -ROUTINE (LIT_MAGIC_STRING_UTC_U, ecma_builtin_date_utc, NON_FIXED, 7) -ROUTINE (LIT_MAGIC_STRING_NOW, ecma_builtin_date_now, 0, 0) - -#endif /* ENABLED (JERRY_BUILTIN_DATE) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error-prototype.inc.h deleted file mode 100644 index 2cb344438..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Error.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.4.2 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.4.3 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_error_prototype_object_to_string, 0, 0) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error.inc.h deleted file mode 100644 index 3fbddac22..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-error.inc.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Error built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.7.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror-prototype.inc.h deleted file mode 100644 index a6e1f6400..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * EvalError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_EVAL_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_EVAL_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror.inc.h deleted file mode 100644 index c6d7626b7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-evalerror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * EvalError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array-prototype.inc.h deleted file mode 100644 index 5ad673d65..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Float32Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT32ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array.inc.h deleted file mode 100644 index 7ba4130cf..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float32array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Float32Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_FLOAT32_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array-prototype.inc.h deleted file mode 100644 index e3528d333..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array-prototype.inc.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Float64Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 8 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT64ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array.inc.h deleted file mode 100644 index 76f6d7340..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-float64array.inc.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Float64Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 8 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_FLOAT64_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function-prototype.inc.h deleted file mode 100644 index 945a14fc8..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function-prototype.inc.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Function.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.3.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_FUNCTION, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Number properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.3.4 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_FUNCTION_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_APPLY, ECMA_FUNCTION_PROTOTYPE_APPLY, 2, 2) -ROUTINE (LIT_MAGIC_STRING_CALL, ECMA_FUNCTION_PROTOTYPE_CALL, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_BIND, ECMA_FUNCTION_PROTOTYPE_BIND, NON_FIXED, 1) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function.inc.h deleted file mode 100644 index c6a4a7bd6..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-function.inc.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Function built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.3.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Number properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.3.3.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-global.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-global.inc.h deleted file mode 100644 index 4964887f2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-global.inc.h +++ /dev/null @@ -1,247 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Global built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Simple value properties: - * (property name, simple value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.1.1.3 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_UNDEFINED, - ECMA_VALUE_UNDEFINED, - ECMA_PROPERTY_FIXED) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.1.1.1 */ -NUMBER_VALUE (LIT_MAGIC_STRING_NAN, - ECMA_BUILTIN_NUMBER_NAN, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.1.1.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_INFINITY_UL, - ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.1.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_OBJECT_UL, - ECMA_BUILTIN_ID_OBJECT, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.2 */ -OBJECT_VALUE (LIT_MAGIC_STRING_FUNCTION_UL, - ECMA_BUILTIN_ID_FUNCTION, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.3 */ -#if ENABLED (JERRY_BUILTIN_ARRAY) -OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_UL, - ECMA_BUILTIN_ID_ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */ - -#if ENABLED (JERRY_BUILTIN_STRING) -/* ECMA-262 v5, 15.1.4.4 */ -OBJECT_VALUE (LIT_MAGIC_STRING_STRING_UL, - ECMA_BUILTIN_ID_STRING, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_STRING) */ - -#if ENABLED (JERRY_BUILTIN_BOOLEAN) -/* ECMA-262 v5, 15.1.4.5 */ -OBJECT_VALUE (LIT_MAGIC_STRING_BOOLEAN_UL, - ECMA_BUILTIN_ID_BOOLEAN, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */ - -#if ENABLED (JERRY_BUILTIN_NUMBER) -/* ECMA-262 v5, 15.1.4.6 */ -OBJECT_VALUE (LIT_MAGIC_STRING_NUMBER_UL, - ECMA_BUILTIN_ID_NUMBER, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */ - -#if ENABLED (JERRY_BUILTIN_DATE) -/* ECMA-262 v5, 15.1.4.7 */ -OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL, - ECMA_BUILTIN_ID_DATE, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_DATE) */ - -#if ENABLED (JERRY_BUILTIN_REGEXP) -/* ECMA-262 v5, 15.1.4.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_REGEXP_UL, - ECMA_BUILTIN_ID_REGEXP, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -/* ECMA-262 v5, 15.1.4.9 */ -OBJECT_VALUE (LIT_MAGIC_STRING_ERROR_UL, - ECMA_BUILTIN_ID_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* ECMA-262 v5, 15.1.4.10 */ -OBJECT_VALUE (LIT_MAGIC_STRING_EVAL_ERROR_UL, - ECMA_BUILTIN_ID_EVAL_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.11 */ -OBJECT_VALUE (LIT_MAGIC_STRING_RANGE_ERROR_UL, - ECMA_BUILTIN_ID_RANGE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.12 */ -OBJECT_VALUE (LIT_MAGIC_STRING_REFERENCE_ERROR_UL, - ECMA_BUILTIN_ID_REFERENCE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.13 */ -OBJECT_VALUE (LIT_MAGIC_STRING_SYNTAX_ERROR_UL, - ECMA_BUILTIN_ID_SYNTAX_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.14 */ -OBJECT_VALUE (LIT_MAGIC_STRING_TYPE_ERROR_UL, - ECMA_BUILTIN_ID_TYPE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.1.4.15 */ -OBJECT_VALUE (LIT_MAGIC_STRING_URI_ERROR_UL, - ECMA_BUILTIN_ID_URI_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#if ENABLED (JERRY_BUILTIN_MATH) -/* ECMA-262 v5, 15.1.5.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_MATH_UL, - ECMA_BUILTIN_ID_MATH, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_MATH) */ - -#if ENABLED (JERRY_BUILTIN_JSON) -/* ECMA-262 v5, 15.1.5.2 */ -OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U, - ECMA_BUILTIN_ID_JSON, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_BUILTIN_JSON) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) -OBJECT_VALUE (LIT_MAGIC_STRING_ARRAY_BUFFER_UL, - ECMA_BUILTIN_ID_ARRAYBUFFER, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_INT8_ARRAY_UL, - ECMA_BUILTIN_ID_INT8ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_ARRAY_UL, - ECMA_BUILTIN_ID_UINT8ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_INT16_ARRAY_UL, - ECMA_BUILTIN_ID_INT16ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_UINT16_ARRAY_UL, - ECMA_BUILTIN_ID_UINT16ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_INT32_ARRAY_UL, - ECMA_BUILTIN_ID_INT32ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_UINT32_ARRAY_UL, - ECMA_BUILTIN_ID_UINT32ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, - ECMA_BUILTIN_ID_FLOAT32ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) -OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, - ECMA_BUILTIN_ID_FLOAT64ARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL, - ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) -OBJECT_VALUE (LIT_MAGIC_STRING_PROMISE_UL, - ECMA_BUILTIN_ID_PROMISE, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) -/* ECMA-262 v6, 23.1.1.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_MAP_UL, - ECMA_BUILTIN_ID_MAP, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) -/* ECMA-262 v6, 23.1.1.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_SET_UL, - ECMA_BUILTIN_ID_SET, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 19.4.1.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_SYMBOL_UL, - ECMA_BUILTIN_ID_SYMBOL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) -/* ECMA-262 v6, 23.1.1.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_DATAVIEW_UL, - ECMA_BUILTIN_ID_DATAVIEW, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ - -ROUTINE (LIT_MAGIC_STRING_EVAL, ECMA_GLOBAL_EVAL, 1, 1) -ROUTINE (LIT_MAGIC_STRING_PARSE_FLOAT, ECMA_GLOBAL_PARSE_FLOAT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_NAN, ECMA_GLOBAL_IS_NAN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ECMA_GLOBAL_IS_FINITE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_DECODE_URI, ECMA_GLOBAL_DECODE_URI, 1, 1) -ROUTINE (LIT_MAGIC_STRING_DECODE_URI_COMPONENT, ECMA_GLOBAL_DECODE_URI_COMPONENT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ENCODE_URI, ECMA_GLOBAL_ENCODE_URI, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ENCODE_URI_COMPONENT, ECMA_GLOBAL_ENCODE_URI_COMPONENT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ECMA_GLOBAL_PARSE_INT, 2, 2) - -#if ENABLED (JERRY_BUILTIN_ANNEXB) -ROUTINE (LIT_MAGIC_STRING_ESCAPE, ECMA_GLOBAL_ESCAPE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ECMA_GLOBAL_UNESCAPE, 1, 1) -#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-defines.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-defines.inc.h deleted file mode 100644 index 53ecd64e2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-defines.inc.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef SIMPLE_VALUE -#define SIMPLE_VALUE(name, simple_value, prop_attributes) -#endif /* !SIMPLE_VALUE */ - -#ifndef NUMBER_VALUE -#define NUMBER_VALUE(name, number_value, prop_attributes) -#endif /* !NUMBER_VALUE */ - -#ifndef STRING_VALUE -#define STRING_VALUE(name, magic_string_id, prop_attributes) -#endif /* !STRING_VALUE */ - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -#ifndef SYMBOL_VALUE -#define SYMBOL_VALUE(name, desc_string_id) -#endif /* !SYMBOL_VALUE */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -#ifndef OBJECT_VALUE -#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes) -#endif /* !OBJECT_VALUE */ - -#ifndef ROUTINE -#define ROUTINE(name, c_function_name, args_number, length_prop_value) -#endif /* !ROUTINE */ - -#ifndef ROUTINE_CONFIGURABLE_ONLY -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) -#endif /* !ROUTINE_CONFIGURABLE_ONLY */ - -#ifndef ACCESSOR_READ_WRITE -#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) -#endif /* !ACCESSOR_READ_WRITE */ - -#ifndef ACCESSOR_READ_ONLY -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) -#endif /* !ACCESSOR_READ_ONLY */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-undefs.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-undefs.inc.h deleted file mode 100644 index 8f7252513..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers-macro-undefs.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#undef SIMPLE_VALUE -#undef NUMBER_VALUE -#undef STRING_VALUE -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -#undef SYMBOL_VALUE -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -#undef OBJECT_VALUE -#undef ROUTINE -#undef ROUTINE_CONFIGURABLE_ONLY -#undef ACCESSOR_READ_WRITE -#undef ACCESSOR_READ_ONLY diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers.h deleted file mode 100644 index 319811a80..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-helpers.h +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_BUILTIN_HELPERS_H -#define ECMA_BUILTIN_HELPERS_H - -#include "ecma-globals.h" -#include "ecma-exceptions.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations - * @{ - */ - -/** - * Mode of string index routine. - */ -typedef enum -{ - /** These routines must be in this order */ - ECMA_STRING_INDEX_OF, /**< String.indexOf: ECMA-262 v5, 15.5.4.7 */ - ECMA_STRING_LAST_INDEX_OF, /**< String.lastIndexOf: ECMA-262 v5, 15.5.4.8 */ - ECMA_STRING_STARTS_WITH, /**< String.startsWith: ECMA-262 v6, 21.1.3.18 */ - ECMA_STRING_INCLUDES, /**< String.includes: ECMA-262 v6, 21.1.3.7 */ - ECMA_STRING_ENDS_WITH /**< String.includes: ECMA-262 v6, 21.1.3.6 */ -} ecma_string_index_of_mode_t; - -ecma_value_t -ecma_builtin_helper_object_to_string (const ecma_value_t this_arg); -ecma_value_t -ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, uint32_t index); -ecma_value_t -ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, uint32_t opts); -ecma_value_t -ecma_builtin_helper_array_concat_value (ecma_object_t *obj_p, uint32_t *length_p, ecma_value_t value); -uint32_t -ecma_builtin_helper_array_index_normalize (ecma_number_t index, uint32_t length, bool last_index_of); -uint32_t -ecma_builtin_helper_string_index_normalize (ecma_number_t index, uint32_t length, bool nan_to_zero); -ecma_value_t -ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_str_p, ecma_value_t arg1, - ecma_value_t arg2, ecma_string_index_of_mode_t mode); -bool -ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, ecma_string_t *search_str_p, bool first_index, - ecma_length_t start_pos, ecma_length_t *ret_index_p); -ecma_value_t -ecma_builtin_helper_def_prop (ecma_object_t *obj_p, ecma_string_t *index_p, ecma_value_t value, uint32_t opts); - -ecma_value_t -ecma_builtin_helper_def_prop_by_index (ecma_object_t *obj_p, uint32_t index, ecma_value_t value, uint32_t opts); - -#if ENABLED (JERRY_BUILTIN_DATE) - -/** - * Time range defines for helper functions. - * - * See also: - * ECMA-262 v5, 15.9.1.1, 15.9.1.10 - */ - -/** Hours in a day. */ -#define ECMA_DATE_HOURS_PER_DAY ((ecma_number_t) 24) - -/** Minutes in an hour. */ -#define ECMA_DATE_MINUTES_PER_HOUR ((ecma_number_t) 60) - -/** Seconds in a minute. */ -#define ECMA_DATE_SECONDS_PER_MINUTE ((ecma_number_t) 60) - -/** Milliseconds in a second. */ -#define ECMA_DATE_MS_PER_SECOND ((ecma_number_t) 1000) - -/** ECMA_DATE_MS_PER_MINUTE == 60000 */ -#define ECMA_DATE_MS_PER_MINUTE (ECMA_DATE_MS_PER_SECOND * ECMA_DATE_SECONDS_PER_MINUTE) - -/** ECMA_DATE_MS_PER_HOUR == 3600000 */ -#define ECMA_DATE_MS_PER_HOUR (ECMA_DATE_MS_PER_MINUTE * ECMA_DATE_MINUTES_PER_HOUR) - -/** ECMA_DATE_MS_PER_DAY == 86400000 */ -#define ECMA_DATE_MS_PER_DAY (ECMA_DATE_MS_PER_HOUR * ECMA_DATE_HOURS_PER_DAY) - -/** - * This gives a range of 8,640,000,000,000,000 milliseconds - * to either side of 01 January, 1970 UTC. - */ -#define ECMA_DATE_MAX_VALUE 8.64e15 - -/** - * Timezone type. - */ -typedef enum -{ - ECMA_DATE_UTC, /**< date vaule is in UTC */ - ECMA_DATE_LOCAL /**< date vaule is in local time */ -} ecma_date_timezone_t; - -/* ecma-builtin-helpers-date.c */ -ecma_number_t ecma_date_day (ecma_number_t time); -ecma_number_t ecma_date_time_within_day (ecma_number_t time); -ecma_number_t ecma_date_year_from_time (ecma_number_t time); -ecma_number_t ecma_date_month_from_time (ecma_number_t time); -ecma_number_t ecma_date_date_from_time (ecma_number_t time); -ecma_number_t ecma_date_week_day (ecma_number_t time); -ecma_number_t ecma_date_local_time_zone_adjustment (ecma_number_t time); -ecma_number_t ecma_date_utc (ecma_number_t time); -ecma_number_t ecma_date_hour_from_time (ecma_number_t time); -ecma_number_t ecma_date_min_from_time (ecma_number_t time); -ecma_number_t ecma_date_sec_from_time (ecma_number_t time); -ecma_number_t ecma_date_ms_from_time (ecma_number_t time); -ecma_number_t ecma_date_make_time (ecma_number_t hour, ecma_number_t min, ecma_number_t sec, ecma_number_t ms); -ecma_number_t ecma_date_make_day (ecma_number_t year, ecma_number_t month, ecma_number_t date); -ecma_number_t ecma_date_make_date (ecma_number_t day, ecma_number_t time); -ecma_number_t ecma_date_time_clip (ecma_number_t time); -ecma_number_t ecma_date_timezone_offset (ecma_number_t time); - -ecma_value_t ecma_date_value_to_string (ecma_number_t datetime_number); -ecma_value_t ecma_date_value_to_utc_string (ecma_number_t datetime_number); -ecma_value_t ecma_date_value_to_iso_string (ecma_number_t datetime_number); -ecma_value_t ecma_date_value_to_date_string (ecma_number_t datetime_number); -ecma_value_t ecma_date_value_to_time_string (ecma_number_t datetime_number); - -#endif /* ENABLED (JERRY_BUILTIN_DATE) */ - -#if ENABLED (JERRY_BUILTIN_JSON) -/* ecma-builtin-helper-json.c */ - -/** - * Occurence stack item of JSON.stringify() - */ -typedef struct struct_ecma_json_occurence_stack_item_t -{ - struct struct_ecma_json_occurence_stack_item_t *next_p; /**< next stack item */ - ecma_object_t *object_p; /**< current object */ -} ecma_json_occurence_stack_item_t; - -/** - * Context for JSON.stringify() - */ -typedef struct -{ - /** Collection for property keys. */ - ecma_collection_t *property_list_p; - - /** Collection for traversing objects. */ - ecma_json_occurence_stack_item_t *occurence_stack_last_p; - - /** The actual indentation text. */ - ecma_stringbuilder_t indent_builder; - - /** The indentation text. */ - ecma_string_t *gap_str_p; - - /** The replacer function. */ - ecma_object_t *replacer_function_p; - - /** Result string builder. */ - ecma_stringbuilder_t result_builder; -} ecma_json_stringify_context_t; - -ecma_value_t ecma_builtin_json_parse_buffer (const lit_utf8_byte_t * str_start_p, - lit_utf8_size_t string_size); -ecma_value_t ecma_builtin_json_string_from_object (const ecma_value_t arg1); -bool ecma_json_has_object_in_stack (ecma_json_occurence_stack_item_t *stack_p, ecma_object_t *object_p); -bool ecma_has_string_value_in_collection (ecma_collection_t *collection_p, ecma_string_t *string_p); - -ecma_value_t -ecma_builtin_helper_json_create_non_formatted_json (lit_utf8_byte_t left_bracket, lit_utf8_byte_t right_bracket, - ecma_collection_t *partial_p); -#endif /* ENABLED (JERRY_BUILTIN_JSON) */ - -/* ecma-builtin-helper-error.c */ - -ecma_value_t -ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, const ecma_value_t *arguments_list_p, - ecma_length_t arguments_list_len); - -/* ecma-builtin-helpers-sort.c */ - -/** - * Comparison callback function header for sorting helper routines. - */ -typedef ecma_value_t (*ecma_builtin_helper_sort_compare_fn_t)(ecma_value_t lhs, /**< left value */ - ecma_value_t rhs, /**< right value */ - ecma_value_t compare_func); /**< compare function */ - -ecma_value_t ecma_builtin_helper_array_heap_sort_helper (ecma_value_t *array_p, - uint32_t right, - ecma_value_t compare_func, - const ecma_builtin_helper_sort_compare_fn_t sort_cb); - -/** - * @} - * @} - */ - -#endif /* !ECMA_BUILTIN_HELPERS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array-prototype.inc.h deleted file mode 100644 index 0d70bd56d..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int16Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 2 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT16ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array.inc.h deleted file mode 100644 index 7522b80ec..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int16array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int16Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 2 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_INT16_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array-prototype.inc.h deleted file mode 100644 index ca15f6e7a..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int32Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT32ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array.inc.h deleted file mode 100644 index 8319f8438..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int32array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int32Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_INT32_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array-prototype.inc.h deleted file mode 100644 index c96e557f4..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int8Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT8ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array.inc.h deleted file mode 100644 index 07a3800d5..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-int8array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Int8Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_INT8_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-internal-routines-template.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-internal-routines-template.inc.h deleted file mode 100644 index 06a10fb67..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-internal-routines-template.inc.h +++ /dev/null @@ -1,264 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef BUILTIN_UNDERSCORED_ID -# error "Please, define BUILTIN_UNDERSCORED_ID" -#endif /* !BUILTIN_UNDERSCORED_ID */ - -#ifndef BUILTIN_INC_HEADER_NAME -# error "Please, define BUILTIN_INC_HEADER_NAME" -#endif /* !BUILTIN_INC_HEADER_NAME */ - -#include "ecma-objects.h" - -#define PASTE__(x, y) x ## y -#define PASTE_(x, y) PASTE__ (x, y) -#define PASTE(x, y) PASTE_ (x, y) - -#define PROPERTY_DESCRIPTOR_LIST_NAME \ - PASTE (PASTE (ecma_builtin_, BUILTIN_UNDERSCORED_ID), _property_descriptor_list) -#define DISPATCH_ROUTINE_ROUTINE_NAME \ - PASTE (PASTE (ecma_builtin_, BUILTIN_UNDERSCORED_ID), _dispatch_routine) - -#ifndef BUILTIN_CUSTOM_DISPATCH - -#define ROUTINE_ARG(n) , ecma_value_t arg ## n -#define ROUTINE_ARG_LIST_0 ecma_value_t this_arg -#define ROUTINE_ARG_LIST_1 ROUTINE_ARG_LIST_0 ROUTINE_ARG(1) -#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1 ROUTINE_ARG(2) -#define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2 ROUTINE_ARG(3) -#define ROUTINE_ARG_LIST_NON_FIXED ROUTINE_ARG_LIST_0, \ - const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len -#define ROUTINE(name, c_function_name, args_number, length_prop_value) \ - static ecma_value_t c_function_name (ROUTINE_ARG_LIST_ ## args_number); -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \ - static ecma_value_t c_function_name (ROUTINE_ARG_LIST_ ## args_number); -#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \ - static ecma_value_t c_getter_func_name (ROUTINE_ARG_LIST_0); \ - static ecma_value_t c_setter_func_name (ROUTINE_ARG_LIST_1); -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \ - static ecma_value_t c_getter_func_name (ROUTINE_ARG_LIST_0); -#include BUILTIN_INC_HEADER_NAME -#undef ROUTINE_ARG_LIST_NON_FIXED -#undef ROUTINE_ARG_LIST_3 -#undef ROUTINE_ARG_LIST_2 -#undef ROUTINE_ARG_LIST_1 -#undef ROUTINE_ARG_LIST_0 -#undef ROUTINE_ARG - -/** - * List of built-in routine identifiers. - */ -enum -{ - PASTE (ECMA_ROUTINE_START_, BUILTIN_UNDERSCORED_ID) = ECMA_BUILTIN_ID__COUNT - 1, -#define ROUTINE(name, c_function_name, args_number, length_prop_value) \ - ECMA_ROUTINE_ ## name ## c_function_name, -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \ - ECMA_ROUTINE_ ## name ## c_function_name, -#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \ - ECMA_ACCESSOR_ ## name ## c_getter_func_name, \ - ECMA_ACCESSOR_ ## name ## c_setter_func_name, -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \ - ECMA_ACCESSOR_ ## name ## c_getter_func_name, -#include BUILTIN_INC_HEADER_NAME -}; - -#endif /* !BUILTIN_CUSTOM_DISPATCH */ - -/** - * Built-in property list of the built-in object. - */ -const ecma_builtin_property_descriptor_t PROPERTY_DESCRIPTOR_LIST_NAME[] = -{ -#ifndef BUILTIN_CUSTOM_DISPATCH -#define ROUTINE(name, c_function_name, args_number, length_prop_value) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ROUTINE, \ - ECMA_PROPERTY_CONFIGURABLE_WRITABLE, \ - ECMA_ROUTINE_VALUE (ECMA_ROUTINE_ ## name ## c_function_name, length_prop_value) \ - }, -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ROUTINE, \ - ECMA_PROPERTY_FLAG_CONFIGURABLE, \ - ECMA_ROUTINE_VALUE (ECMA_ROUTINE_ ## name ## c_function_name, length_prop_value) \ - }, -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY, \ - prop_attributes, \ - ECMA_ACCESSOR_ ## name ## c_getter_func_name \ - }, -#else /* BUILTIN_CUSTOM_DISPATCH */ -#define ROUTINE(name, c_function_name, args_number, length_prop_value) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ROUTINE, \ - ECMA_PROPERTY_CONFIGURABLE_WRITABLE, \ - ECMA_ROUTINE_VALUE (c_function_name, length_prop_value) \ - }, -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ROUTINE, \ - ECMA_PROPERTY_FLAG_CONFIGURABLE, \ - ECMA_ROUTINE_VALUE (c_function_name, length_prop_value) \ - }, -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY, \ - prop_attributes, \ - c_getter_func_name \ - }, -#endif /* !BUILTIN_CUSTOM_DISPATCH */ -#define OBJECT_VALUE(name, obj_builtin_id, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_OBJECT, \ - prop_attributes, \ - obj_builtin_id \ - }, -#define SIMPLE_VALUE(name, simple_value, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_SIMPLE, \ - prop_attributes, \ - simple_value \ - }, -#define NUMBER_VALUE(name, number_value, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_NUMBER, \ - prop_attributes, \ - number_value \ - }, -#define STRING_VALUE(name, magic_string_id, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_STRING, \ - prop_attributes, \ - magic_string_id \ - }, -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -#define SYMBOL_VALUE(name, desc_string_id) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_SYMBOL, \ - ECMA_PROPERTY_FIXED, \ - desc_string_id \ - }, -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -#define ACCESSOR_READ_WRITE(name, c_getter_name, c_setter_name, prop_attributes) \ - { \ - name, \ - ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, \ - prop_attributes, \ - ECMA_ACCESSOR_READ_WRITE (ECMA_ACCESSOR_ ## name ## c_getter_name, ECMA_ACCESSOR_ ## name ## c_setter_name) \ - }, -#include BUILTIN_INC_HEADER_NAME - { - LIT_MAGIC_STRING__COUNT, - ECMA_BUILTIN_PROPERTY_END, - 0, - 0 - } -}; - -#ifndef BUILTIN_CUSTOM_DISPATCH - -/** - * Dispatcher of the built-in's routines - * - * @return ecma value - * Returned value must be freed with ecma_free_value. - */ -ecma_value_t -DISPATCH_ROUTINE_ROUTINE_NAME (uint16_t builtin_routine_id, /**< built-in wide routine - identifier */ - ecma_value_t this_arg_value, /**< 'this' argument - value */ - const ecma_value_t arguments_list[], /**< list of arguments - passed to routine */ - ecma_length_t arguments_number) /**< length of - arguments' list */ -{ - /* the arguments may be unused for some built-ins */ - JERRY_UNUSED (this_arg_value); - JERRY_UNUSED (arguments_list); - JERRY_UNUSED (arguments_number); - - switch (builtin_routine_id) - { -#define ROUTINE_ARG(n) (arguments_list[n - 1]) -#define ROUTINE_ARG_LIST_0 -#define ROUTINE_ARG_LIST_1 , ROUTINE_ARG(1) -#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1, ROUTINE_ARG(2) -#define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2, ROUTINE_ARG(3) -#define ROUTINE_ARG_LIST_NON_FIXED , arguments_list, arguments_number -#define ROUTINE(name, c_function_name, args_number, length_prop_value) \ - case ECMA_ROUTINE_ ## name ## c_function_name: \ - { \ - return c_function_name (this_arg_value ROUTINE_ARG_LIST_ ## args_number); \ - } -#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \ - case ECMA_ROUTINE_ ## name ## c_function_name: \ - { \ - return c_function_name (this_arg_value ROUTINE_ARG_LIST_ ## args_number); \ - } -#define ACCESSOR_READ_WRITE(name, c_getter_func_name, c_setter_func_name, prop_attributes) \ - case ECMA_ACCESSOR_ ## name ## c_getter_func_name: \ - { \ - return c_getter_func_name(this_arg_value); \ - } \ - case ECMA_ACCESSOR_ ## name ## c_setter_func_name: \ - { \ - return c_setter_func_name(this_arg_value ROUTINE_ARG_LIST_1); \ - } -#define ACCESSOR_READ_ONLY(name, c_getter_func_name, prop_attributes) \ - case ECMA_ACCESSOR_ ## name ## c_getter_func_name: \ - { \ - return c_getter_func_name(this_arg_value); \ - } -#include BUILTIN_INC_HEADER_NAME -#undef ROUTINE_ARG -#undef ROUTINE_ARG_LIST_0 -#undef ROUTINE_ARG_LIST_1 -#undef ROUTINE_ARG_LIST_2 -#undef ROUTINE_ARG_LIST_3 -#undef ROUTINE_ARG_LIST_NON_FIXED - - default: - { - JERRY_UNREACHABLE (); - } - } -} /* DISPATCH_ROUTINE_ROUTINE_NAME */ - -#endif /* !BUILTIN_CUSTOM_DISPATCH */ - -#undef BUILTIN_INC_HEADER_NAME -#undef BUILTIN_CUSTOM_DISPATCH -#undef BUILTIN_UNDERSCORED_ID -#undef DISPATCH_ROUTINE_ROUTINE_NAME -#undef ECMA_BUILTIN_PROPERTY_NAME_INDEX -#undef PASTE__ -#undef PASTE_ -#undef PASTE -#undef PROPERTY_DESCRIPTOR_LIST_NAME diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-iterator-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-iterator-prototype.inc.h deleted file mode 100644 index 507026272..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-iterator-prototype.inc.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %IteratorPrototype% built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_iterator_prototype_object_iterator, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-json.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-json.inc.h deleted file mode 100644 index 11446b832..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-json.inc.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * JSON built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_JSON) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 24.3.3 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_JSON_U, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_PARSE, ecma_builtin_json_parse, 2, 2) -ROUTINE (LIT_MAGIC_STRING_STRINGIFY, ecma_builtin_json_stringify, 3, 3) - -#endif /* ENABLED (JERRY_BUILTIN_JSON) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-iterator-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-iterator-prototype.inc.h deleted file mode 100644 index 8f3b326e8..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-iterator-prototype.inc.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %MapIteratorPrototype% built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) - -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_MAP_ITERATOR_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_map_iterator_prototype_object_next, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-prototype.inc.h deleted file mode 100644 index c7d7bc7cb..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map-prototype.inc.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Map.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 23.1.3.2 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_MAP, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 23.1.3.13 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_MAP_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_CLEAR, ecma_builtin_map_prototype_object_clear, 0, 0) -ROUTINE (LIT_MAGIC_STRING_DELETE, ecma_builtin_map_prototype_object_delete, 1, 1) -ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_map_prototype_object_foreach, 2, 1) -ROUTINE (LIT_MAGIC_STRING_GET, ecma_builtin_map_prototype_object_get, 1, 1) -ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_map_prototype_object_has, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SET, ecma_builtin_map_prototype_object_set, 2, 2) -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_map_prototype_object_entries, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_map_prototype_object_values, 0, 0) -ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_map_prototype_object_keys, 0, 0) -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_map_prototype_object_values, 0, 0) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -/* ECMA-262 v6, 23.1.3.10 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE, - ecma_builtin_map_prototype_object_size_getter, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map.inc.h deleted file mode 100644 index 2c4ca3d21..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-map.inc.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Map built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v6, 23.1.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 23.1 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_MAP_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 23.1.2.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_MAP_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-math.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-math.inc.h deleted file mode 100644 index f889b5477..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-math.inc.h +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Math built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_MATH) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.8.1.1 */ -NUMBER_VALUE (LIT_MAGIC_STRING_E_U, - ECMA_BUILTIN_NUMBER_E, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LN10_U, - ECMA_BUILTIN_NUMBER_LN10, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LN2_U, - ECMA_BUILTIN_NUMBER_LN2, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.4 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LOG2E_U, - ECMA_BUILTIN_NUMBER_LOG2E, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LOG10E_U, - ECMA_BUILTIN_NUMBER_LOG10E, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.6 */ -NUMBER_VALUE (LIT_MAGIC_STRING_PI_U, - ECMA_BUILTIN_NUMBER_PI, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.7 */ -NUMBER_VALUE (LIT_MAGIC_STRING_SQRT1_2_U, - ECMA_BUILTIN_NUMBER_SQRT_1_2, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.8.1.8 */ -NUMBER_VALUE (LIT_MAGIC_STRING_SQRT2_U, - ECMA_BUILTIN_NUMBER_SQRT2, - ECMA_PROPERTY_FIXED) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 20.2.1.9 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_MATH_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_ABS, ECMA_MATH_OBJECT_ABS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ACOS, ECMA_MATH_OBJECT_ACOS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ASIN, ECMA_MATH_OBJECT_ASIN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ATAN, ECMA_MATH_OBJECT_ATAN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ATAN2, ECMA_MATH_OBJECT_ATAN2, 2, 2) -ROUTINE (LIT_MAGIC_STRING_CEIL, ECMA_MATH_OBJECT_CEIL, 1, 1) -ROUTINE (LIT_MAGIC_STRING_COS, ECMA_MATH_OBJECT_COS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_EXP, ECMA_MATH_OBJECT_EXP, 1, 1) -ROUTINE (LIT_MAGIC_STRING_FLOOR, ECMA_MATH_OBJECT_FLOOR, 1, 1) -ROUTINE (LIT_MAGIC_STRING_LOG, ECMA_MATH_OBJECT_LOG, 1, 1) -ROUTINE (LIT_MAGIC_STRING_MAX, ECMA_MATH_OBJECT_MAX, NON_FIXED, 2) -ROUTINE (LIT_MAGIC_STRING_MIN, ECMA_MATH_OBJECT_MIN, NON_FIXED, 2) -ROUTINE (LIT_MAGIC_STRING_POW, ECMA_MATH_OBJECT_POW, 2, 2) -ROUTINE (LIT_MAGIC_STRING_RANDOM, ECMA_MATH_OBJECT_RANDOM, 0, 0) -ROUTINE (LIT_MAGIC_STRING_ROUND, ECMA_MATH_OBJECT_ROUND, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SIN, ECMA_MATH_OBJECT_SIN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_SQRT, ECMA_MATH_OBJECT_SQRT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TAN, ECMA_MATH_OBJECT_TAN, 1, 1) -#if ENABLED (JERRY_ES2015_BUILTIN) -ROUTINE (LIT_MAGIC_STRING_SIGN, ECMA_MATH_OBJECT_SIGN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TRUNC, ECMA_MATH_OBJECT_TRUNC, 1, 1) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ - -#endif /* ENABLED (JERRY_BUILTIN_MATH) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number-prototype.inc.h deleted file mode 100644 index 8b509255b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number-prototype.inc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Number.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_NUMBER) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.7.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_NUMBER, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_NUMBER_PROTOTYPE_TO_STRING, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ECMA_NUMBER_PROTOTYPE_VALUE_OF, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_NUMBER_PROTOTYPE_TO_LOCALE_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_FIXED_UL, ECMA_NUMBER_PROTOTYPE_TO_FIXED, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TO_EXPONENTIAL_UL, ECMA_NUMBER_PROTOTYPE_TO_EXPONENTIAL, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TO_PRECISION_UL, ECMA_NUMBER_PROTOTYPE_TO_PRECISION, 1, 1) - -#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number.inc.h deleted file mode 100644 index 695f9cb9d..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-number.inc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Number built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_NUMBER) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.7.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.7.3.4 */ -NUMBER_VALUE (LIT_MAGIC_STRING_NAN, - ECMA_BUILTIN_NUMBER_NAN, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.7.3.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_MAX_VALUE_U, - ECMA_BUILTIN_NUMBER_MAX, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.7.3.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_MIN_VALUE_U, - ECMA_BUILTIN_NUMBER_MIN, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.7.3.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_POSITIVE_INFINITY_U, - ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.7.3.6 */ -NUMBER_VALUE (LIT_MAGIC_STRING_NEGATIVE_INFINITY_U, - ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.7.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -#if ENABLED (JERRY_ES2015_BUILTIN) -ROUTINE (LIT_MAGIC_STRING_IS_FINITE, ecma_builtin_number_object_is_finite, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_NAN, ecma_builtin_number_object_is_nan, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_INTEGER, ecma_builtin_number_object_is_integer, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_SAFE_INTEGER, ecma_builtin_number_object_is_safe_integer, 1, 1) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object-prototype.inc.h deleted file mode 100644 index 5da1290be..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object-prototype.inc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Object.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.2.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_OBJECT, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_OBJECT_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ECMA_OBJECT_PROTOTYPE_VALUE_OF, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ECMA_OBJECT_PROTOTYPE_TO_LOCALE_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_HAS_OWN_PROPERTY_UL, ECMA_OBJECT_PROTOTYPE_HAS_OWN_PROPERTY, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_PROTOTYPE_OF_UL, ECMA_OBJECT_PROTOTYPE_IS_PROTOTYPE_OF, 1, 1) -ROUTINE (LIT_MAGIC_STRING_PROPERTY_IS_ENUMERABLE_UL, ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE, 1, 1) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object.inc.h deleted file mode 100644 index 457a28233..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-object.inc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Object built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.2.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.2.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_GET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_GET_PROTOTYPE_OF, 1, 1) -ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_NAMES_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_NAMES, 1, 1) -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_SYMBOLS_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_SYMBOLS, 1, 1) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -ROUTINE (LIT_MAGIC_STRING_SEAL, ECMA_OBJECT_ROUTINE_SEAL, 1, 1) -ROUTINE (LIT_MAGIC_STRING_FREEZE, ECMA_OBJECT_ROUTINE_FREEZE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_PREVENT_EXTENSIONS_UL, ECMA_OBJECT_ROUTINE_PREVENT_EXTENSIONS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_SEALED_UL, ECMA_OBJECT_ROUTINE_IS_SEALED, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_FROZEN_UL, ECMA_OBJECT_ROUTINE_IS_FROZEN, 1, 1) -ROUTINE (LIT_MAGIC_STRING_IS_EXTENSIBLE, ECMA_OBJECT_ROUTINE_IS_EXTENSIBLE, 1, 1) -ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_OBJECT_ROUTINE_KEYS, 1, 1) -ROUTINE (LIT_MAGIC_STRING_GET_OWN_PROPERTY_DESCRIPTOR_UL, ECMA_OBJECT_ROUTINE_GET_OWN_PROPERTY_DESCRIPTOR, 2, 2) -ROUTINE (LIT_MAGIC_STRING_CREATE, ECMA_OBJECT_ROUTINE_CREATE, 2, 2) -ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTIES_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTIES, 2, 2) -ROUTINE (LIT_MAGIC_STRING_DEFINE_PROPERTY_UL, ECMA_OBJECT_ROUTINE_DEFINE_PROPERTY, 3, 3) - -#if ENABLED (JERRY_ES2015_BUILTIN) -ROUTINE (LIT_MAGIC_STRING_SET_PROTOTYPE_OF_UL, ECMA_OBJECT_ROUTINE_SET_PROTOTYPE_OF, 2, 2) -ROUTINE (LIT_MAGIC_STRING_ASSIGN, ECMA_OBJECT_ROUTINE_ASSIGN, NON_FIXED, 2) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise-prototype.inc.h deleted file mode 100644 index 872fab5da..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise-prototype.inc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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 "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) - -/* Object properties: - * (property name, object pointer getter) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_PROMISE, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FLAG_WRITABLE) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 25.4.5.4 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_PROMISE_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -ROUTINE (LIT_MAGIC_STRING_THEN, ecma_builtin_promise_prototype_then, 2, 2) -ROUTINE (LIT_MAGIC_STRING_CATCH, ecma_builtin_promise_prototype_catch, 1, 1) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise.inc.h deleted file mode 100644 index 3135ac70b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-promise.inc.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Promose built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_PROMISE_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_REJECT, ecma_builtin_promise_reject, 1, 1) -ROUTINE (LIT_MAGIC_STRING_RESOLVE, ecma_builtin_promise_resolve, 1, 1) -ROUTINE (LIT_MAGIC_STRING_RACE, ecma_builtin_promise_race, 1, 1) -ROUTINE (LIT_MAGIC_STRING_ALL, ecma_builtin_promise_all, 1, 1) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror-prototype.inc.h deleted file mode 100644 index 684171590..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * RangeError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_RANGE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_RANGE_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror.inc.h deleted file mode 100644 index b1da135d2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-rangeerror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * RangeError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror-prototype.inc.h deleted file mode 100644 index 496ea9923..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * ReferenceError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_REFERENCE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_REFERENCE_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror.inc.h deleted file mode 100644 index 077a93d31..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-referenceerror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * ReferenceError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp-prototype.inc.h deleted file mode 100644 index 33a1375bf..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp-prototype.inc.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * RegExp.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -/* ECMA-262 v5, 15.10.6.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_REGEXP, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_ES2015) -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_FLAGS, - ecma_builtin_regexp_prototype_get_flags, - ECMA_PROPERTY_FIXED) - -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SOURCE, - ecma_builtin_regexp_prototype_get_source, - ECMA_PROPERTY_FIXED) - -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_GLOBAL, - ecma_builtin_regexp_prototype_get_global, - ECMA_PROPERTY_FIXED) - -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_IGNORECASE_UL, - ecma_builtin_regexp_prototype_get_ignorecase, - ECMA_PROPERTY_FIXED) - -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_MULTILINE, - ecma_builtin_regexp_prototype_get_multiline, - ECMA_PROPERTY_FIXED) -#else /* !ENABLED (JERRY_ES2015) */ -/* ECMA-262 v5, 15.10.7.1 */ -STRING_VALUE (LIT_MAGIC_STRING_SOURCE, - LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.2 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_GLOBAL, - ECMA_VALUE_FALSE, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.3 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_IGNORECASE_UL, - ECMA_VALUE_FALSE, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.7.4 */ -SIMPLE_VALUE (LIT_MAGIC_STRING_MULTILINE, - ECMA_VALUE_FALSE, - ECMA_PROPERTY_FIXED) -#endif /* ENABLED (JERRY_ES2015) */ - -/* ECMA-262 v5, 15.10.7.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL, - 0, - ECMA_PROPERTY_FLAG_WRITABLE) - -#if ENABLED (JERRY_BUILTIN_ANNEXB) -ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1) -#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */ -ROUTINE (LIT_MAGIC_STRING_EXEC, ecma_builtin_regexp_prototype_exec, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TEST, ecma_builtin_regexp_prototype_test, 1, 1) -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_regexp_prototype_to_string, 0, 0) - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp.inc.h deleted file mode 100644 index 135427af4..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-regexp.inc.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * RegExp built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -/* ECMA-262 v5, 15.10.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 2, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v5, 15.10.5.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-iterator-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-iterator-prototype.inc.h deleted file mode 100644 index a19399163..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-iterator-prototype.inc.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %SetIteratorPrototype% built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) - -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_SET_ITERATOR_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_set_iterator_prototype_object_next, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-prototype.inc.h deleted file mode 100644 index a0356127a..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set-prototype.inc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Set.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 23.2.3.2 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_SET, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 23.1.3.13 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_SET_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_ADD, ecma_builtin_set_prototype_object_add, 1, 1) -ROUTINE (LIT_MAGIC_STRING_CLEAR, ecma_builtin_set_prototype_object_clear, 0, 0) -ROUTINE (LIT_MAGIC_STRING_DELETE, ecma_builtin_set_prototype_object_delete, 1, 1) -ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_set_prototype_object_foreach, 2, 1) -ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_set_prototype_object_has, 1, 1) -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_set_prototype_object_entries, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_set_prototype_object_values, 0, 0) -ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_set_prototype_object_keys, 0, 0) -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_set_prototype_object_values, 0, 0) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE, - ecma_builtin_set_prototype_object_size_getter, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set.inc.h deleted file mode 100644 index c2847bbc4..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-set.inc.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Set built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v6, 23.2.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 23.1 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_SET_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 23.2.2.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_SET_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-iterator-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-iterator-prototype.inc.h deleted file mode 100644 index 9a04570e7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-iterator-prototype.inc.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %StringIteratorPrototype% built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) - -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_STRING_ITERATOR_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_string_iterator_prototype_object_next, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-prototype.inc.h deleted file mode 100644 index 5679079c0..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string-prototype.inc.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * String.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_STRING) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.5.4.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_STRING, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Number properties: - * (property name, number value) */ - -/* ECMA-262 v5, 15.5.4 (String.prototype is itself a String object whose value is an empty String), 15.5.5.1 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ECMA_STRING_PROTOTYPE_TO_STRING, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ECMA_STRING_PROTOTYPE_VALUE_OF, 0, 0) -ROUTINE (LIT_MAGIC_STRING_CONCAT, ECMA_STRING_PROTOTYPE_CONCAT, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_SLICE, ECMA_STRING_PROTOTYPE_SLICE, 2, 2) -ROUTINE (LIT_MAGIC_STRING_INDEX_OF_UL, ECMA_STRING_PROTOTYPE_INDEX_OF, 2, 1) -ROUTINE (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, ECMA_STRING_PROTOTYPE_LAST_INDEX_OF, 2, 1) -ROUTINE (LIT_MAGIC_STRING_CHAR_AT_UL, ECMA_STRING_PROTOTYPE_CHAR_AT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_CHAR_CODE_AT_UL, ECMA_STRING_PROTOTYPE_CHAR_CODE_AT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_LOCALE_COMPARE_UL, ECMA_STRING_PROTOTYPE_LOCALE_COMPARE, 1, 1) - -#if ENABLED (JERRY_BUILTIN_REGEXP) -ROUTINE (LIT_MAGIC_STRING_MATCH, ECMA_STRING_PROTOTYPE_MATCH, 1, 1) -ROUTINE (LIT_MAGIC_STRING_REPLACE, ECMA_STRING_PROTOTYPE_REPLACE, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SEARCH, ECMA_STRING_PROTOTYPE_SEARCH, 1, 1) -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -ROUTINE (LIT_MAGIC_STRING_SPLIT, ECMA_STRING_PROTOTYPE_SPLIT, 2, 2) -ROUTINE (LIT_MAGIC_STRING_SUBSTRING, ECMA_STRING_PROTOTYPE_SUBSTRING, 2, 2) -ROUTINE (LIT_MAGIC_STRING_TO_LOWER_CASE_UL, ECMA_STRING_PROTOTYPE_TO_LOWER_CASE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_LOWER_CASE_UL, ECMA_STRING_PROTOTYPE_TO_LOCAL_LOWER_CASE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, ECMA_STRING_PROTOTYPE_TO_UPPER_CASE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_UPPER_CASE_UL, ECMA_STRING_PROTOTYPE_TO_LOCAL_UPPER_CASE, 0, 0) -ROUTINE (LIT_MAGIC_STRING_TRIM, ECMA_STRING_PROTOTYPE_TRIM, 0, 0) - -#if ENABLED (JERRY_BUILTIN_ANNEXB) -ROUTINE (LIT_MAGIC_STRING_SUBSTR, ECMA_STRING_PROTOTYPE_SUBSTR, 2, 2) -#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */ - -#if ENABLED (JERRY_ES2015_BUILTIN) -ROUTINE (LIT_MAGIC_STRING_REPEAT, ECMA_STRING_PROTOTYPE_REPEAT, 1, 1) -ROUTINE (LIT_MAGIC_STRING_STARTS_WITH, ECMA_STRING_PROTOTYPE_STARTS_WITH, 2, 1) -ROUTINE (LIT_MAGIC_STRING_INCLUDES, ECMA_STRING_PROTOTYPE_INCLUDES, 2, 1) -ROUTINE (LIT_MAGIC_STRING_ENDS_WITH, ECMA_STRING_PROTOTYPE_ENDS_WITH, 2, 1) -#endif /* ENABLED (JERRY_ES2015_BUILTIN) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_STRING_PROTOTYPE_ITERATOR, 0, 0) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#endif /* ENABLED (JERRY_BUILTIN_STRING) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string.inc.h deleted file mode 100644 index a8435a90b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-string.inc.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * String built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_STRING) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.5.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.7.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_STRING_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_FROM_CHAR_CODE_UL, ecma_builtin_string_object_from_char_code, NON_FIXED, 1) - -#endif /* ENABLED (JERRY_BUILTIN_STRING) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol-prototype.inc.h deleted file mode 100644 index 8301f78b8..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol-prototype.inc.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Symbol prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - -/* Object properties: - * (property name, object pointer getter) */ - -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_SYMBOL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FLAG_WRITABLE) - -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_symbol_prototype_object_to_string, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUE_OF_UL, ecma_builtin_symbol_prototype_object_value_of, 0, 0) -ROUTINE_CONFIGURABLE_ONLY (LIT_GLOBAL_SYMBOL_TO_PRIMITIVE, - ecma_builtin_symbol_prototype_object_to_primitive, - 0, - 0) - -/* ECMA-262 v6, 19.4.3.4 */ -STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - LIT_MAGIC_STRING_SYMBOL_UL, - ECMA_PROPERTY_FLAG_CONFIGURABLE) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol.inc.h deleted file mode 100644 index b9a33ffde..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-symbol.inc.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Symbol built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v6, 19.4.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v6, 19.4.2.7 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* ECMA-262 v6, 19.4.2.2 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_HAS_INSTANCE, - LIT_GLOBAL_SYMBOL_HAS_INSTANCE) - -/* ECMA-262 v6, 19.4.2.3 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_IS_CONCAT_SPREADABLE, - LIT_GLOBAL_SYMBOL_IS_CONCAT_SPREADABLE) - -/* ECMA-262 v6, 19.4.2.4 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_ITERATOR, - LIT_GLOBAL_SYMBOL_ITERATOR) - -/* ECMA-262 v6, 19.4.2.6 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_MATCH, - LIT_GLOBAL_SYMBOL_MATCH) - -/* ECMA-262 v6, 19.4.2.8 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_REPLACE, - LIT_GLOBAL_SYMBOL_REPLACE) - -/* ECMA-262 v6, 19.4.2.9 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_SEARCH, - LIT_GLOBAL_SYMBOL_SEARCH) - -/* ECMA-262 v6, 19.4.2.10 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_SPECIES, - LIT_GLOBAL_SYMBOL_SPECIES) - -/* ECMA-262 v6, 19.4.2.11 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_SPLIT, - LIT_GLOBAL_SYMBOL_SPLIT) - -/* ECMA-262 v6, 19.4.2.12 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_TO_PRIMITIVE, - LIT_GLOBAL_SYMBOL_TO_PRIMITIVE) - -/* ECMA-262 v6, 19.4.2.13 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_TO_STRING_TAG, - LIT_GLOBAL_SYMBOL_TO_STRING_TAG) - -/* ECMA-262 v6, 19.4.2.14 */ -SYMBOL_VALUE (LIT_MAGIC_STRING_UNSCOPABLES, - LIT_GLOBAL_SYMBOL_UNSCOPABLES) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_FOR, ecma_builtin_symbol_for, 1, 1) -ROUTINE (LIT_MAGIC_STRING_KEY_FOR, ecma_builtin_symbol_key_for, 1, 1) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror-prototype.inc.h deleted file mode 100644 index 827290ade..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * SyntaxError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_SYNTAX_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_SYNTAX_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror.inc.h deleted file mode 100644 index 3585aea91..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-syntaxerror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * SyntaxError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-type-error-thrower.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-type-error-thrower.inc.h deleted file mode 100644 index 640f40fd4..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-type-error-thrower.inc.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * [[ThrowTypeError]] description - * - * See also: ECMA-262 v5, 13.2.3 - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 0, - ECMA_PROPERTY_FIXED) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-helpers.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-helpers.h deleted file mode 100644 index 7ddee8e31..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-helpers.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_TYPEDARRAY_HELPERS_H -#define ECMA_TYPEDARRAY_HELPERS_H -#include "ecma-globals.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmabuiltinhelpers ECMA builtin helper operations - * @{ - */ - -ecma_value_t -ecma_typedarray_helper_dispatch_construct (const ecma_value_t *arguments_list_p, - ecma_length_t arguments_list_len, - ecma_typedarray_type_t typedarray_id); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ -#endif /* !ECMA_TYPEDARRAY_HELPERS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype-template.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype-template.inc.h deleted file mode 100644 index 18615ec93..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype-template.inc.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#ifndef TYPEDARRAY_BYTES_PER_ELEMENT -# error "Please define TYPEDARRAY_BYTES_PER_ELEMENT" -#endif /* !TYPEDARRAY_BYTES_PER_ELEMENT */ - -#ifndef TYPEDARRAY_BUILTIN_ID -# error "Please define TYPEDARRAY_BUILTIN_ID" -#endif /* !TYPEDARRAY_BUILTIN_ID */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* ES2015 22.2.3.4 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - TYPEDARRAY_BUILTIN_ID, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ES2015 22.2.6.1 */ -NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, - TYPEDARRAY_BYTES_PER_ELEMENT, - ECMA_PROPERTY_FIXED) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" - -#undef TYPEDARRAY_BUILTIN_ID -#undef TYPEDARRAY_BYTES_PER_ELEMENT - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype.inc.h deleted file mode 100644 index 7ca5b43af..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-prototype.inc.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %TypedArrayPrototype% description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/* ES2015 22.2.3.4 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_TYPEDARRAY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* Readonly accessor properties */ -/* ES2015 22.2.3.1 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BUFFER, - ecma_builtin_typedarray_prototype_buffer_getter, - ECMA_PROPERTY_FIXED) -/* ES2015 22.2.3.2 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_LENGTH_UL, - ecma_builtin_typedarray_prototype_bytelength_getter, - ECMA_PROPERTY_FIXED) -/* ES2015 22.2.3.3 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_BYTE_OFFSET_UL, - ecma_builtin_typedarray_prototype_byteoffset_getter, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.3.17 */ -ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_LENGTH, - ecma_builtin_typedarray_prototype_length_getter, - ECMA_PROPERTY_FIXED) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/* ECMA-262 v6, 23.1.3.13 */ -ACCESSOR_READ_ONLY (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, - ecma_builtin_typedarray_prototype_to_string_tag_getter, - ECMA_PROPERTY_FLAG_CONFIGURABLE) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ -ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_typedarray_prototype_object_to_string, 0, 0) -ROUTINE (LIT_MAGIC_STRING_JOIN, ecma_builtin_typedarray_prototype_join, 1, 1) -ROUTINE (LIT_MAGIC_STRING_EVERY, ecma_builtin_typedarray_prototype_every, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SOME, ecma_builtin_typedarray_prototype_some, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_typedarray_prototype_for_each, 2, 1) -ROUTINE (LIT_MAGIC_STRING_MAP, ecma_builtin_typedarray_prototype_map, 2, 1) -ROUTINE (LIT_MAGIC_STRING_REDUCE, ecma_builtin_typedarray_prototype_reduce, 2, 1) -ROUTINE (LIT_MAGIC_STRING_REDUCE_RIGHT_UL, ecma_builtin_typedarray_prototype_reduce_right, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FILTER, ecma_builtin_typedarray_prototype_filter, 2, 1) -ROUTINE (LIT_MAGIC_STRING_REVERSE, ecma_builtin_typedarray_prototype_reverse, 0, 0) -ROUTINE (LIT_MAGIC_STRING_SET, ecma_builtin_typedarray_prototype_set, 2, 1) -ROUTINE (LIT_MAGIC_STRING_SUBARRAY, ecma_builtin_typedarray_prototype_subarray, 2, 2) -ROUTINE (LIT_MAGIC_STRING_FILL, ecma_builtin_typedarray_prototype_fill, 3, 1) -ROUTINE (LIT_MAGIC_STRING_SORT, ecma_builtin_typedarray_prototype_sort, 1, 1) -ROUTINE (LIT_MAGIC_STRING_FIND, ecma_builtin_typedarray_prototype_find, 2, 1) -ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ecma_builtin_typedarray_prototype_find_index, 2, 1) -ROUTINE (LIT_MAGIC_STRING_INDEX_OF_UL, ecma_builtin_typedarray_prototype_index_of, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_LAST_INDEX_OF_UL, ecma_builtin_typedarray_prototype_last_index_of, NON_FIXED, 1) -ROUTINE (LIT_MAGIC_STRING_COPY_WITHIN, ecma_builtin_typedarray_prototype_copy_within, NON_FIXED, 2) -ROUTINE (LIT_MAGIC_STRING_SLICE, ecma_builtin_typedarray_prototype_slice, NON_FIXED, 2) -ROUTINE (LIT_MAGIC_STRING_TO_LOCALE_STRING_UL, ecma_builtin_typedarray_prototype_to_locale_string, 0, 0) - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) - -ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_typedarray_prototype_keys, 0, 0) -ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_typedarray_prototype_values, 0, 0) -ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_typedarray_prototype_entries, 0, 0) -ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_typedarray_prototype_values, 0, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-template.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-template.inc.h deleted file mode 100644 index f1ba74060..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray-template.inc.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#ifndef TYPEDARRAY_BYTES_PER_ELEMENT -# error "Please define TYPEDARRAY_BYTES_PER_ELEMENT" -#endif /* !TYPEDARRAY_BYTES_PER_ELEMENT */ - -#ifndef TYPEDARRAY_MAGIC_STRING_ID -# error "Please define TYPEDARRAY_MAGIC_STRING_ID" -#endif /* !TYPEDARRAY_MAGIC_STRING_ID */ - -#ifndef TYPEDARRAY_BUILTIN_ID -# error "Please define TYPEDARRAY_BUILTIN_ID" -#endif /* !TYPEDARRAY_BUILTIN_ID */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -/* ES2015 22.2.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 3, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.5.1 */ -NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, - TYPEDARRAY_BYTES_PER_ELEMENT, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.5 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 3, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.5 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - TYPEDARRAY_MAGIC_STRING_ID, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.5.2 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - TYPEDARRAY_BUILTIN_ID, - ECMA_PROPERTY_FIXED) - -#include "ecma-builtin-helpers-macro-undefs.inc.h" - -#undef TYPEDARRAY_BUILTIN_ID -#undef TYPEDARRAY_MAGIC_STRING_ID -#undef TYPEDARRAY_BYTES_PER_ELEMENT - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray.inc.h deleted file mode 100644 index 36cf1eaf5..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typedarray.inc.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * %TypedArray% description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/* ES2015 22.2.2 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 3, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.2 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_TYPED_ARRAY_UL, - ECMA_PROPERTY_FIXED) - -/* ES2015 22.2.2.3 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -/* Routine properties: - * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ - -/* ES2015 22.2.2.1 */ -ROUTINE (LIT_MAGIC_STRING_FROM, ecma_builtin_typedarray_from, NON_FIXED, 1) - -/* ES2015 22.2.2.2 */ -ROUTINE (LIT_MAGIC_STRING_OF, ecma_builtin_typedarray_of, NON_FIXED, 0) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror-prototype.inc.h deleted file mode 100644 index d570124c7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * TypeError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_TYPE_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_TYPE_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror.inc.h deleted file mode 100644 index 587c4e769..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-typeerror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * TypeError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array-prototype.inc.h deleted file mode 100644 index cacee6525..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint16Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 2 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT16ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array.inc.h deleted file mode 100644 index 90c3dd931..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint16array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint16Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 2 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_UINT16_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array-prototype.inc.h deleted file mode 100644 index 4d75dea12..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint32Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT32ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array.inc.h deleted file mode 100644 index 7eb9e7f1b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint32array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint32Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 4 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_UINT32_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array-prototype.inc.h deleted file mode 100644 index 5c89a0162..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint8Array prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT8ARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array.inc.h deleted file mode 100644 index 5fbdd6f31..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8array.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint8Array description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_UINT8_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray-prototype.inc.h deleted file mode 100644 index 623091f89..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray-prototype.inc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint8ClampedArray prototype description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY -#include "ecma-builtin-typedarray-prototype-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray.inc.h deleted file mode 100644 index 68942b867..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-uint8clampedarray.inc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Uint8ClampedArray description - */ - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -#define TYPEDARRAY_BYTES_PER_ELEMENT 1 -#define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_UINT8_CLAMPED_ARRAY_UL -#define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE -#include "ecma-builtin-typedarray-template.inc.h" - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror-prototype.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror-prototype.inc.h deleted file mode 100644 index 9f9213175..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror-prototype.inc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * UriError.prototype built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.7.8 */ -OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, - ECMA_BUILTIN_ID_URI_ERROR, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.9 */ -STRING_VALUE (LIT_MAGIC_STRING_NAME, - LIT_MAGIC_STRING_URI_ERROR_UL, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -/* ECMA-262 v5, 15.11.7.10 */ -STRING_VALUE (LIT_MAGIC_STRING_MESSAGE, - LIT_MAGIC_STRING__EMPTY, - ECMA_PROPERTY_CONFIGURABLE_WRITABLE) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror.inc.h deleted file mode 100644 index c0d555be1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtin-urierror.inc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * UriError built-in description - */ - -#include "ecma-builtin-helpers-macro-defines.inc.h" - -#if ENABLED (JERRY_BUILTIN_ERRORS) - -/* Number properties: - * (property name, number value, writable, enumerable, configurable) */ - -/* ECMA-262 v5, 15.11.3 */ -NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH, - 1, - ECMA_PROPERTY_FIXED) - -/* Object properties: - * (property name, object pointer getter) */ - -/* ECMA-262 v5, 15.11.3.1 */ -OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE, - ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, - ECMA_PROPERTY_FIXED) - -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -#include "ecma-builtin-helpers-macro-undefs.inc.h" diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins-internal.h deleted file mode 100644 index c82672bd9..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins-internal.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_BUILTINS_INTERNAL_H -#define ECMA_BUILTINS_INTERNAL_H - -#ifndef ECMA_BUILTINS_INTERNAL -# error "!ECMA_BUILTINS_INTERNAL" -#endif /* !ECMA_BUILTINS_INTERNAL */ - -#include "ecma-builtins.h" -#include "ecma-globals.h" - -/** - * Type of built-in properties. - */ -typedef enum -{ - ECMA_BUILTIN_PROPERTY_SIMPLE, /**< simple value property */ - ECMA_BUILTIN_PROPERTY_NUMBER, /**< number value property */ - ECMA_BUILTIN_PROPERTY_STRING, /**< string value property */ -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - ECMA_BUILTIN_PROPERTY_SYMBOL, /**< symbol value property */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - ECMA_BUILTIN_PROPERTY_OBJECT, /**< builtin object property */ - ECMA_BUILTIN_PROPERTY_ROUTINE, /**< routine property */ - ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_WRITE, /**< full accessor property */ - ECMA_BUILTIN_PROPERTY_ACCESSOR_READ_ONLY, /**< read-only accessor property */ - ECMA_BUILTIN_PROPERTY_END, /**< last property */ -} ecma_builtin_property_type_t; - -/** - * Type of symbolic built-in number types (starting from 256). - */ -typedef enum -{ - ECMA_BUILTIN_NUMBER_MAX = 256, /**< value of ECMA_NUMBER_MAX_VALUE */ - ECMA_BUILTIN_NUMBER_MIN, /**< value of ECMA_NUMBER_MIN_VALUE */ -#if ENABLED (JERRY_ES2015_BUILTIN) - ECMA_BUILTIN_NUMBER_EPSILON, /**< value of ECMA_NUMBER_EPSILON */ - ECMA_BUILTIN_NUMBER_MAX_SAFE_INTEGER, /**< value of ECMA_NUMBER_MAX_SAFE_INTEGER */ -#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */ - ECMA_BUILTIN_NUMBER_E, /**< value of ECMA_NUMBER_E */ - ECMA_BUILTIN_NUMBER_PI, /**< value of ECMA_NUMBER_PI */ - ECMA_BUILTIN_NUMBER_LN10, /**< value of ECMA_NUMBER_LN10 */ - ECMA_BUILTIN_NUMBER_LN2, /**< value of ECMA_NUMBER_LN2 */ - ECMA_BUILTIN_NUMBER_LOG2E, /**< value of ECMA_NUMBER_LOG2E */ - ECMA_BUILTIN_NUMBER_LOG10E, /**< value of ECMA_NUMBER_LOG10E */ - ECMA_BUILTIN_NUMBER_SQRT2, /**< value of ECMA_NUMBER_SQRT2 */ - ECMA_BUILTIN_NUMBER_SQRT_1_2, /**< value of ECMA_NUMBER_SQRT_1_2 */ - ECMA_BUILTIN_NUMBER_NAN, /**< result of ecma_number_make_nan () */ - ECMA_BUILTIN_NUMBER_POSITIVE_INFINITY, /**< result of ecma_number_make_infinity (false) */ - ECMA_BUILTIN_NUMBER_NEGATIVE_INFINITY, /**< result of ecma_number_make_infinity (true) */ -} ecma_builtin_number_type_t; - -/** - * Description of built-in properties. - */ -typedef struct -{ - uint16_t magic_string_id; /**< name of the property */ - uint8_t type; /**< type of the property */ - uint8_t attributes; /**< attributes of the property */ - uint16_t value; /**< value of the property */ -} ecma_builtin_property_descriptor_t; - -#define BUILTIN_ROUTINE(builtin_id, \ - object_type, \ - object_prototype_builtin_id, \ - is_extensible, \ - lowercase_name) \ -extern const ecma_builtin_property_descriptor_t \ -ecma_builtin_ ## lowercase_name ## _property_descriptor_list[]; \ -ecma_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_call (const ecma_value_t *, \ - ecma_length_t); \ -ecma_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_construct (const ecma_value_t *, \ - ecma_length_t); \ -ecma_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \ - ecma_value_t this_arg_value, \ - const ecma_value_t [], \ - ecma_length_t); -#define BUILTIN(builtin_id, \ - object_type, \ - object_prototype_builtin_id, \ - is_extensible, \ - lowercase_name) \ -extern const ecma_builtin_property_descriptor_t \ -ecma_builtin_ ## lowercase_name ## _property_descriptor_list[]; \ -ecma_value_t \ -ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \ - ecma_value_t this_arg_value, \ - const ecma_value_t [], \ - ecma_length_t); -#include "ecma-builtins.inc.h" - -#undef BUILTIN_ROUTINE -#undef BUILTIN - -#endif /* !ECMA_BUILTINS_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.h deleted file mode 100644 index 15d21c42e..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_BUILTINS_H -#define ECMA_BUILTINS_H - -#include "ecma-globals.h" - -/** - * A built-in object's identifier - */ -typedef enum -{ -/** @cond doxygen_suppress */ -#define BUILTIN(a, b, c, d, e) -#define BUILTIN_ROUTINE(builtin_id, \ - object_type, \ - object_prototype_builtin_id, \ - is_extensible, \ - lowercase_name) \ - builtin_id, -#include "ecma-builtins.inc.h" -#undef BUILTIN -#undef BUILTIN_ROUTINE -#define BUILTIN_ROUTINE(a, b, c, d, e) -#define BUILTIN(builtin_id, \ - object_type, \ - object_prototype_builtin_id, \ - is_extensible, \ - lowercase_name) \ - builtin_id, -#include "ecma-builtins.inc.h" -#undef BUILTIN -#undef BUILTIN_ROUTINE -/** @endcond */ - ECMA_BUILTIN_ID__COUNT /**< number of built-in objects */ -} ecma_builtin_id_t; - -/** - * Construct a routine value - */ -#define ECMA_ROUTINE_VALUE(id, length) (((id) << 4) | length) - -/** - * Get routine length - */ -#define ECMA_GET_ROUTINE_LENGTH(value) ((uint8_t) ((value) & 0xf)) - -/** - * Get routine ID - */ -#define ECMA_GET_ROUTINE_ID(value) ((uint16_t) ((value) >> 4)) - -/** - * Construct a fully accessor value - */ -#define ECMA_ACCESSOR_READ_WRITE(getter, setter) (((getter) << 8) | (setter)) - -/** - * Get accessor setter ID - */ -#define ECMA_ACCESSOR_READ_WRITE_GET_SETTER_ID(value) ((uint16_t) ((value) & 0xff)) - -/** - * Get accessor getter ID - */ -#define ECMA_ACCESSOR_READ_WRITE_GET_GETTER_ID(value) ((uint16_t) ((value) >> 8)) - -/* ecma-builtins.c */ -void ecma_finalize_builtins (void); - -ecma_value_t -ecma_builtin_dispatch_call (ecma_object_t *obj_p, ecma_value_t this_arg_value, - const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); -ecma_value_t -ecma_builtin_dispatch_construct (ecma_object_t *obj_p, - const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); -ecma_property_t * -ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *string_p); -void -ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, - bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); -bool -ecma_builtin_is (ecma_object_t *obj_p, ecma_builtin_id_t builtin_id); -ecma_object_t * -ecma_builtin_get (ecma_builtin_id_t builtin_id); -ecma_object_t * -ecma_builtin_get_global (void); -bool -ecma_builtin_function_is_routine (ecma_object_t *func_obj_p); - -#endif /* !ECMA_BUILTINS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.inc.h deleted file mode 100644 index ddd19606f..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-builtins.inc.h +++ /dev/null @@ -1,546 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* Description of built-in objects - in format (ECMA_BUILTIN_ID_id, object_type, prototype_id, is_extensible, is_static, underscored_id) */ - -/* The Object.prototype object (15.2.4) */ -BUILTIN (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID__COUNT /* no prototype */, - true, - object_prototype) - -/* The Object object (15.2.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_OBJECT, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - object) - -#if ENABLED (JERRY_BUILTIN_ARRAY) -/* The Array.prototype object (15.4.4) */ -BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_ARRAY, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - array_prototype) - -/* The Array object (15.4.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - array) -#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */ - -#if ENABLED (JERRY_BUILTIN_STRING) -/* The String.prototype object (15.5.4) */ -BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE, - ECMA_OBJECT_TYPE_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - string_prototype) - -/* The String object (15.5.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_STRING, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - string) -#endif /* ENABLED (JERRY_BUILTIN_STRING) */ - -#if ENABLED (JERRY_BUILTIN_BOOLEAN) -/* The Boolean.prototype object (15.6.4) */ -BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE, - ECMA_OBJECT_TYPE_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - boolean_prototype) - -/* The Boolean object (15.6.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_BOOLEAN, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - boolean) -#endif /* ENABLED (JERRY_BUILTIN_BOOLEAN) */ - -#if ENABLED (JERRY_BUILTIN_NUMBER) -/* The Number.prototype object (15.7.4) */ -BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE, - ECMA_OBJECT_TYPE_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - number_prototype) - -/* The Number object (15.7.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_NUMBER, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - number) -#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */ - -/* The Function.prototype object (15.3.4) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - function_prototype) - -/* The Function object (15.3.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FUNCTION, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - function) - -#if ENABLED (JERRY_BUILTIN_MATH) -/* The Math object (15.8) */ -BUILTIN (ECMA_BUILTIN_ID_MATH, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - math) -#endif /* ENABLED (JERRY_BUILTIN_MATH) */ - -#if ENABLED (JERRY_BUILTIN_JSON) -/* The JSON object (15.12) */ -BUILTIN (ECMA_BUILTIN_ID_JSON, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - json) -#endif /* ENABLED (JERRY_BUILTIN_JSON) */ - -#if ENABLED (JERRY_BUILTIN_DATE) -/* The Date.prototype object (15.9.4) */ -BUILTIN (ECMA_BUILTIN_ID_DATE_PROTOTYPE, - ECMA_OBJECT_TYPE_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - date_prototype) - -/* The Date object (15.9.3) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_DATE, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - date) -#endif /* ENABLED (JERRY_BUILTIN_DATE) */ - -#if ENABLED (JERRY_BUILTIN_REGEXP) -/* The RegExp.prototype object (15.10.6) */ -BUILTIN (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE, - ECMA_OBJECT_TYPE_CLASS, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - regexp_prototype) - -/* The RegExp object (15.10) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_REGEXP, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - regexp) -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -/* The Error object (15.11.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - error) - -/* The Error.prototype object (15.11.4) */ -BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - error_prototype) - -#if ENABLED (JERRY_BUILTIN_ERRORS) -/* The EvalError.prototype object (15.11.6.1) */ -BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - eval_error_prototype) - -/* The EvalError object (15.11.6.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_EVAL_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - eval_error) - -/* The RangeError.prototype object (15.11.6.2) */ -BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - range_error_prototype) - -/* The RangeError object (15.11.6.2) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_RANGE_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - range_error) - -/* The ReferenceError.prototype object (15.11.6.3) */ -BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - reference_error_prototype) - -/* The ReferenceError object (15.11.6.3) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_REFERENCE_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - reference_error) - -/* The SyntaxError.prototype object (15.11.6.4) */ -BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - syntax_error_prototype) - -/* The SyntaxError object (15.11.6.4) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_SYNTAX_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - syntax_error) - -/* The TypeError.prototype object (15.11.6.5) */ -BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - type_error_prototype) - -/* The TypeError object (15.11.6.5) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_TYPE_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - type_error) - -/* The URIError.prototype object (15.11.6.6) */ -BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ERROR_PROTOTYPE, - true, - uri_error_prototype) - -/* The URIError object (15.11.6.6) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_URI_ERROR, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - uri_error) -#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */ - -/**< The [[ThrowTypeError]] object (13.2.3) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - false, - type_error_thrower) - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/* The ArrayBuffer.prototype object (ES2015 24.1.4) */ -BUILTIN (ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - arraybuffer_prototype) - -/* The ArrayBuffer object (ES2015 24.1.2) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_ARRAYBUFFER, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - arraybuffer) - - /* The %TypedArrayPrototype% object (ES2015 24.2.3) */ -BUILTIN (ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - typedarray_prototype) - -/* The %TypedArray% intrinsic object (ES2015 22.2.1) - Note: The routines must be in this order. */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_TYPEDARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - typedarray) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_INT8ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - int8array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_UINT8ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - uint8array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - uint8clampedarray) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_INT16ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - int16array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_UINT16ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - uint16array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_INT32ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - int32array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_UINT32ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - uint32array) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FLOAT32ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - float32array) - -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FLOAT64ARRAY, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_TYPEDARRAY, - true, - float64array) -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ - - -BUILTIN (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - int8array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - uint8array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - uint8clampedarray_prototype) - -BUILTIN (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - int16array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - uint16array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - int32array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - uint32array_prototype) - -BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - float32array_prototype) - -#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64) -BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, - true, - float64array_prototype) -#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) - -BUILTIN (ECMA_BUILTIN_ID_PROMISE_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - promise_prototype) - -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_PROMISE, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - promise) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) - -/* The Map prototype object (23.1.3) */ -BUILTIN (ECMA_BUILTIN_ID_MAP_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - map_prototype) - -/* The Map routine (ECMA-262 v6, 23.1.1.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_MAP, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - map) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) - -/* The Set prototype object (23.1.3) */ -BUILTIN (ECMA_BUILTIN_ID_SET_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - set_prototype) - -/* The Set routine (ECMA-262 v6, 23.1.1.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_SET, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - set) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - -/* The Symbol prototype object (ECMA-262 v6, 19.4.2.7) */ -BUILTIN (ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - symbol_prototype) - -/* The Symbol routine (ECMA-262 v6, 19.4.2.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_SYMBOL, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - symbol) - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -/* The %IteratorPrototype% object (ECMA-262 v6, 25.1.2) */ -BUILTIN (ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - iterator_prototype) - -/* The %ArrayIteratorPrototype% object (ECMA-262 v6, 22.1.5.2) */ -BUILTIN (ECMA_BUILTIN_ID_ARRAY_ITERATOR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE, - true, - array_iterator_prototype) - -/* The %StringIteratorPrototype% object (ECMA-262 v6, 22.1.5.2) */ -BUILTIN (ECMA_BUILTIN_ID_STRING_ITERATOR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE, - true, - string_iterator_prototype) - -#if ENABLED (JERRY_ES2015_BUILTIN_SET) -/* The %SetIteratorPrototype% object (ECMA-262 v6, 23.2.5.2) */ -BUILTIN (ECMA_BUILTIN_ID_SET_ITERATOR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE, - true, - set_iterator_prototype) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) -/* The %MapIteratorPrototype% object (ECMA-262 v6, 23.1.5.2) */ -BUILTIN (ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE, - true, - map_iterator_prototype) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) -/* The DataView prototype object (ECMA-262 v6, 24.2.3.1) */ -BUILTIN (ECMA_BUILTIN_ID_DATAVIEW_PROTOTYPE, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, - true, - dataview_prototype) - -/* The DataView routine (ECMA-262 v6, 24.2.2.1) */ -BUILTIN_ROUTINE (ECMA_BUILTIN_ID_DATAVIEW, - ECMA_OBJECT_TYPE_FUNCTION, - ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE, - true, - dataview) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ - -/* The Global object (15.1) */ -BUILTIN (ECMA_BUILTIN_ID_GLOBAL, - ECMA_OBJECT_TYPE_GENERAL, - ECMA_BUILTIN_ID_OBJECT_PROTOTYPE, /* Implementation-dependent */ - true, - global) - -#undef BUILTIN diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-comparison.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-comparison.h deleted file mode 100644 index d8e0084eb..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-comparison.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_COMPARISON_H -#define ECMA_COMPARISON_H - -#include "ecma-globals.h" -#include "ecma-helpers.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmacomparison ECMA comparison - * @{ - */ - -ecma_value_t ecma_op_abstract_equality_compare (ecma_value_t x, ecma_value_t y); -bool ecma_op_strict_equality_compare (ecma_value_t x, ecma_value_t y); -ecma_value_t ecma_op_abstract_relational_compare (ecma_value_t x, ecma_value_t y, bool left_first); - -/** - * @} - * @} - */ - -#endif /* !ECMA_COMPARISON_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-container-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-container-object.h deleted file mode 100644 index 6959d2b9d..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-container-object.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_CONTAINER_OBJECT_H -#define ECMA_CONTAINER_OBJECT_H - -#include "ecma-globals.h" -#include "ecma-builtins.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmamaphelpers ECMA builtin map/set helper functions - * @{ - */ - -ecma_value_t ecma_op_container_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len, - lit_magic_string_id_t lit_id, ecma_builtin_id_t proto_id); -ecma_value_t ecma_op_container_size (ecma_value_t this_arg, lit_magic_string_id_t lit_id); -ecma_value_t ecma_op_container_get (ecma_value_t this_arg, ecma_value_t key_arg); -ecma_value_t ecma_op_container_foreach (ecma_value_t this_arg, ecma_value_t predicate, ecma_value_t predicate_this_arg, - lit_magic_string_id_t lit_id); -ecma_value_t ecma_op_container_has (ecma_value_t this_arg, ecma_value_t key_arg, lit_magic_string_id_t lit_id); -ecma_value_t ecma_op_container_set (ecma_value_t this_arg, ecma_value_t key_arg, ecma_value_t value_arg, - lit_magic_string_id_t lit_id); - -ecma_value_t ecma_op_container_clear (ecma_value_t this_arg, lit_magic_string_id_t lit_id); -ecma_value_t ecma_op_container_delete (ecma_value_t this_arg, ecma_value_t key_arg, lit_magic_string_id_t lit_id); -ecma_value_t ecma_op_container_create_iterator (ecma_value_t this_arg, uint8_t type, lit_magic_string_id_t lit_id, - ecma_builtin_id_t proto_id, ecma_pseudo_array_type_t iterator_type); -ecma_value_t ecma_op_container_iterator_next (ecma_value_t this_val, ecma_pseudo_array_type_t iterator_type); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) */ - -#endif /* !ECMA_CONTAINER_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-conversion.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-conversion.h deleted file mode 100644 index 61e511774..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-conversion.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_CONVERSION_H -#define ECMA_CONVERSION_H - -#include "ecma-globals.h" -#include "ecma-helpers.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaconversion ECMA conversion routines - * @{ - */ - -/** - * Second argument of 'ToPrimitive' operation that is a hint, - * specifying the preferred type of conversion result. - */ -typedef enum -{ - ECMA_PREFERRED_TYPE_NO, /**< no preferred type is specified */ - ECMA_PREFERRED_TYPE_NUMBER, /**< Number */ - ECMA_PREFERRED_TYPE_STRING /**< String */ -} ecma_preferred_type_hint_t; - -ecma_value_t ecma_op_check_object_coercible (ecma_value_t value); -bool ecma_op_same_value (ecma_value_t x, ecma_value_t y); -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) -bool ecma_op_same_value_zero (ecma_value_t x, ecma_value_t y); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */ -ecma_value_t ecma_op_to_primitive (ecma_value_t value, ecma_preferred_type_hint_t preferred_type); -bool ecma_op_to_boolean (ecma_value_t value); -ecma_value_t ecma_op_to_number (ecma_value_t value); -ecma_value_t ecma_get_number (ecma_value_t value, ecma_number_t *number_p); -ecma_value_t ecma_op_to_string (ecma_value_t value); -ecma_string_t *ecma_op_to_prop_name (ecma_value_t value); -ecma_value_t ecma_op_to_object (ecma_value_t value); -ecma_value_t ecma_op_to_integer (ecma_value_t value, ecma_number_t *number_p); -ecma_value_t ecma_op_to_length (ecma_value_t value, uint32_t *length); - -ecma_object_t *ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p); -ecma_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, ecma_property_descriptor_t *out_prop_desc_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_CONVERSION_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-dataview-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-dataview-object.h deleted file mode 100644 index 3bc658acd..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-dataview-object.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_DATAVIEW_OBJECT_H -#define ECMA_DATAVIEW_OBJECT_H - -#include "ecma-globals.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmadataviewobject ECMA builtin DataView helper functions - * @{ - */ - -ecma_value_t ecma_op_dataview_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); -ecma_dataview_object_t *ecma_op_dataview_get_object (ecma_value_t this_arg); -ecma_value_t ecma_op_dataview_get_set_view_value (ecma_value_t view, ecma_value_t request_index, - ecma_value_t little_endian, ecma_value_t value_to_set, - ecma_typedarray_type_t id); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ - -#endif /* !ECMA_DATAVIEW_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-eval.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-eval.h deleted file mode 100644 index 057c4d2fa..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-eval.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_EVAL_H -#define ECMA_EVAL_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup eval eval - * @{ - */ - -ecma_value_t -ecma_op_eval (ecma_string_t *code_p, uint32_t parse_opts); - -ecma_value_t -ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, size_t code_buffer_size, uint32_t parse_opts); - -/** - * @} - * @} - */ - -#endif /* !ECMA_EVAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-exceptions.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-exceptions.h deleted file mode 100644 index 0dc0122be..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-exceptions.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_EXCEPTIONS_H -#define ECMA_EXCEPTIONS_H - -#include "ecma-globals.h" -#include "jrt.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup exceptions Exceptions - * @{ - */ - -#if ENABLED (JERRY_ERROR_MESSAGES) -#define ECMA_ERR_MSG(msg) msg -#else /* !ENABLED (JERRY_ERROR_MESSAGES) */ -#define ECMA_ERR_MSG(msg) NULL -#endif /* ENABLED (JERRY_ERROR_MESSAGES) */ - -/** - * Native errors. - * - * See also: 15.11.1, 15.11.6 - */ -typedef enum -{ - ECMA_ERROR_NONE, /**< Not an Error */ - - ECMA_ERROR_COMMON, /**< Error */ - ECMA_ERROR_EVAL, /**< EvalError */ - ECMA_ERROR_RANGE, /**< RangeError */ - ECMA_ERROR_REFERENCE, /**< ReferenceError */ - ECMA_ERROR_SYNTAX, /**< SyntaxError */ - ECMA_ERROR_TYPE, /**< TypeError */ - ECMA_ERROR_URI /**< URIError */ -} ecma_standard_error_t; - -ecma_standard_error_t ecma_get_error_type (ecma_object_t *error_object); -ecma_object_t *ecma_new_standard_error (ecma_standard_error_t error_type); -ecma_object_t *ecma_new_standard_error_with_message (ecma_standard_error_t error_type, ecma_string_t *message_string_p); -#if ENABLED (JERRY_ERROR_MESSAGES) -ecma_value_t ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, const char *msg_p, ...); -#endif /* ENABLED (JERRY_ERROR_MESSAGES) */ -ecma_value_t ecma_raise_common_error (const char *msg_p); -ecma_value_t ecma_raise_range_error (const char *msg_p); -ecma_value_t ecma_raise_reference_error (const char *msg_p); -ecma_value_t ecma_raise_syntax_error (const char *msg_p); -ecma_value_t ecma_raise_type_error (const char *msg_p); -ecma_value_t ecma_raise_uri_error (const char *msg_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_EXCEPTIONS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-function-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-function-object.h deleted file mode 100644 index b5be3358f..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-function-object.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_FUNCTION_OBJECT_H -#define ECMA_FUNCTION_OBJECT_H - -#include "ecma-globals.h" -#include "vm.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmafunctionobject ECMA Function object related routines - * @{ - */ - -bool ecma_is_normal_or_arrow_function (ecma_object_type_t type); - -bool ecma_op_is_callable (ecma_value_t value); -bool ecma_is_constructor (ecma_value_t value); - -ecma_object_t * -ecma_op_create_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p); - -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) -ecma_object_t * -ecma_op_create_arrow_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p, - ecma_value_t this_binding); -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ - -ecma_object_t * -ecma_op_create_external_function_object (ecma_external_handler_t handler_cb); - -const ecma_compiled_code_t * -ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p); - -#if ENABLED (JERRY_ES2015_CLASS) -void -ecma_op_set_super_called (ecma_object_t *lex_env_p); - -bool -ecma_op_is_super_called (ecma_object_t *lex_env_p); - -void -ecma_op_set_class_this_binding (ecma_object_t *lex_env_p, ecma_value_t this_binding); - -ecma_value_t -ecma_op_get_class_this_binding (ecma_object_t *lex_env_p); - -ecma_value_t -ecma_op_function_implicit_constructor_handler_cb (const ecma_value_t function_obj, - const ecma_value_t this_val, - const ecma_value_t args_p[], - const ecma_length_t args_count); - -void -ecma_op_set_class_prototype (ecma_value_t completion_value, ecma_value_t this_arg); -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) -const ecma_compiled_code_t * -ecma_op_arrow_function_get_compiled_code (ecma_arrow_function_t *arrow_function_p); -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ - -ecma_value_t -ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value); - -ecma_value_t -ecma_op_function_call (ecma_object_t *func_obj_p, ecma_value_t this_arg_value, - const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); - -ecma_value_t -ecma_op_function_construct (ecma_object_t *func_obj_p, ecma_value_t this_arg_value, - const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); - -ecma_property_t * -ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); - -ecma_property_t * -ecma_op_external_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); - -ecma_property_t * -ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); - -void -ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, - bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); - -void -ecma_op_external_function_list_lazy_property_names (bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); - -void -ecma_op_bound_function_list_lazy_property_names (bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_FUNCTION_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-gc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-gc.h deleted file mode 100644 index 6a4166adb..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-gc.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_GC_H -#define ECMA_GC_H - -#include "ecma-globals.h" -#include "jmem.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmagc Garbage collector - * @{ - */ - -void ecma_init_gc_info (ecma_object_t *object_p); -void ecma_ref_object (ecma_object_t *object_p); -void ecma_deref_object (ecma_object_t *object_p); -void ecma_gc_run (void); -void ecma_free_unused_memory (jmem_pressure_t pressure); - -/** - * @} - * @} - */ - -#endif /* !ECMA_GC_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-helpers.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-helpers.h deleted file mode 100644 index a4fbde471..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-helpers.h +++ /dev/null @@ -1,447 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_HELPERS_H -#define ECMA_HELPERS_H - -#include "ecma-globals.h" -#include "jmem.h" -#include "lit-strings.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmahelpers Helpers for operations with ECMA data types - * @{ - */ - -/** - * Get value of pointer from specified non-null compressed pointer. - */ -#define ECMA_GET_NON_NULL_POINTER(type, field) JMEM_CP_GET_NON_NULL_POINTER (type, field) - -/** - * Get value of pointer from specified compressed pointer. - */ -#define ECMA_GET_POINTER(type, field) JMEM_CP_GET_POINTER (type, field) - -/** - * Set value of non-null compressed pointer so that it will correspond - * to specified non_compressed_pointer. - */ -#define ECMA_SET_NON_NULL_POINTER(field, non_compressed_pointer) JMEM_CP_SET_NON_NULL_POINTER (field, \ - non_compressed_pointer) - -/** - * Set value of compressed pointer so that it will correspond - * to specified non_compressed_pointer. - */ -#define ECMA_SET_POINTER(field, non_compressed_pointer) JMEM_CP_SET_POINTER (field, non_compressed_pointer) - -/** - * Status flags for ecma_string_get_chars function - */ -typedef enum -{ - ECMA_STRING_FLAG_EMPTY = 0, /**< No options are provided. */ - ECMA_STRING_FLAG_IS_ASCII = (1 << 0), /**< The string contains only ASCII characters. */ - ECMA_STRING_FLAG_REHASH_NEEDED = (1 << 1), /**< The hash of the string must be recalculated. - * For more details see ecma_append_chars_to_string */ - ECMA_STRING_FLAG_IS_UINT32 = (1 << 2), /**< The string repesents an UINT32 number */ - ECMA_STRING_FLAG_MUST_BE_FREED = (1 << 3), /**< The returned buffer must be freed */ -} ecma_string_flag_t; - -/** - * Convert ecma-string's contents to a cesu-8 string and put it into a buffer. - */ -#define ECMA_STRING_TO_UTF8_STRING(ecma_str_ptr, /**< ecma string pointer */ \ - utf8_ptr, /**< [out] output buffer pointer */ \ - utf8_str_size) /**< [out] output buffer size */ \ - lit_utf8_size_t utf8_str_size; \ - uint8_t utf8_ptr ## flags = ECMA_STRING_FLAG_EMPTY; \ - const lit_utf8_byte_t *utf8_ptr = ecma_string_get_chars (ecma_str_ptr, \ - &utf8_str_size, \ - NULL, \ - NULL, \ - &utf8_ptr ## flags); - -/** - * Free the cesu-8 string buffer allocated by 'ECMA_STRING_TO_UTF8_STRING' - */ -#define ECMA_FINALIZE_UTF8_STRING(utf8_ptr, /**< pointer to character buffer */ \ - utf8_str_size) /**< buffer size */ \ - if (utf8_ptr ## flags & ECMA_STRING_FLAG_MUST_BE_FREED) \ - { \ - JERRY_ASSERT (utf8_ptr != NULL); \ - jmem_heap_free_block ((void *) utf8_ptr, utf8_str_size); \ - } - -#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY - -/** - * Set an internal property value from pointer. - */ -#define ECMA_SET_INTERNAL_VALUE_POINTER(field, pointer) \ - (field) = ((ecma_value_t) pointer) - -/** - * Set an internal property value from pointer. Pointer can be NULL. - */ -#define ECMA_SET_INTERNAL_VALUE_ANY_POINTER(field, pointer) \ - (field) = ((ecma_value_t) pointer) - -/** - * Convert an internal property value to pointer. - */ -#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \ - ((type *) field) - -/** - * Convert an internal property value to pointer. Result can be NULL. - */ -#define ECMA_GET_INTERNAL_VALUE_ANY_POINTER(type, field) \ - ((type *) field) - -#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ - -/** - * Set an internal property value from pointer. - */ -#define ECMA_SET_INTERNAL_VALUE_POINTER(field, pointer) \ - ECMA_SET_NON_NULL_POINTER (field, pointer) - -/** - * Set an internal property value from pointer. Pointer can be NULL. - */ -#define ECMA_SET_INTERNAL_VALUE_ANY_POINTER(field, pointer) \ - ECMA_SET_POINTER (field, pointer) - -/** - * Convert an internal property value to pointer. - */ -#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \ - ECMA_GET_NON_NULL_POINTER (type, field) - -/** - * Convert an internal property value to pointer. Result can be NULL. - */ -#define ECMA_GET_INTERNAL_VALUE_ANY_POINTER(type, field) \ - ECMA_GET_POINTER (type, field) - -#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */ - -/** - * Convert boolean to bitfield value. - */ -#define ECMA_BOOL_TO_BITFIELD(x) ((x) ? 1 : 0) - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -/** - * JERRY_ASSERT compatible macro for checking whether the given ecma-value is symbol - */ -#define ECMA_ASSERT_VALUE_IS_SYMBOL(value) (ecma_is_value_symbol ((value))) -#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -/** - * JERRY_ASSERT compatible macro for checking whether the given ecma-value is symbol - */ -#define ECMA_ASSERT_VALUE_IS_SYMBOL(value) (false) -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - -/* ecma-helpers-value.c */ -bool JERRY_ATTR_CONST ecma_is_value_direct (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_simple (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_empty (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_undefined (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_null (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_boolean (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_true (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_false (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_found (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_array_hole (ecma_value_t value); - -bool JERRY_ATTR_CONST ecma_is_value_integer_number (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_are_values_integer_numbers (ecma_value_t first_value, ecma_value_t second_value); -bool JERRY_ATTR_CONST ecma_is_value_float_number (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_number (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_string (ecma_value_t value); -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -bool JERRY_ATTR_CONST ecma_is_value_symbol (ecma_value_t value); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -bool JERRY_ATTR_CONST ecma_is_value_prop_name (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_direct_string (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_non_direct_string (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_object (ecma_value_t value); -bool JERRY_ATTR_CONST ecma_is_value_error_reference (ecma_value_t value); - -void ecma_check_value_type_is_spec_defined (ecma_value_t value); - -ecma_value_t JERRY_ATTR_CONST ecma_make_boolean_value (bool boolean_value); -ecma_value_t JERRY_ATTR_CONST ecma_make_integer_value (ecma_integer_value_t integer_value); -ecma_value_t ecma_make_nan_value (void); -ecma_value_t ecma_make_float_value (ecma_number_t *ecma_num_p); -ecma_value_t ecma_make_number_value (ecma_number_t ecma_number); -ecma_value_t ecma_make_int32_value (int32_t int32_number); -ecma_value_t ecma_make_uint32_value (uint32_t uint32_number); -ecma_value_t JERRY_ATTR_PURE ecma_make_string_value (const ecma_string_t *ecma_string_p); -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -ecma_value_t JERRY_ATTR_PURE ecma_make_symbol_value (const ecma_string_t *ecma_symbol_p); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -ecma_value_t JERRY_ATTR_PURE ecma_make_prop_name_value (const ecma_string_t *ecma_prop_name_p); -ecma_value_t JERRY_ATTR_PURE ecma_make_magic_string_value (lit_magic_string_id_t id); -ecma_value_t JERRY_ATTR_PURE ecma_make_object_value (const ecma_object_t *object_p); -ecma_value_t JERRY_ATTR_PURE ecma_make_error_reference_value (const ecma_error_reference_t *error_ref_p); -ecma_integer_value_t JERRY_ATTR_CONST ecma_get_integer_from_value (ecma_value_t value); -ecma_number_t JERRY_ATTR_PURE ecma_get_float_from_value (ecma_value_t value); -ecma_number_t * ecma_get_pointer_from_float_value (ecma_value_t value); -ecma_number_t JERRY_ATTR_PURE ecma_get_number_from_value (ecma_value_t value); -ecma_string_t JERRY_ATTR_PURE *ecma_get_string_from_value (ecma_value_t value); -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -ecma_string_t JERRY_ATTR_PURE *ecma_get_symbol_from_value (ecma_value_t value); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -ecma_string_t JERRY_ATTR_PURE *ecma_get_prop_name_from_value (ecma_value_t value); -ecma_object_t JERRY_ATTR_PURE *ecma_get_object_from_value (ecma_value_t value); -ecma_error_reference_t JERRY_ATTR_PURE *ecma_get_error_reference_from_value (ecma_value_t value); -ecma_value_t JERRY_ATTR_CONST ecma_invert_boolean_value (ecma_value_t value); -ecma_value_t ecma_copy_value (ecma_value_t value); -ecma_value_t ecma_fast_copy_value (ecma_value_t value); -ecma_value_t ecma_copy_value_if_not_object (ecma_value_t value); -ecma_value_t ecma_update_float_number (ecma_value_t float_value, ecma_number_t new_number); -void ecma_value_assign_value (ecma_value_t *value_p, ecma_value_t ecma_value); -void ecma_value_assign_number (ecma_value_t *value_p, ecma_number_t ecma_number); -void ecma_free_value (ecma_value_t value); -void ecma_fast_free_value (ecma_value_t value); -void ecma_free_value_if_not_object (ecma_value_t value); -void ecma_free_number (ecma_value_t value); -lit_magic_string_id_t ecma_get_typeof_lit_id (ecma_value_t value); - -/* ecma-helpers-string.c */ -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -ecma_string_t *ecma_new_symbol_from_descriptor_string (ecma_value_t string_desc); -bool ecma_prop_name_is_symbol (ecma_string_t *string_p); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -#if ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) -ecma_string_t *ecma_new_map_key_string (ecma_value_t value); -bool ecma_prop_name_is_map_key (ecma_string_t *string_p); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) || ENABLED (JERRY_ES2015_BUILTIN_SET) */ -ecma_string_t *ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p, lit_utf8_size_t string_size); -ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p, - lit_utf8_size_t string_size); -ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit); -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) -ecma_string_t *ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, ecma_char_t second_code_unit); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ -ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number); -ecma_string_t *ecma_new_non_direct_string_from_uint32 (uint32_t uint32_number); -ecma_string_t *ecma_get_ecma_string_from_uint32 (uint32_t uint32_number); -ecma_string_t *ecma_new_ecma_string_from_number (ecma_number_t num); -ecma_string_t *ecma_get_magic_string (lit_magic_string_id_t id); -ecma_string_t *ecma_append_chars_to_string (ecma_string_t *string1_p, - const lit_utf8_byte_t *cesu8_string2_p, - lit_utf8_size_t cesu8_string2_size, - lit_utf8_size_t cesu8_string2_length); -ecma_string_t *ecma_concat_ecma_strings (ecma_string_t *string1_p, ecma_string_t *string2_p); -ecma_string_t *ecma_append_magic_string_to_string (ecma_string_t *string1_p, lit_magic_string_id_t string2_id); -void ecma_ref_ecma_string (ecma_string_t *string_p); -void ecma_deref_ecma_string (ecma_string_t *string_p); -void ecma_destroy_ecma_string (ecma_string_t *string_p); -ecma_number_t ecma_string_to_number (const ecma_string_t *str_p); -uint32_t ecma_string_get_array_index (const ecma_string_t *str_p); - -lit_utf8_size_t JERRY_ATTR_WARN_UNUSED_RESULT -ecma_string_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, - lit_utf8_byte_t *buffer_p, - lit_utf8_size_t buffer_size); -lit_utf8_size_t JERRY_ATTR_WARN_UNUSED_RESULT -ecma_string_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, - lit_utf8_byte_t *buffer_p, - lit_utf8_size_t buffer_size); -lit_utf8_size_t -ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, - ecma_length_t start_pos, - ecma_length_t end_pos, - lit_utf8_byte_t *buffer_p, - lit_utf8_size_t buffer_size); -lit_utf8_size_t -ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, - ecma_length_t start_pos, - ecma_length_t end_pos, - lit_utf8_byte_t *buffer_p, - lit_utf8_size_t buffer_size); -void ecma_string_to_utf8_bytes (const ecma_string_t *string_desc_p, lit_utf8_byte_t *buffer_p, - lit_utf8_size_t buffer_size); -const lit_utf8_byte_t *ecma_string_get_chars (const ecma_string_t *string_p, - lit_utf8_size_t *size_p, - lit_utf8_size_t *length_p, - lit_utf8_byte_t *uint32_buff_p, - uint8_t *flags_p); -bool ecma_compare_ecma_string_to_magic_id (const ecma_string_t *string_p, lit_magic_string_id_t id); -bool ecma_string_is_empty (const ecma_string_t *string_p); -bool ecma_string_is_length (const ecma_string_t *string_p); - -jmem_cpointer_t ecma_string_to_property_name (ecma_string_t *prop_name_p, ecma_property_t *name_type_p); -ecma_string_t *ecma_string_from_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp); -lit_string_hash_t ecma_string_get_property_name_hash (ecma_property_t property, jmem_cpointer_t prop_name_cp); -uint32_t ecma_string_get_property_index (ecma_property_t property, jmem_cpointer_t prop_name_cp); -bool ecma_string_compare_to_property_name (ecma_property_t property, jmem_cpointer_t prop_name_cp, - const ecma_string_t *string_p); - -bool ecma_compare_ecma_strings (const ecma_string_t *string1_p, const ecma_string_t *string2_p); -bool ecma_compare_ecma_non_direct_strings (const ecma_string_t *string1_p, const ecma_string_t *string2_p); -bool ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, const ecma_string_t *string2_p); -ecma_length_t ecma_string_get_length (const ecma_string_t *string_p); -ecma_length_t ecma_string_get_utf8_length (const ecma_string_t *string_p); -lit_utf8_size_t ecma_string_get_size (const ecma_string_t *string_p); -lit_utf8_size_t ecma_string_get_utf8_size (const ecma_string_t *string_p); -ecma_char_t ecma_string_get_char_at_pos (const ecma_string_t *string_p, ecma_length_t index); - -lit_magic_string_id_t ecma_get_string_magic (const ecma_string_t *string_p); - -lit_string_hash_t ecma_string_hash (const ecma_string_t *string_p); -ecma_string_t *ecma_string_substr (const ecma_string_t *string_p, ecma_length_t start_pos, ecma_length_t end_pos); -void ecma_string_trim_helper (const lit_utf8_byte_t **utf8_str_p, - lit_utf8_size_t *utf8_str_size); -ecma_string_t *ecma_string_trim (const ecma_string_t *string_p); - -ecma_stringbuilder_t ecma_stringbuilder_create (void); -ecma_stringbuilder_t ecma_stringbuilder_create_from (ecma_string_t *string_p); -lit_utf8_size_t ecma_stringbuilder_get_size (ecma_stringbuilder_t *builder_p); -lit_utf8_byte_t *ecma_stringbuilder_get_data (ecma_stringbuilder_t *builder_p); -void ecma_stringbuilder_revert (ecma_stringbuilder_t *builder_p, const lit_utf8_size_t size); -void ecma_stringbuilder_append (ecma_stringbuilder_t *builder_p, const ecma_string_t *string_p); -void ecma_stringbuilder_append_magic (ecma_stringbuilder_t *builder_p, const lit_magic_string_id_t id); -void ecma_stringbuilder_append_raw (ecma_stringbuilder_t *builder_p, - const lit_utf8_byte_t *data_p, - const lit_utf8_size_t data_size); -void ecma_stringbuilder_append_char (ecma_stringbuilder_t *builder_p, const ecma_char_t c); -void ecma_stringbuilder_append_byte (ecma_stringbuilder_t *builder_p, const lit_utf8_byte_t); -ecma_string_t *ecma_stringbuilder_finalize (ecma_stringbuilder_t *builder_p); -void ecma_stringbuilder_destroy (ecma_stringbuilder_t *builder_p); - -/* ecma-helpers-number.c */ -ecma_number_t ecma_number_make_nan (void); -ecma_number_t ecma_number_make_infinity (bool sign); -bool ecma_number_is_nan (ecma_number_t num); -bool ecma_number_is_negative (ecma_number_t num); -bool ecma_number_is_zero (ecma_number_t num); -bool ecma_number_is_infinity (ecma_number_t num); -ecma_number_t -ecma_number_make_from_sign_mantissa_and_exponent (bool sign, uint64_t mantissa, int32_t exponent); -ecma_number_t ecma_number_get_prev (ecma_number_t num); -ecma_number_t ecma_number_get_next (ecma_number_t num); -ecma_number_t ecma_number_trunc (ecma_number_t num); -ecma_number_t ecma_number_calc_remainder (ecma_number_t left_num, ecma_number_t right_num); -ecma_value_t ecma_integer_multiply (ecma_integer_value_t left_integer, ecma_integer_value_t right_integer); -lit_utf8_size_t ecma_number_to_decimal (ecma_number_t num, lit_utf8_byte_t *out_digits_p, int32_t *out_decimal_exp_p); -lit_utf8_size_t ecma_number_to_binary_floating_point_number (ecma_number_t num, - lit_utf8_byte_t *out_digits_p, - int32_t *out_decimal_exp_p); - -/* ecma-helpers-collection.c */ -ecma_collection_t *ecma_new_collection (void); -void ecma_collection_push_back (ecma_collection_t *collection_p, ecma_value_t value); -void ecma_collection_destroy (ecma_collection_t *collection_p); -void ecma_collection_free (ecma_collection_t *collection_p); -void ecma_collection_free_if_not_object (ecma_collection_t *collection_p); -void ecma_collection_free_objects (ecma_collection_t *collection_p); - -/* ecma-helpers.c */ -ecma_object_t *ecma_create_object (ecma_object_t *prototype_object_p, size_t ext_object_size, ecma_object_type_t type); -ecma_object_t *ecma_create_decl_lex_env (ecma_object_t *outer_lexical_environment_p); -ecma_object_t *ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, ecma_object_t *binding_obj_p, - ecma_lexical_environment_type_t type); -bool JERRY_ATTR_PURE ecma_is_lexical_environment (const ecma_object_t *object_p); -bool JERRY_ATTR_PURE ecma_get_object_extensible (const ecma_object_t *object_p); -void ecma_set_object_extensible (ecma_object_t *object_p, bool is_extensible); -ecma_object_type_t JERRY_ATTR_PURE ecma_get_object_type (const ecma_object_t *object_p); -bool JERRY_ATTR_PURE ecma_get_object_is_builtin (const ecma_object_t *object_p); -void ecma_set_object_is_builtin (ecma_object_t *object_p); -uint8_t ecma_get_object_builtin_id (ecma_object_t *object_p); -ecma_lexical_environment_type_t JERRY_ATTR_PURE ecma_get_lex_env_type (const ecma_object_t *object_p); -ecma_object_t JERRY_ATTR_PURE *ecma_get_lex_env_outer_reference (const ecma_object_t *object_p); -ecma_object_t JERRY_ATTR_PURE *ecma_get_lex_env_binding_object (const ecma_object_t *object_p); - -ecma_property_value_t * -ecma_create_named_data_property (ecma_object_t *object_p, ecma_string_t *name_p, uint8_t prop_attributes, - ecma_property_t **out_prop_p); -ecma_property_value_t * -ecma_create_named_accessor_property (ecma_object_t *object_p, ecma_string_t *name_p, ecma_object_t *get_p, - ecma_object_t *set_p, uint8_t prop_attributes, ecma_property_t **out_prop_p); -ecma_property_t * -ecma_find_named_property (ecma_object_t *obj_p, ecma_string_t *name_p); -ecma_property_value_t * -ecma_get_named_data_property (ecma_object_t *obj_p, ecma_string_t *name_p); - -void ecma_free_property (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *property_p); - -void ecma_delete_property (ecma_object_t *object_p, ecma_property_value_t *prop_value_p); - -void ecma_named_data_property_assign_value (ecma_object_t *obj_p, ecma_property_value_t *prop_value_p, - ecma_value_t value); - -ecma_getter_setter_pointers_t * -ecma_get_named_accessor_property (const ecma_property_value_t *prop_value_p); -void ecma_set_named_accessor_property_getter (ecma_object_t *object_p, ecma_property_value_t *prop_value_p, - ecma_object_t *getter_p); -void ecma_set_named_accessor_property_setter (ecma_object_t *object_p, ecma_property_value_t *prop_value_p, - ecma_object_t *setter_p); -bool ecma_is_property_writable (ecma_property_t property); -void ecma_set_property_writable_attr (ecma_property_t *property_p, bool is_writable); -bool ecma_is_property_enumerable (ecma_property_t property); -void ecma_set_property_enumerable_attr (ecma_property_t *property_p, bool is_enumerable); -bool ecma_is_property_configurable (ecma_property_t property); -void ecma_set_property_configurable_attr (ecma_property_t *property_p, bool is_configurable); - -#if ENABLED (JERRY_LCACHE) -bool ecma_is_property_lcached (ecma_property_t *property_p); -void ecma_set_property_lcached (ecma_property_t *property_p, bool is_lcached); -#endif /* ENABLED (JERRY_LCACHE) */ - -ecma_property_descriptor_t ecma_make_empty_property_descriptor (void); -void ecma_free_property_descriptor (ecma_property_descriptor_t *prop_desc_p); - -ecma_value_t ecma_create_error_reference (ecma_value_t value, bool is_exception); -ecma_value_t ecma_create_error_reference_from_context (void); -ecma_value_t ecma_create_error_object_reference (ecma_object_t *object_p); -void ecma_ref_error_reference (ecma_error_reference_t *error_ref_p); -void ecma_deref_error_reference (ecma_error_reference_t *error_ref_p); -ecma_value_t ecma_clear_error_reference (ecma_value_t value, bool set_abort_flag); - -void ecma_bytecode_ref (ecma_compiled_code_t *bytecode_p); -void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p); -#if (JERRY_STACK_LIMIT != 0) -uintptr_t ecma_get_current_stack_usage (void); -#endif /* (JERRY_STACK_LIMIT != 0) */ - -/* ecma-helpers-external-pointers.c */ -bool ecma_create_native_pointer_property (ecma_object_t *obj_p, void *native_p, void *info_p); -ecma_native_pointer_t *ecma_get_native_pointer_value (ecma_object_t *obj_p, void *info_p); -bool ecma_delete_native_pointer_property (ecma_object_t *obj_p, void *info_p); - -/* ecma-helpers-conversion.c */ -ecma_number_t ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, lit_utf8_size_t str_size); -lit_utf8_size_t ecma_uint32_to_utf8_string (uint32_t value, lit_utf8_byte_t *out_buffer_p, lit_utf8_size_t buffer_size); -uint32_t ecma_number_to_uint32 (ecma_number_t num); -int32_t ecma_number_to_int32 (ecma_number_t num); -lit_utf8_size_t ecma_number_to_utf8_string (ecma_number_t num, lit_utf8_byte_t *buffer_p, lit_utf8_size_t buffer_size); - -/* ecma-helpers-errol.c */ -lit_utf8_size_t ecma_errol0_dtoa (double val, lit_utf8_byte_t *buffer_p, int32_t *exp_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_HELPERS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-init-finalize.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-init-finalize.h deleted file mode 100644 index 0e4fda213..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-init-finalize.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_INIT_FINALIZE_H -#define ECMA_INIT_FINALIZE_H - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmainitfinalize Initialization and finalization of ECMA components - * @{ - */ - -void ecma_init (void); -void ecma_finalize (void); - -/** - * @} - * @} - */ - -#endif /* !ECMA_INIT_FINALIZE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-iterator-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-iterator-object.h deleted file mode 100644 index d4b81e614..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-iterator-object.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_ITERATOR_OBJECT_H -#define ECMA_ITERATOR_OBJECT_H - -#include "ecma-globals.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaiteratorobject ECMA iterator object related routines - * @{ - */ - -/** - * Maximum value of [[%Iterator%NextIndex]] until it can be stored - * in an ecma pseudo array object structure element. - */ -#define ECMA_ITERATOR_INDEX_LIMIT UINT16_MAX - -ecma_value_t -ecma_op_create_iterator_object (ecma_value_t iterated_value, ecma_object_t *prototype_obj_p, - uint8_t iterator_type, uint8_t extra_info); - -ecma_value_t -ecma_create_iter_result_object (ecma_value_t value, ecma_value_t done); - -ecma_value_t -ecma_create_array_from_iter_element (ecma_value_t value, ecma_value_t index_value); - -ecma_value_t -ecma_op_get_iterator (ecma_value_t value, ecma_value_t method); - -ecma_value_t -ecma_op_iterator_value (ecma_value_t iter_result); - -ecma_value_t -ecma_op_iterator_step (ecma_value_t iterator); - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ - -/** - * @} - * @} - */ - -#endif /* !ECMA_ITERATOR_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-jobqueue.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-jobqueue.h deleted file mode 100644 index 260776823..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-jobqueue.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_JOB_QUEUE_H -#define ECMA_JOB_QUEUE_H - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmajobqueue ECMA Job Queue related routines - * @{ - */ - -/** - * Jerry job handler function type - */ -typedef ecma_value_t (*ecma_job_handler_t) (void *job_p); - -/** - * Description of the job queue item. - */ -typedef struct ecma_job_queueitem_t -{ - struct ecma_job_queueitem_t *next_p; /**< points to next item */ - ecma_job_handler_t handler; /**< the handler for the job*/ - void *job_p; /**< points to the job */ -} ecma_job_queueitem_t; - -void ecma_job_queue_init (void); - -void ecma_enqueue_promise_reaction_job (ecma_value_t reaction, ecma_value_t argument); -void ecma_enqueue_promise_resolve_thenable_job (ecma_value_t promise, ecma_value_t thenable, ecma_value_t then); -void ecma_free_all_enqueued_jobs (void); - -ecma_value_t ecma_process_all_enqueued_jobs (void); - -/** - * @} - * @} - */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ -#endif /* !ECMA_JOB_QUEUE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lcache.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lcache.h deleted file mode 100644 index e4add397b..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lcache.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_LCACHE_H -#define ECMA_LCACHE_H - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmalcache Property lookup cache - * @{ - */ - -#if ENABLED (JERRY_LCACHE) -void ecma_lcache_insert (const ecma_object_t *object_p, const jmem_cpointer_t name_cp, ecma_property_t *prop_p); -ecma_property_t *ecma_lcache_lookup (const ecma_object_t *object_p, const ecma_string_t *prop_name_p); -void ecma_lcache_invalidate (const ecma_object_t *object_p, const jmem_cpointer_t name_cp, ecma_property_t *prop_p); - -#endif /* ENABLED (JERRY_LCACHE) */ - -/** - * @} - * @} - */ - -#endif /* !ECMA_LCACHE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lex-env.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lex-env.h deleted file mode 100644 index 7ff5c98b9..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-lex-env.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_LEX_ENV_H -#define ECMA_LEX_ENV_H - -#include "ecma-globals.h" -#include "ecma-reference.h" -#include "jrt.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup lexicalenvironment Lexical environment - * @{ - * - * \addtogroup globallexicalenvironment Global lexical environment - * @{ - */ - -void ecma_init_global_lex_env (void); -void ecma_finalize_global_lex_env (void); -ecma_object_t *ecma_get_global_environment (void); - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) -void ecma_module_add_lex_env (ecma_object_t *lex_env_p); -void ecma_module_finalize_lex_envs (void); -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - -/** - * @} - */ - -/* ECMA-262 v5, 8.7.1 and 8.7.2 */ -ecma_value_t ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, ecma_object_t **ref_base_lex_env_p, - ecma_string_t *name_p); -ecma_value_t ecma_op_get_value_object_base (ecma_value_t base_value, ecma_string_t *property_name_p); -ecma_value_t ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, ecma_string_t *var_name_string_p, - bool is_strict, ecma_value_t value); - -/* ECMA-262 v5, Table 17. Abstract methods of Environment Records */ -bool ecma_op_has_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p); -ecma_value_t ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_deletable); -ecma_value_t ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value, - bool is_strict); -ecma_value_t ecma_op_get_binding_value (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_strict); -ecma_value_t ecma_op_delete_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p); -ecma_value_t ecma_op_implicit_this_value (ecma_object_t *lex_env_p); - -/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */ -void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value); - -/** - * @} - * @} - */ - -#endif /* !ECMA_LEX_ENV_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-literal-storage.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-literal-storage.h deleted file mode 100644 index debbcc50a..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-literal-storage.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_LIT_STORAGE_H -#define ECMA_LIT_STORAGE_H - -#include "ecma-globals.h" -#include "jmem.h" -#include "lit-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmalitstorage Literal storage - * @{ - */ - -#if ENABLED (JERRY_SNAPSHOT_SAVE) -/** - * Snapshot literal - offset map - */ -typedef struct -{ - ecma_value_t literal_id; /**< literal id */ - ecma_value_t literal_offset; /**< literal offset */ -} lit_mem_to_snapshot_id_map_entry_t; -#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */ - -void ecma_finalize_lit_storage (void); - -ecma_value_t ecma_find_or_create_literal_string (const lit_utf8_byte_t *chars_p, lit_utf8_size_t size); -ecma_value_t ecma_find_or_create_literal_number (ecma_number_t number_arg); - -#if ENABLED (JERRY_SNAPSHOT_SAVE) -void ecma_save_literals_append_value (ecma_value_t value, ecma_collection_t *lit_pool_p); -void ecma_save_literals_add_compiled_code (const ecma_compiled_code_t *compiled_code_p, - ecma_collection_t *lit_pool_p); -bool ecma_save_literals_for_snapshot (ecma_collection_t *lit_pool_p, uint32_t *buffer_p, size_t buffer_size, - size_t *in_out_buffer_offset_p, lit_mem_to_snapshot_id_map_entry_t **out_map_p, - uint32_t *out_map_len_p); -#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */ - -#if ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE) -ecma_value_t -ecma_snapshot_get_literal (const uint8_t *literal_base_p, ecma_value_t literal_value); -#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE) */ - -/** - * @} - * @} - */ - -#endif /* !ECMA_LIT_STORAGE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-module.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-module.h deleted file mode 100644 index 290b4d5c3..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-module.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_MODULE_H -#define ECMA_MODULE_H - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) - -#include "common.h" -#include "ecma-globals.h" - -#define ECMA_MODULE_MAX_PATH 255u - -/** - * Imported or exported names, such as "a as b" - * Note: See https://www.ecma-international.org/ecma-262/6.0/#table-39 - * and https://www.ecma-international.org/ecma-262/6.0/#table-41 - */ -typedef struct ecma_module_names -{ - struct ecma_module_names *next_p; /**< next linked list node */ - ecma_string_t *imex_name_p; /**< Import/export name of the item */ - ecma_string_t *local_name_p; /**< Local name of the item */ -} ecma_module_names_t; - -typedef struct ecma_module ecma_module_t; - -/** - * Module node to store imports / exports. - */ -typedef struct ecma_module_node -{ - struct ecma_module_node *next_p; /**< next linked list node */ - ecma_module_names_t *module_names_p; /**< names of the requested import/export node */ - ecma_module_t *module_request_p; /**< module structure of the requested module */ -} ecma_module_node_t; - -/** - * Module context containing all import and export nodes. - */ -typedef struct ecma_module_context -{ - struct ecma_module_context *parent_p; /**< parent context */ - ecma_module_node_t *imports_p; /**< import item of the current context */ - ecma_module_node_t *local_exports_p; /**< export item of the current context */ - ecma_module_node_t *indirect_exports_p; /**< export item of the current context */ - ecma_module_node_t *star_exports_p; /**< export item of the current context */ - ecma_module_t *module_p; /**< module request */ -} ecma_module_context_t; - -/** - * An enum identifing the current state of the module - */ -typedef enum -{ - ECMA_MODULE_STATE_INIT = 0, /**< module is initialized */ - ECMA_MODULE_STATE_PARSING = 1, /**< module is currently being parsed */ - ECMA_MODULE_STATE_PARSED = 2, /**< module has been parsed */ - ECMA_MODULE_STATE_EVALUATING = 3, /**< module is currently being evaluated */ - ECMA_MODULE_STATE_EVALUATED = 4, /**< module has been evaluated */ - ECMA_MODULE_STATE_NATIVE = 5, /**< module is native */ -} ecma_module_state_t; - -/** - * Module structure storing an instance of a module - */ -struct ecma_module -{ - struct ecma_module *next_p; /**< next linked list node */ - ecma_module_state_t state; /**< state of the mode */ - ecma_string_t *path_p; /**< path of the module */ - ecma_module_context_t *context_p; /**< module context of the module */ - ecma_compiled_code_t *compiled_code_p; /**< compiled code of the module */ - ecma_object_t *scope_p; /**< lexica lenvironment of the module */ - ecma_object_t *namespace_object_p; /**< namespace import object of the module */ -}; - -/** - * A record that can be used to store {module, identifier} pairs - */ -typedef struct ecma_module_record -{ - ecma_module_t *module_p; /**< module */ - ecma_string_t *name_p; /**< identifier name */ -} ecma_module_record_t; - -/** - * A list of module records that can be used to identify circular imports during resolution - */ -typedef struct ecma_module_resolve_set -{ - struct ecma_module_resolve_set *next_p; /**< next in linked list */ - ecma_module_record_t record; /**< module record */ -} ecma_module_resolve_set_t; - -/** - * A list that is used like a stack to drive the resolution process, instead of recursion. - */ -typedef struct ecma_module_resolve_stack -{ - struct ecma_module_resolve_stack *next_p; /**< next in linked list */ - ecma_module_t *module_p; /**< module request */ - ecma_string_t *export_name_p; /**< export identifier name */ - bool resolving; /**< flag storing wether the current frame started resolving */ -} ecma_module_resolve_stack_t; - -bool ecma_module_resolve_set_insert (ecma_module_resolve_set_t **set_p, - ecma_module_t *const module_p, - ecma_string_t *const export_name_p); -void ecma_module_resolve_set_cleanup (ecma_module_resolve_set_t *set_p); - -void ecma_module_resolve_stack_push (ecma_module_resolve_stack_t **stack_p, - ecma_module_t *const module_p, - ecma_string_t *const export_name_p); -void ecma_module_resolve_stack_pop (ecma_module_resolve_stack_t **stack_p); - -ecma_string_t *ecma_module_create_normalized_path (const uint8_t *char_p, - prop_length_t size); -ecma_module_t *ecma_module_find_module (ecma_string_t *const path_p); -ecma_module_t *ecma_module_create_native_module (ecma_string_t *const path_p, - ecma_object_t *const namespace_p); -ecma_module_t *ecma_module_find_or_create_module (ecma_string_t *const path_p); - -ecma_value_t ecma_module_connect_imports (void); -ecma_value_t ecma_module_parse_modules (void); -ecma_value_t ecma_module_check_indirect_exports (void); - -void ecma_module_release_module_nodes (ecma_module_node_t *module_node_p); -void ecma_module_cleanup (void); -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - -#endif /* !ECMA_MODULE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-arithmetic.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-arithmetic.h deleted file mode 100644 index 2d9d00ac2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-arithmetic.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_NUMBER_ARITHMETIC_H -#define ECMA_NUMBER_ARITHMETIC_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup numberarithmetic ECMA number arithmetic operations - * @{ - */ - -ecma_number_t ecma_op_number_remainder (ecma_number_t left_num, ecma_number_t right_num); - -/** - * @} - * @} - */ - -#endif /* !ECMA_NUMBER_ARITHMETIC_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-object.h deleted file mode 100644 index c4baf75f1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-number-object.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_NUMBER_OBJECT_H -#define ECMA_NUMBER_OBJECT_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmanumberobject ECMA Number object related routines - * @{ - */ - -ecma_value_t ecma_op_create_number_object (ecma_value_t arg); - -/** - * @} - * @} - */ - -#endif /* !ECMA_NUMBER_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-arguments.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-arguments.h deleted file mode 100644 index 8f7a0dc17..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-arguments.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_OBJECTS_ARGUMENTS_H -#define ECMA_OBJECTS_ARGUMENTS_H - -#include "ecma-globals.h" -#include "ecma-helpers.h" - -void -ecma_op_create_arguments_object (ecma_object_t *func_obj_p, ecma_object_t *lex_env_p, - const ecma_value_t *arguments_list_p, ecma_length_t arguments_number, - const ecma_compiled_code_t *bytecode_data_p); - -ecma_value_t -ecma_op_arguments_object_delete (ecma_object_t *object_p, ecma_string_t *property_name_p, bool is_throw); -ecma_value_t -ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p, - const ecma_property_descriptor_t *property_desc_p); - -#endif /* !ECMA_OBJECTS_ARGUMENTS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-general.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-general.h deleted file mode 100644 index 74c1f3a4e..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects-general.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_OBJECTS_GENERAL_H -#define ECMA_OBJECTS_GENERAL_H - -#include "ecma-conversion.h" -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaobjectsinternalops ECMA objects' operations - * @{ - */ - -ecma_value_t ecma_reject (bool is_throw); -ecma_object_t *ecma_op_create_object_object_noarg (void); -ecma_value_t ecma_op_create_object_object_arg (ecma_value_t value); -ecma_object_t *ecma_op_create_object_object_noarg_and_set_prototype (ecma_object_t *object_prototype_p); - -ecma_value_t ecma_op_general_object_delete (ecma_object_t *obj_p, ecma_string_t *property_name_p, bool is_throw); -ecma_value_t ecma_op_general_object_default_value (ecma_object_t *obj_p, ecma_preferred_type_hint_t hint); -ecma_value_t ecma_op_general_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p, - const ecma_property_descriptor_t *property_desc_p); - -/** - * @} - * @} - */ - -#endif /* !ECMA_OBJECTS_GENERAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects.h deleted file mode 100644 index c416ed2bd..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-objects.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_OBJECTS_H -#define ECMA_OBJECTS_H - -#include "ecma-conversion.h" -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaobjectsinternalops ECMA objects' operations - * @{ - */ - -ecma_property_t ecma_op_object_get_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p, - ecma_property_ref_t *property_ref_p, uint32_t options); -bool ecma_op_object_has_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -bool ecma_op_object_has_property (ecma_object_t *object_p, ecma_string_t *property_name_p); -ecma_value_t ecma_op_object_find_own (ecma_value_t base_value, ecma_object_t *object_p, ecma_string_t *property_name_p); -ecma_value_t ecma_op_object_find (ecma_object_t *object_p, ecma_string_t *property_name_p); -ecma_value_t ecma_op_object_find_by_uint32_index (ecma_object_t *object_p, uint32_t index); -ecma_value_t ecma_op_object_find_by_number_index (ecma_object_t *object_p, ecma_number_t index); -ecma_value_t ecma_op_object_get_own_data_prop (ecma_object_t *object_p, ecma_string_t *property_name_p); -ecma_value_t ecma_op_object_get (ecma_object_t *object_p, ecma_string_t *property_name_p); -ecma_value_t ecma_op_object_get_by_magic_id (ecma_object_t *object_p, lit_magic_string_id_t property_id); -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -ecma_value_t ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, lit_magic_string_id_t property_id); -ecma_value_t ecma_op_get_method_by_symbol_id (ecma_value_t value, lit_magic_string_id_t property_id); -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -ecma_value_t ecma_op_object_put (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value, - bool is_throw); -ecma_value_t ecma_op_object_put_by_uint32_index (ecma_object_t *object_p, uint32_t index, - ecma_value_t value, bool is_throw); -ecma_value_t ecma_op_object_put_by_number_index (ecma_object_t *object_p, ecma_number_t index, - ecma_value_t value, bool is_throw); -ecma_value_t ecma_op_object_delete (ecma_object_t *obj_p, ecma_string_t *property_name_p, bool is_throw); -ecma_value_t ecma_op_object_delete_by_uint32_index (ecma_object_t *obj_p, uint32_t index, bool is_throw); -ecma_value_t ecma_op_object_delete_by_number_index (ecma_object_t *obj_p, ecma_number_t index, bool is_throw); -ecma_value_t ecma_op_object_default_value (ecma_object_t *obj_p, ecma_preferred_type_hint_t hint); -ecma_value_t ecma_op_object_define_own_property (ecma_object_t *obj_p, ecma_string_t *property_name_p, - const ecma_property_descriptor_t *property_desc_p); -bool ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, ecma_string_t *property_name_p, - ecma_property_descriptor_t *prop_desc_p); -ecma_value_t ecma_op_object_has_instance (ecma_object_t *obj_p, ecma_value_t value); -bool ecma_op_object_is_prototype_of (ecma_object_t *base_p, ecma_object_t *target_p); -ecma_collection_t * ecma_op_object_get_property_names (ecma_object_t *obj_p, uint32_t opts); - -lit_magic_string_id_t ecma_object_get_class_name (ecma_object_t *obj_p); -bool ecma_object_class_is (ecma_object_t *object_p, uint32_t class_id); - -/** - * @} - * @} - */ - -#endif /* !ECMA_OBJECTS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-promise-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-promise-object.h deleted file mode 100644 index 2e71b6225..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-promise-object.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_PROMISE_OBJECT_H -#define ECMA_PROMISE_OBJECT_H - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaarraybufferobject ECMA ArrayBuffer object related routines - * @{ - */ - -/** - * The PromiseState of promise object. - */ -typedef enum -{ - ECMA_PROMISE_STATE_PENDING, /**< pending state */ - ECMA_PROMISE_STATE_FULFILLED, /**< fulfilled state */ - ECMA_PROMISE_STATE_REJECTED, /** rejected state */ - ECMA_PROMISE_STATE__COUNT /**< number of states */ -} ecma_promise_state_t; - -/** - * Indicates the type of the executor in promise construct. - */ -typedef enum -{ - ECMA_PROMISE_EXECUTOR_FUNCTION, /**< the executor is a function, it is for the usual constructor */ - ECMA_PROMISE_EXECUTOR_OBJECT, /**< the executor is an object, it is for the `then` routine */ - ECMA_PROMISE_EXECUTOR_EMPTY /**< the executor is empty, it is for external C API */ -} ecma_promise_executor_type_t; - -/** - * Description of the promise resolving functions. - */ -typedef struct -{ - ecma_value_t resolve; /**< the resolve function */ - ecma_value_t reject; /**< the reject function */ -} ecma_promise_resolving_functions_t; - -/** - * Description of the promise object. - * It need more space than normal object to store builtin properties. - */ -typedef struct -{ - ecma_extended_object_t ecma_extended_object_t; /**< extended object part */ - uint8_t state; /**< promise state, see ecma_promise_state_t */ - ecma_collection_t *fulfill_reactions; /**< list of PromiseFullfillReactions */ - ecma_collection_t *reject_reactions; /**< list of PromiseRejectReactions */ -} ecma_promise_object_t; - -bool ecma_is_promise (ecma_object_t *obj_p); -ecma_value_t -ecma_op_create_promise_object (ecma_value_t executor, ecma_promise_executor_type_t type); -ecma_value_t ecma_promise_new_capability (void); -ecma_value_t -ecma_promise_then (ecma_value_t promise, - ecma_value_t on_fulfilled, - ecma_value_t on_rejected); -ecma_promise_resolving_functions_t * -ecma_promise_create_resolving_functions (ecma_object_t *object_p); -void ecma_promise_free_resolving_functions (ecma_promise_resolving_functions_t *funcs); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ -#endif /* !ECMA_PROMISE_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-property-hashmap.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-property-hashmap.h deleted file mode 100644 index 13b417468..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-property-hashmap.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_PROPERTY_HASHMAP_H -#define ECMA_PROPERTY_HASHMAP_H - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmapropertyhashmap Property hashmap - * @{ - */ - -/** - * Recommended minimum number of items in a property cache. - */ -#define ECMA_PROPERTY_HASMAP_MINIMUM_SIZE 32 - -/** - * Property hash. - */ -typedef struct -{ - ecma_property_header_t header; /**< header of the property */ - uint32_t max_property_count; /**< maximum property count (power of 2) */ - uint32_t null_count; /**< number of NULLs in the map */ - uint32_t unused_count; /**< number of unused entires in the map */ - - /* - * The hash is followed by max_property_count ecma_cpointer_t - * compressed pointers and (max_property_count + 7) / 8 bytes - * which stores a flag for each compressed pointer. - * - * If the compressed pointer is equal to ECMA_NULL_POINTER - * - flag is cleared if the entry is NULL - * - flag is set if the entry is deleted - * - * If the compressed pointer is not equal to ECMA_NULL_POINTER - * - flag is cleared if the first entry of a property pair is referenced - * - flag is set if the second entry of a property pair is referenced - */ -} ecma_property_hashmap_t; - -#if ENABLED (JERRY_PROPRETY_HASHMAP) - -/** - * Simple ecma values - */ -typedef enum -{ - ECMA_PROPERTY_HASHMAP_DELETE_NO_HASHMAP, /**< object has no hashmap */ - ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP, /**< object has hashmap */ - ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP, /**< hashmap should be recreated */ -} ecma_property_hashmap_delete_status; - -void ecma_property_hashmap_create (ecma_object_t *object_p); -void ecma_property_hashmap_free (ecma_object_t *object_p); -void ecma_property_hashmap_insert (ecma_object_t *object_p, ecma_string_t *name_p, - ecma_property_pair_t *property_pair_p, int property_index); -ecma_property_hashmap_delete_status ecma_property_hashmap_delete (ecma_object_t *object_p, jmem_cpointer_t name_cp, - ecma_property_t *property_p); - - -ecma_property_t *ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, ecma_string_t *name_p, - jmem_cpointer_t *property_real_name_cp); -#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */ - -/** - * @} - * @} - */ - -#endif /* !ECMA_PROPERTY_HASHMAP_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-reference.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-reference.h deleted file mode 100644 index 37409edb5..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-reference.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_REFERENCE_H -#define ECMA_REFERENCE_H - -#include "ecma-globals.h" -#include "jrt.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup references ECMA-Reference - * @{ - */ - -ecma_object_t *ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, ecma_string_t *name_p); -ecma_value_t ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p); -#if ENABLED (JERRY_ES2015_CLASS) -ecma_object_t *ecma_op_resolve_super_reference_value (ecma_object_t *lex_env_p); -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -/** - * @} - * @} - */ - -#endif /* !ECMA_REFERENCE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-regexp-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-regexp-object.h deleted file mode 100644 index 1b1c6e547..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-regexp-object.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_REGEXP_OBJECT_H -#define ECMA_REGEXP_OBJECT_H - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -#include "ecma-globals.h" -#include "re-compiler.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmaregexpobject ECMA RegExp object related routines - * @{ - */ - -/** - * RegExp flags - * Note: - * This enum has to be kept in sync with jerry_regexp_flags_t. - */ -typedef enum -{ - RE_FLAG_EMPTY = 0u, /* Empty RegExp flags */ - RE_FLAG_GLOBAL = (1u << 1), /**< ECMA-262 v5, 15.10.7.2 */ - RE_FLAG_IGNORE_CASE = (1u << 2), /**< ECMA-262 v5, 15.10.7.3 */ - RE_FLAG_MULTILINE = (1u << 3) /**< ECMA-262 v5, 15.10.7.4 */ -} ecma_regexp_flags_t; - -/** - * Structure for storing capturing group results - */ -typedef struct -{ - const lit_utf8_byte_t *begin_p; /**< substring start pointer */ - const lit_utf8_byte_t *end_p; /**< substring end pointer */ -} ecma_regexp_capture_t; - -/** - * Structure for storing non-capturing group results - */ -typedef struct -{ - const lit_utf8_byte_t *str_p; /**< string pointer */ -} ecma_regexp_non_capture_t; - -#if (JERRY_STACK_LIMIT != 0) -/** - * Value used ase result when stack limit is reached - */ -#define ECMA_RE_OUT_OF_STACK ((const lit_utf8_byte_t *) UINTPTR_MAX) - -/** - * Checks if the stack limit has been reached during regexp matching - */ -#define ECMA_RE_STACK_LIMIT_REACHED(p) (JERRY_UNLIKELY (p == ECMA_RE_OUT_OF_STACK)) -#else /* JERRY_STACK_LIMIT == 0 */ -#define ECMA_RE_STACK_LIMIT_REACHED(p) (false) -#endif /* JERRY_STACK_LIMIT != 0 */ - -/** - * RegExp executor context - */ -typedef struct -{ - const lit_utf8_byte_t *input_end_p; /**< end of input string */ - const lit_utf8_byte_t *input_start_p; /**< start of input string */ - uint32_t captures_count; /**< number of capture groups */ - ecma_regexp_capture_t *captures_p; /**< capturing groups */ - uint32_t non_captures_count; /**< number of non-capture groups */ - ecma_regexp_non_capture_t *non_captures_p; /**< non-capturing groups */ - uint32_t *iterations_p; /**< number of iterations */ - uint16_t flags; /**< RegExp flags */ -} ecma_regexp_ctx_t; - -ecma_value_t ecma_op_create_regexp_object_from_bytecode (re_compiled_code_t *bytecode_p); -ecma_value_t ecma_op_create_regexp_object (ecma_string_t *pattern_p, uint16_t flags); -ecma_value_t ecma_regexp_exec_helper (ecma_value_t regexp_value, ecma_value_t input_string, bool ignore_global); -ecma_value_t ecma_regexp_read_pattern_str_helper (ecma_value_t pattern_arg, ecma_string_t **pattern_string_p); -ecma_char_t ecma_regexp_canonicalize (ecma_char_t ch, bool is_ignorecase); -ecma_char_t ecma_regexp_canonicalize_char (ecma_char_t ch); -ecma_value_t ecma_regexp_parse_flags (ecma_string_t *flags_str_p, uint16_t *flags_p); -void ecma_regexp_initialize_props (ecma_object_t *re_obj_p, ecma_string_t *source_p, uint16_t flags); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ -#endif /* !ECMA_REGEXP_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-string-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-string-object.h deleted file mode 100644 index b1c4b7ad9..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-string-object.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_STRING_OBJECT_H -#define ECMA_STRING_OBJECT_H - -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmastringobject ECMA String object related routines - * @{ - */ - -ecma_value_t -ecma_op_create_string_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); - -void -ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p, - bool separate_enumerable, - ecma_collection_t *main_collection_p, - ecma_collection_t *non_enum_collection_p); - - -/** - * @} - * @} - */ - -#endif /* !ECMA_STRING_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-symbol-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-symbol-object.h deleted file mode 100644 index b5721da38..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-symbol-object.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_SYMBOL_H -#define ECMA_SYMBOL_H - -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) -#include "ecma-globals.h" - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmasymbolobject ECMA Symbol object related routines - * @{ - */ - -ecma_value_t -ecma_op_create_symbol (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); - -ecma_value_t -ecma_op_create_symbol_object (const ecma_value_t value); - -bool -ecma_prop_name_is_symbol (ecma_string_t *string_p); - -ecma_string_t * -ecma_get_symbol_description (ecma_string_t *symbol_p); - -ecma_value_t -ecma_symbol_to_string_helper (ecma_value_t this_arg, bool is_to_string); - -ecma_value_t -ecma_get_symbol_descriptive_string (ecma_value_t symbol_value); - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ -/** - * @} - * @} - */ - -#endif /* !ECMA_SYMBOL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-try-catch-macro.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-try-catch-macro.h deleted file mode 100644 index 8d01ac089..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-try-catch-macro.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_TRY_CATCH_MACRO_H -#define ECMA_TRY_CATCH_MACRO_H - -#include "ecma-helpers.h" - -/** - * The macro defines try-block that initializes variable 'var' with 'op' - * and checks for exceptions that might be thrown during initialization. - * - * If no exception was thrown, then code after the try-block is executed. - * Otherwise, throw-completion value is just copied to return_value. - * - * Note: - * Each ECMA_TRY_CATCH should have it's own corresponding ECMA_FINALIZE - * statement with same argument as corresponding ECMA_TRY_CATCH's first argument. - */ -#define ECMA_TRY_CATCH(var, op, return_value) \ - JERRY_ASSERT (return_value == ECMA_VALUE_EMPTY); \ - ecma_value_t var ## _completion = op; \ - if (ECMA_IS_VALUE_ERROR (var ## _completion)) \ - { \ - return_value = var ## _completion; \ - } \ - else \ - { \ - ecma_value_t var = var ## _completion; \ - JERRY_UNUSED (var); - -/** - * The macro marks end of code block that is defined by corresponding - * ECMA_TRY_CATCH and frees variable, initialized by the ECMA_TRY_CATCH. - * - * Note: - * Each ECMA_TRY_CATCH should be followed by ECMA_FINALIZE with same argument - * as corresponding ECMA_TRY_CATCH's first argument. - */ -#define ECMA_FINALIZE(var) \ - ecma_free_value (var ## _completion); \ - } - -/** - * The macro defines try-block that tries to perform ToNumber operation on given value - * and checks for exceptions that might be thrown during the operation. - * - * If no exception was thrown, then code after the try-block is executed. - * Otherwise, throw-completion value is just copied to return_value. - * - * Note: - * Each ECMA_OP_TO_NUMBER_TRY_CATCH should have it's own corresponding ECMA_OP_TO_NUMBER_FINALIZE - * statement with same argument as corresponding ECMA_OP_TO_NUMBER_TRY_CATCH's first argument. - */ -#define ECMA_OP_TO_NUMBER_TRY_CATCH(num_var, value, return_value) \ - JERRY_ASSERT (return_value == ECMA_VALUE_EMPTY); \ - ecma_number_t num_var; \ - return_value = ecma_get_number (value, &num_var); \ - \ - if (JERRY_LIKELY (ecma_is_value_empty (return_value))) \ - { - -/** - * The macro marks end of code block that is defined by corresponding ECMA_OP_TO_NUMBER_TRY_CATCH. - * - * Note: - * Each ECMA_OP_TO_NUMBER_TRY_CATCH should be followed by ECMA_OP_TO_NUMBER_FINALIZE - * with same argument as corresponding ECMA_OP_TO_NUMBER_TRY_CATCH's first argument. - */ -#define ECMA_OP_TO_NUMBER_FINALIZE(num_var) } - -#endif /* !ECMA_TRY_CATCH_MACRO_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-typedarray-object.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-typedarray-object.h deleted file mode 100644 index 3171891a0..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/ecma-typedarray-object.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef ECMA_TYPEDARRAY_OBJECT_H -#define ECMA_TYPEDARRAY_OBJECT_H - -#include "ecma-globals.h" -#include "ecma-builtins.h" - -#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) - -/** \addtogroup ecma ECMA - * @{ - * - * \addtogroup ecmatypedarrayobject ECMA TypedArray object related routines - * @{ - */ - -uint8_t ecma_typedarray_helper_get_shift_size (ecma_typedarray_type_t typedarray_id); -ecma_typedarray_getter_fn_t ecma_get_typedarray_getter_fn (ecma_typedarray_type_t typedarray_id); -ecma_typedarray_setter_fn_t ecma_get_typedarray_setter_fn (ecma_typedarray_type_t typedarray_id); -ecma_number_t ecma_get_typedarray_element (lit_utf8_byte_t *src_p, - ecma_typedarray_type_t typedarray_id); -void ecma_set_typedarray_element (lit_utf8_byte_t *dst_p, - ecma_number_t value, - ecma_typedarray_type_t typedarray_id); -bool ecma_typedarray_helper_is_typedarray (ecma_builtin_id_t builtin_id); -ecma_typedarray_type_t ecma_get_typedarray_id (ecma_object_t *obj_p); -ecma_builtin_id_t ecma_typedarray_helper_get_prototype_id (ecma_typedarray_type_t typedarray_id); -ecma_typedarray_type_t ecma_typedarray_helper_builtin_to_typedarray_id (ecma_builtin_id_t builtin_id); - -ecma_value_t ecma_op_typedarray_from (ecma_value_t items_val, - ecma_value_t map_fn_val, - ecma_value_t this_val, - ecma_object_t *proto_p, - uint8_t element_size_shift, - ecma_typedarray_type_t typedarray_id); -ecma_length_t ecma_typedarray_get_length (ecma_object_t *typedarray_p); -ecma_length_t ecma_typedarray_get_offset (ecma_object_t *typedarray_p); -lit_utf8_byte_t *ecma_typedarray_get_buffer (ecma_object_t *typedarray_p); -uint8_t ecma_typedarray_get_element_size_shift (ecma_object_t *typedarray_p); -ecma_object_t *ecma_typedarray_get_arraybuffer (ecma_object_t *typedarray_p); -ecma_value_t ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, - ecma_length_t arguments_list_len, - ecma_object_t *proto_p, - uint8_t element_size_shift, - ecma_typedarray_type_t typedarray_id); -bool ecma_is_typedarray (ecma_value_t target); -void ecma_op_typedarray_list_lazy_property_names (ecma_object_t *obj_p, - ecma_collection_t *main_collection_p); -bool ecma_op_typedarray_define_index_prop (ecma_object_t *obj_p, - uint32_t index, - const ecma_property_descriptor_t *property_desc_p); -ecma_value_t ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, - ecma_length_t array_length); -ecma_typedarray_info_t ecma_typedarray_get_info (ecma_object_t *typedarray_p); -ecma_value_t ecma_typedarray_create_object_with_length (ecma_length_t array_length, - ecma_object_t *proto_p, - uint8_t element_size_shift, - ecma_typedarray_type_t typedarray_id); - -/** - * @} - * @} - */ - -#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */ -#endif /* !ECMA_TYPEDARRAY_OBJECT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jcontext.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jcontext.h deleted file mode 100644 index 0f779fafa..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jcontext.h +++ /dev/null @@ -1,298 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* - * Engine context for JerryScript - */ -#ifndef JCONTEXT_H -#define JCONTEXT_H - -#include "debugger.h" -#include "ecma-builtins.h" -#include "ecma-jobqueue.h" -#include "jerryscript-port.h" -#include "jmem.h" -#include "re-bytecode.h" -#include "vm-defines.h" -#include "jerryscript.h" -#include "jerryscript-debugger-transport.h" -#include "js-parser-internal.h" - -/** \addtogroup context Context - * @{ - */ - -/** - * Advanced allocator configurations. - */ -/** - * Maximum global heap size in bytes - */ -#define CONFIG_MEM_HEAP_SIZE (JERRY_GLOBAL_HEAP_SIZE * 1024) - -/** - * Maximum stack usage size in bytes - */ -#define CONFIG_MEM_STACK_LIMIT (JERRY_STACK_LIMIT * 1024) - -/** - * Max heap usage limit - */ -#define CONFIG_MAX_GC_LIMIT 8192 - -/** - * Allowed heap usage limit until next garbage collection - * - * Whenever the total allocated memory size reaches the current heap limit, garbage collection will be triggered - * to try and reduce clutter from unreachable objects. If the allocated memory can't be reduced below the limit, - * then the current limit will be incremented by CONFIG_MEM_HEAP_LIMIT. - */ -#if defined (JERRY_GC_LIMIT) && (JERRY_GC_LIMIT != 0) -#define CONFIG_GC_LIMIT JERRY_GC_LIMIT -#else -#define CONFIG_GC_LIMIT (JERRY_MIN (CONFIG_MEM_HEAP_SIZE / 32, CONFIG_MAX_GC_LIMIT)) -#endif - -/** - * Amount of newly allocated objects since the last GC run, represented as a fraction of all allocated objects, - * which when reached will trigger garbage collection to run with a low pressure setting. - * - * The fraction is calculated as: - * 1.0 / CONFIG_ECMA_GC_NEW_OBJECTS_FRACTION - */ -#define CONFIG_ECMA_GC_NEW_OBJECTS_FRACTION (16) - -#if !ENABLED (JERRY_SYSTEM_ALLOCATOR) -/** - * Heap structure - * - * Memory blocks returned by the allocator must not start from the - * beginning of the heap area because offset 0 is reserved for - * JMEM_CP_NULL. This special constant is used in several places, - * e.g. it marks the end of the property chain list, so it cannot - * be eliminated from the project. Although the allocator cannot - * use the first 8 bytes of the heap, nothing prevents to use it - * for other purposes. Currently the free region start is stored - * there. - */ -typedef struct jmem_heap_t jmem_heap_t; -#endif /* !ENABLED (JERRY_SYSTEM_ALLOCATOR) */ - -/** - * User context item - */ -typedef struct jerry_context_data_header -{ - struct jerry_context_data_header *next_p; /**< pointer to next context item */ - const jerry_context_data_manager_t *manager_p; /**< manager responsible for deleting this item */ -} jerry_context_data_header_t; - -#define JERRY_CONTEXT_DATA_HEADER_USER_DATA(item_p) \ - ((uint8_t *) (item_p + 1)) - -/** - * First non-external member of the jerry context - */ -#define JERRY_CONTEXT_FIRST_MEMBER ecma_builtin_objects - -/** - * JerryScript context - * - * The purpose of this header is storing - * all global variables for Jerry - */ -struct jerry_context_t -{ - /* The value of external context members must be preserved across initializations and cleanups. */ -#if ENABLED (JERRY_EXTERNAL_CONTEXT) -#if !ENABLED (JERRY_SYSTEM_ALLOCATOR) - jmem_heap_t *heap_p; /**< point to the heap aligned to JMEM_ALIGNMENT. */ - uint32_t heap_size; /**< size of the heap */ -#endif /* !ENABLED (JERRY_SYSTEM_ALLOCATOR) */ -#endif /* ENABLED (JERRY_EXTERNAL_CONTEXT) */ - - /* Update JERRY_CONTEXT_FIRST_MEMBER if the first non-external member changes */ - jmem_cpointer_t ecma_builtin_objects[ECMA_BUILTIN_ID__COUNT]; /**< pointer to instances of built-in objects */ -#if ENABLED (JERRY_BUILTIN_REGEXP) - const re_compiled_code_t *re_cache[RE_CACHE_SIZE]; /**< regex cache */ -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - jmem_cpointer_t ecma_gc_objects_cp; /**< List of currently alive objects. */ - jmem_heap_free_t *jmem_heap_list_skip_p; /**< This is used to speed up deallocation. */ - jmem_pools_chunk_t *jmem_free_8_byte_chunk_p; /**< list of free eight byte pool chunks */ -#if ENABLED (JERRY_CPOINTER_32_BIT) - jmem_pools_chunk_t *jmem_free_16_byte_chunk_p; /**< list of free sixteen byte pool chunks */ -#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */ - const lit_utf8_byte_t * const *lit_magic_string_ex_array; /**< array of external magic strings */ - const lit_utf8_size_t *lit_magic_string_ex_sizes; /**< external magic string lengths */ - jmem_cpointer_t string_list_first_cp; /**< first item of the literal string list */ -#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) - jmem_cpointer_t symbol_list_first_cp; /**< first item of the global symbol list */ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */ - jmem_cpointer_t number_list_first_cp; /**< first item of the literal number list */ - jmem_cpointer_t ecma_global_lex_env_cp; /**< global lexical environment */ - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) - ecma_module_t *ecma_modules_p; /**< list of referenced modules */ - ecma_module_context_t *module_top_context_p; /**< top (current) module parser context */ -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - - vm_frame_ctx_t *vm_top_context_p; /**< top (current) interpreter context */ - jerry_context_data_header_t *context_data_p; /**< linked list of user-provided context-specific pointers */ - size_t ecma_gc_objects_number; /**< number of currently allocated objects */ - size_t ecma_gc_new_objects; /**< number of newly allocated objects since last GC session */ - size_t jmem_heap_allocated_size; /**< size of allocated regions */ - size_t jmem_heap_limit; /**< current limit of heap usage, that is upon being reached, - * causes call of "try give memory back" callbacks */ - ecma_value_t error_value; /**< currently thrown error value */ - uint32_t lit_magic_string_ex_count; /**< external magic strings count */ - uint32_t jerry_init_flags; /**< run-time configuration flags */ - uint32_t status_flags; /**< run-time flags (the top 8 bits are used for passing class parsing options) */ - -#if ENABLED (JERRY_PROPRETY_HASHMAP) - uint8_t ecma_prop_hashmap_alloc_state; /**< property hashmap allocation state: 0-4, - * if !0 property hashmap allocation is disabled */ -#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */ - -#if ENABLED (JERRY_BUILTIN_REGEXP) - uint8_t re_cache_idx; /**< evicted item index when regex cache is full (round-robin) */ -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ - -#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE) - ecma_job_queueitem_t *job_queue_head_p; /**< points to the head item of the jobqueue */ - ecma_job_queueitem_t *job_queue_tail_p; /**< points to the tail item of the jobqueue*/ -#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */ - -#if ENABLED (JERRY_VM_EXEC_STOP) - uint32_t vm_exec_stop_frequency; /**< reset value for vm_exec_stop_counter */ - uint32_t vm_exec_stop_counter; /**< down counter for reducing the calls of vm_exec_stop_cb */ - void *vm_exec_stop_user_p; /**< user pointer for vm_exec_stop_cb */ - ecma_vm_exec_stop_callback_t vm_exec_stop_cb; /**< user function which returns whether the - * ECMAScript execution should be stopped */ -#endif /* ENABLED (JERRY_VM_EXEC_STOP) */ - -#if (JERRY_STACK_LIMIT != 0) - uintptr_t stack_base; /**< stack base marker */ -#endif /* (JERRY_STACK_LIMIT != 0) */ - -#if ENABLED (JERRY_DEBUGGER) - uint8_t debugger_send_buffer[JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE]; /**< buffer for sending messages */ - uint8_t debugger_receive_buffer[JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE]; /**< buffer for receiving messages */ - jerry_debugger_transport_header_t *debugger_transport_header_p; /**< head of transport protocol chain */ - uint8_t *debugger_send_buffer_payload_p; /**< start where the outgoing message can be written */ - vm_frame_ctx_t *debugger_stop_context; /**< stop only if the current context is equal to this context */ - uint8_t *debugger_exception_byte_code_p; /**< Location of the currently executed byte code if an - * error occours while the vm_loop is suspended */ - jmem_cpointer_t debugger_byte_code_free_head; /**< head of byte code free linked list */ - jmem_cpointer_t debugger_byte_code_free_tail; /**< tail of byte code free linked list */ - uint32_t debugger_flags; /**< debugger flags */ - uint16_t debugger_received_length; /**< length of currently received bytes */ - uint8_t debugger_message_delay; /**< call receive message when reaches zero */ - uint8_t debugger_max_send_size; /**< maximum amount of data that can be sent */ - uint8_t debugger_max_receive_size; /**< maximum amount of data that can be received */ -#endif /* ENABLED (JERRY_DEBUGGER) */ - -#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) - ecma_value_t resource_name; /**< resource name (usually a file name) */ -#endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ERROR_MESSAGES) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - -#if ENABLED (JERRY_MEM_STATS) - jmem_heap_stats_t jmem_heap_stats; /**< heap's memory usage statistics */ -#endif /* ENABLED (JERRY_MEM_STATS) */ - - /* This must be at the end of the context for performance reasons */ -#if ENABLED (JERRY_LCACHE) - /** hash table for caching the last access of properties */ - ecma_lcache_hash_entry_t lcache[ECMA_LCACHE_HASH_ROWS_COUNT][ECMA_LCACHE_HASH_ROW_LENGTH]; -#endif /* ENABLED (JERRY_LCACHE) */ -}; - - -#if ENABLED (JERRY_EXTERNAL_CONTEXT) - -/* - * This part is for JerryScript which uses external context. - */ - -#define JERRY_CONTEXT(field) (jerry_port_get_current_context ()->field) - -#if !ENABLED (JERRY_SYSTEM_ALLOCATOR) - -#define JMEM_HEAP_SIZE (JERRY_CONTEXT (heap_size)) - -#define JMEM_HEAP_AREA_SIZE (JMEM_HEAP_SIZE - JMEM_ALIGNMENT) - -struct jmem_heap_t -{ - jmem_heap_free_t first; /**< first node in free region list */ - uint8_t area[]; /**< heap area */ -}; - -#define JERRY_HEAP_CONTEXT(field) (JERRY_CONTEXT (heap_p)->field) - -#endif /* !ENABLED (JERRY_SYSTEM_ALLOCATOR) */ - -#else /* !ENABLED (JERRY_EXTERNAL_CONTEXT) */ - -/* - * This part is for JerryScript which uses default context. - */ - -/** - * Global context. - */ -extern jerry_context_t jerry_global_context; - -/** - * Provides a reference to a field in the current context. - */ -#define JERRY_CONTEXT(field) (jerry_global_context.field) - -#if !ENABLED (JERRY_SYSTEM_ALLOCATOR) - -/** -* Size of heap -*/ -#define JMEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_SIZE)) - -/** - * Calculate heap area size, leaving space for a pointer to the free list - */ -#define JMEM_HEAP_AREA_SIZE (JMEM_HEAP_SIZE - JMEM_ALIGNMENT) - -struct jmem_heap_t -{ - jmem_heap_free_t first; /**< first node in free region list */ - uint8_t area[JMEM_HEAP_AREA_SIZE]; /**< heap area */ -}__attribute__((aligned(8))); - -/** - * Global heap. - */ -extern jmem_heap_t jerry_global_heap; - -/** - * Provides a reference to a field of the heap. - */ -#define JERRY_HEAP_CONTEXT(field) (jerry_global_heap.field) - -#endif /* !ENABLED (JERRY_SYSTEM_ALLOCATOR) */ - -#endif /* ENABLED (JERRY_EXTERNAL_CONTEXT) */ - -/** - * @} - */ - -#endif /* !JCONTEXT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger-transport.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger-transport.h deleted file mode 100644 index f6f9acaaa..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jerryscript-debugger-transport.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYSCRIPT_DEBUGGER_TRANSPORT_H -#define JERRYSCRIPT_DEBUGGER_TRANSPORT_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** \addtogroup jerry-debugger-transport Jerry engine debugger interface - transport control - * @{ - */ - -/** - * Maximum number of bytes transmitted or received. - */ -#define JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE 128 - -/** - * Receive message context. - */ -typedef struct -{ - uint8_t *buffer_p; /**< buffer for storing the received data */ - size_t received_length; /**< number of currently received bytes */ - uint8_t *message_p; /**< start of the received message */ - size_t message_length; /**< length of the received message */ - size_t message_total_length; /**< total length for datagram protocols, - * 0 for stream protocols */ -} jerry_debugger_transport_receive_context_t; - -/** - * Forward definition of jerry_debugger_transport_header_t. - */ -struct jerry_debugger_transport_interface_t; - -/** - * Close connection callback. - */ -typedef void (*jerry_debugger_transport_close_t) (struct jerry_debugger_transport_interface_t *header_p); - -/** - * Send data callback. - */ -typedef bool (*jerry_debugger_transport_send_t) (struct jerry_debugger_transport_interface_t *header_p, - uint8_t *message_p, size_t message_length); - -/** - * Receive data callback. - */ -typedef bool (*jerry_debugger_transport_receive_t) (struct jerry_debugger_transport_interface_t *header_p, - jerry_debugger_transport_receive_context_t *context_p); - -/** - * Transport layer header. - */ -typedef struct jerry_debugger_transport_interface_t -{ - /* The following fields must be filled before calling jerry_debugger_transport_add(). */ - jerry_debugger_transport_close_t close; /**< close connection callback */ - jerry_debugger_transport_send_t send; /**< send data callback */ - jerry_debugger_transport_receive_t receive; /**< receive data callback */ - - /* The following fields are filled by jerry_debugger_transport_add(). */ - struct jerry_debugger_transport_interface_t *next_p; /**< next transport layer */ -} jerry_debugger_transport_header_t; - -void jerry_debugger_transport_add (jerry_debugger_transport_header_t *header_p, - size_t send_message_header_size, size_t max_send_message_size, - size_t receive_message_header_size, size_t max_receive_message_size); -void jerry_debugger_transport_start (void); - -bool jerry_debugger_transport_is_connected (void); -void jerry_debugger_transport_close (void); - -bool jerry_debugger_transport_send (const uint8_t *message_p, size_t message_length); -bool jerry_debugger_transport_receive (jerry_debugger_transport_receive_context_t *context_p); -void jerry_debugger_transport_receive_completed (jerry_debugger_transport_receive_context_t *context_p); - -void jerry_debugger_transport_sleep (void); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYSCRIPT_DEBUGGER_TRANSPORT_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem-allocator-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem-allocator-internal.h deleted file mode 100644 index 3abb1b22c..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jmem-allocator-internal.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JMEM_ALLOCATOR_INTERNAL_H -#define JMEM_ALLOCATOR_INTERNAL_H - -#ifndef JMEM_ALLOCATOR_INTERNAL -# error "The header is for internal routines of memory allocator component. Please, don't use the routines directly." -#endif /* !JMEM_ALLOCATOR_INTERNAL */ - -/** \addtogroup mem Memory allocation - * @{ - */ - -/** - * @{ - * Valgrind-related options and headers - */ -#if ENABLED (JERRY_VALGRIND) -# include "memcheck.h" - -# define JMEM_VALGRIND_NOACCESS_SPACE(p, s) VALGRIND_MAKE_MEM_NOACCESS((p), (s)) -# define JMEM_VALGRIND_UNDEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_UNDEFINED((p), (s)) -# define JMEM_VALGRIND_DEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_DEFINED((p), (s)) -# define JMEM_VALGRIND_MALLOCLIKE_SPACE(p, s) VALGRIND_MALLOCLIKE_BLOCK((p), (s), 0, 0) -# define JMEM_VALGRIND_RESIZE_SPACE(p, o, n) VALGRIND_RESIZEINPLACE_BLOCK((p), (o), (n), 0) -# define JMEM_VALGRIND_FREELIKE_SPACE(p) VALGRIND_FREELIKE_BLOCK((p), 0) -#else /* !ENABLED (JERRY_VALGRIND) */ -# define JMEM_VALGRIND_NOACCESS_SPACE(p, s) -# define JMEM_VALGRIND_UNDEFINED_SPACE(p, s) -# define JMEM_VALGRIND_DEFINED_SPACE(p, s) -# define JMEM_VALGRIND_MALLOCLIKE_SPACE(p, s) -# define JMEM_VALGRIND_RESIZE_SPACE(p, o, n) -# define JMEM_VALGRIND_FREELIKE_SPACE(p) -#endif /* ENABLED (JERRY_VALGRIND) */ -/** @} */ - -void jmem_heap_init (void); -void jmem_heap_finalize (void); -bool jmem_is_heap_pointer (const void *pointer); -void *jmem_heap_alloc_block_internal (const size_t size); -void jmem_heap_free_block_internal (void *ptr, const size_t size); - -/** - * \addtogroup poolman Memory pool manager - * @{ - */ - -void jmem_pools_finalize (void); - -/** - * @} - * @} - */ - -/** - * @{ - * Jerry mem-stat definitions - */ -#if ENABLED (JERRY_MEM_STATS) -void jmem_heap_stat_init (void); -void jmem_heap_stat_alloc (size_t num); -void jmem_heap_stat_free (size_t num); - -#define JMEM_HEAP_STAT_INIT() jmem_heap_stat_init () -#define JMEM_HEAP_STAT_ALLOC(v1) jmem_heap_stat_alloc (v1) -#define JMEM_HEAP_STAT_FREE(v1) jmem_heap_stat_free (v1) -#else /* !ENABLED (JERRY_MEM_STATS) */ -#define JMEM_HEAP_STAT_INIT() -#define JMEM_HEAP_STAT_ALLOC(v1) JERRY_UNUSED (v1) -#define JMEM_HEAP_STAT_FREE(v1) JERRY_UNUSED (v1) -#endif /* ENABLED (JERRY_MEM_STATS) */ - -/** @} */ - -#endif /* !JMEM_ALLOCATOR_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-bit-fields.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-bit-fields.h deleted file mode 100644 index c5aaf373f..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-bit-fields.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JRT_BIT_FIELDS_H -#define JRT_BIT_FIELDS_H - -/** - * Extract a bit-field. - * - * @param type type of container - * @param container container to extract bit-field from - * @param lsb least significant bit of the value to be extracted - * @param width width of the bit-field to be extracted - * @return bit-field's value - */ -#define JRT_EXTRACT_BIT_FIELD(type, container, lsb, width) \ - (((container) >> lsb) & ((((type) 1) << (width)) - 1)) - -/** - * Set a bit-field. - * - * @param type type of container - * @param container container to insert bit-field to - * @param new_bit_field_value value of bit-field to insert - * @param lsb least significant bit of the value to be inserted - * @param width width of the bit-field to be inserted - * @return bit-field's value - */ -#define JRT_SET_BIT_FIELD_VALUE(type, container, new_bit_field_value, lsb, width) \ - (((container) & ~(((((type) 1) << (width)) - 1) << (lsb))) | (((type) new_bit_field_value) << (lsb))) - -#endif /* !JRT_BIT_FIELDS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-libc-includes.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-libc-includes.h deleted file mode 100644 index bf87a86b2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/jrt-libc-includes.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JRT_LIBC_INCLUDES_H -#define JRT_LIBC_INCLUDES_H - -#include -#include -#include -#include -#include -#include - -#endif /* !JRT_LIBC_INCLUDES_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-lexer.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-lexer.h deleted file mode 100644 index 79f762284..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-lexer.h +++ /dev/null @@ -1,334 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_LEXER_H -#define JS_LEXER_H - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_lexer Lexer - * @{ - */ - -/** - * Lexer token types. - */ -typedef enum -{ - LEXER_EOS, /**< end of source */ - - /* Primary expressions */ - LEXER_LITERAL, /**< literal token */ - LEXER_KEYW_THIS, /**< this */ - LEXER_LIT_TRUE, /**< true (not a keyword!) */ - LEXER_LIT_FALSE, /**< false (not a keyword!) */ - LEXER_LIT_NULL, /**< null (not a keyword!) */ -#if ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) - LEXER_TEMPLATE_LITERAL, /**< multi segment template literal */ -#endif /* ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) */ -#if ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) - LEXER_THREE_DOTS, /**< ... (rest or spread operator) */ -#endif /* ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) */ - - /* Unary operators - * IMPORTANT: update CBC_UNARY_OP_TOKEN_TO_OPCODE and - * CBC_UNARY_LVALUE_OP_TOKEN_TO_OPCODE after changes. */ -#define LEXER_IS_UNARY_OP_TOKEN(token_type) \ - ((token_type) >= LEXER_PLUS && (token_type) <= LEXER_DECREASE) -#define LEXER_IS_UNARY_LVALUE_OP_TOKEN(token_type) \ - ((token_type) >= LEXER_KEYW_DELETE && (token_type) <= LEXER_DECREASE) - - LEXER_PLUS, /**< "+" */ - LEXER_NEGATE, /**< "-" */ - LEXER_LOGICAL_NOT, /**< "!" */ - LEXER_BIT_NOT, /**< "~" */ - LEXER_KEYW_VOID, /**< void */ - LEXER_KEYW_TYPEOF, /**< typeof */ - LEXER_KEYW_DELETE, /**< delete */ - LEXER_INCREASE, /**< "++" */ - LEXER_DECREASE, /**< "--" */ - - /* Binary operators - * IMPORTANT: update CBC_BINARY_OP_TOKEN_TO_OPCODE, - * CBC_BINARY_LVALUE_OP_TOKEN_TO_OPCODE and - * parser_binary_precedence_table after changes. */ -#define LEXER_IS_BINARY_OP_TOKEN(token_type) \ - ((token_type) >= LEXER_ASSIGN && (token_type) <= LEXER_MODULO) -#define LEXER_IS_BINARY_LVALUE_TOKEN(token_type) \ - ((token_type) >= LEXER_ASSIGN && (token_type) <= LEXER_ASSIGN_BIT_XOR) -#define LEXER_FIRST_BINARY_OP LEXER_ASSIGN - - LEXER_ASSIGN, /**< "=" (prec: 3) */ - LEXER_ASSIGN_ADD, /**< "+=" (prec: 3) */ - LEXER_ASSIGN_SUBTRACT, /**< "-=" (prec: 3) */ - LEXER_ASSIGN_MULTIPLY, /**< "*=" (prec: 3) */ - LEXER_ASSIGN_DIVIDE, /**< "/=" (prec: 3) */ - LEXER_ASSIGN_MODULO, /**< "%=" (prec: 3) */ - LEXER_ASSIGN_LEFT_SHIFT, /**< "<<=" (prec: 3) */ - LEXER_ASSIGN_RIGHT_SHIFT, /**< ">>=" (prec: 3) */ - LEXER_ASSIGN_UNS_RIGHT_SHIFT, /**< ">>>=" (prec: 3) */ - LEXER_ASSIGN_BIT_AND, /**< "&=" (prec: 3) */ - LEXER_ASSIGN_BIT_OR, /**< "|=" (prec: 3) */ - LEXER_ASSIGN_BIT_XOR, /**< "^=" (prec: 3) */ - LEXER_QUESTION_MARK, /**< "?" (prec: 4) */ - LEXER_LOGICAL_OR, /**< "||" (prec: 5) */ - LEXER_LOGICAL_AND, /**< "&&" (prec: 6) */ - LEXER_BIT_OR, /**< "|" (prec: 7) */ - LEXER_BIT_XOR, /**< "^" (prec: 8) */ - LEXER_BIT_AND, /**< "&" (prec: 9) */ - LEXER_EQUAL, /**< "==" (prec: 10) */ - LEXER_NOT_EQUAL, /**< "!=" (prec: 10) */ - LEXER_STRICT_EQUAL, /**< "===" (prec: 10) */ - LEXER_STRICT_NOT_EQUAL, /**< "!==" (prec: 10) */ - LEXER_LESS, /**< "<" (prec: 11) */ - LEXER_GREATER, /**< ">" (prec: 11) */ - LEXER_LESS_EQUAL, /**< "<=" (prec: 11) */ - LEXER_GREATER_EQUAL, /**< ">=" (prec: 11) */ - LEXER_KEYW_IN, /**< in (prec: 11) */ - LEXER_KEYW_INSTANCEOF, /**< instanceof (prec: 11) */ - LEXER_LEFT_SHIFT, /**< "<<" (prec: 12) */ - LEXER_RIGHT_SHIFT, /**< ">>" (prec: 12) */ - LEXER_UNS_RIGHT_SHIFT, /**< ">>>" (prec: 12) */ - LEXER_ADD, /**< "+" (prec: 13) */ - LEXER_SUBTRACT, /**< "-" (prec: 13) */ - LEXER_MULTIPLY, /**< "*" (prec: 14) */ - LEXER_DIVIDE, /**< "/" (prec: 14) */ - LEXER_MODULO, /**< "%" (prec: 14) */ - - LEXER_LEFT_BRACE, /**< "{" */ - LEXER_LEFT_PAREN, /**< "(" */ - LEXER_LEFT_SQUARE, /**< "[" */ - LEXER_RIGHT_BRACE, /**< "}" */ - LEXER_RIGHT_PAREN, /**< ")" */ - LEXER_RIGHT_SQUARE, /**< "]" */ - LEXER_DOT, /**< "." */ - LEXER_SEMICOLON, /**< ";" */ - LEXER_COLON, /**< ":" */ - LEXER_COMMA, /**< "," */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) - LEXER_ARROW, /**< "=>" */ -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ - - LEXER_KEYW_BREAK, /**< break */ - LEXER_KEYW_DO, /**< do */ - LEXER_KEYW_CASE, /**< case */ - LEXER_KEYW_ELSE, /**< else */ - LEXER_KEYW_NEW, /**< new */ - LEXER_KEYW_VAR, /**< var */ - LEXER_KEYW_CATCH, /**< catch */ - LEXER_KEYW_FINALLY, /**< finally */ - LEXER_KEYW_RETURN, /**< return */ - LEXER_KEYW_CONTINUE, /**< continue */ - LEXER_KEYW_FOR, /**< for */ - LEXER_KEYW_SWITCH, /**< switch */ - LEXER_KEYW_WHILE, /**< while */ - LEXER_KEYW_DEBUGGER, /**< debugger */ - LEXER_KEYW_FUNCTION, /**< function */ - LEXER_KEYW_WITH, /**< with */ - LEXER_KEYW_DEFAULT, /**< default */ - LEXER_KEYW_IF, /**< if */ - LEXER_KEYW_THROW, /**< throw */ - LEXER_KEYW_TRY, /**< try */ - - /* These are virtual tokens. */ - LEXER_EXPRESSION_START, /**< expression start */ - LEXER_PROPERTY_GETTER, /**< property getter function */ - LEXER_PROPERTY_SETTER, /**< property setter function */ - LEXER_COMMA_SEP_LIST, /**< comma separated bracketed expression list */ - LEXER_SCAN_SWITCH, /**< special value for switch pre-scan */ - LEXER_CLASS_CONSTRUCTOR, /**< special value for class constructor method */ -#if ENABLED (JERRY_ES2015_FOR_OF) - LEXER_FOR_IN_OF, /**< special value during for in/of statmenet scanning */ - LEXER_LITERAL_OF, /**< 'of' literal */ -#endif /* ENABLED (JERRY_ES2015_FOR_OF) */ - -#if !ENABLED (JERRY_ES2015) - /* Future reserved words: these keywords - * must form a group after all other keywords. */ -#define LEXER_FIRST_FUTURE_RESERVED_WORD LEXER_KEYW_CLASS -#endif /* !ENABLED (JERRY_ES2015) */ - LEXER_KEYW_CLASS, /**< class */ - LEXER_KEYW_EXTENDS, /**< extends */ - LEXER_KEYW_SUPER, /**< super */ - LEXER_KEYW_CONST, /**< const */ - LEXER_KEYW_EXPORT, /**< export */ - LEXER_KEYW_IMPORT, /**< import */ -#if ENABLED (JERRY_ES2015) - /* Future reserved words: these keywords - * must form a group after all other keywords. - * Note: - * Tokens from LEXER_KEYW_CLASS to LEXER_KEYW_IMPORT - * are no longer future reserved words in ES2015. */ -#define LEXER_FIRST_FUTURE_RESERVED_WORD LEXER_KEYW_ENUM -#endif /* ENABLED (JERRY_ES2015) */ - LEXER_KEYW_ENUM, /**< enum */ -#if ENABLED (JERRY_ES2015) - LEXER_KEYW_AWAIT, /**< await */ -#endif /* ENABLED (JERRY_ES2015) */ - - /* Future strict reserved words: these keywords - * must form a group after future reserved words. */ -#define LEXER_FIRST_FUTURE_STRICT_RESERVED_WORD LEXER_KEYW_IMPLEMENTS - LEXER_KEYW_IMPLEMENTS, /**< implements */ - LEXER_KEYW_PRIVATE, /**< private */ - LEXER_KEYW_PUBLIC, /**< public */ - LEXER_KEYW_INTERFACE, /**< interface */ - LEXER_KEYW_PACKAGE, /**< package */ - LEXER_KEYW_PROTECTED, /**< protected */ - -#if ENABLED (JERRY_ES2015) - /* Context dependent strict reserved words: - * See also: ECMA-262 v6, 11.6.2.1 */ -#define LEXER_FIRST_CONTEXT_DEPENDENT_RESERVED_WORD LEXER_KEYW_STATIC - LEXER_KEYW_STATIC, /**< static */ -#else /* !ENABLED (JERRY_ES2015) */ - /* Context dependent strict reserved words: - * See also: ECMA-262 v6, 11.6.2.1 */ -#define LEXER_FIRST_CONTEXT_DEPENDENT_RESERVED_WORD -#endif /* ENABLED (JERRY_ES2015) */ - - /* Context dependent future strict reserved words: - * See also: ECMA-262 v6, 11.6.2.1 */ -#define LEXER_FIRST_CONTEXT_DEPENDENT_FUTURE_RESERVED_WORD LEXER_KEYW_LET - LEXER_KEYW_LET, /**< let */ - LEXER_KEYW_YIELD, /**< yield */ -#if !ENABLED (JERRY_ES2015) - LEXER_KEYW_STATIC, /**< static */ -#endif /* !ENABLED (JERRY_ES2015) */ -} lexer_token_type_t; - -#define LEXER_NEWLINE_LS_PS_BYTE_1 0xe2 -#define LEXER_NEWLINE_LS_PS_BYTE_23(source) \ - ((source)[1] == LIT_UTF8_2_BYTE_CODE_POINT_MIN && ((source)[2] | 0x1) == 0xa9) -#define LEXER_UTF8_4BYTE_START 0xf0 - -#define LEXER_IS_LEFT_BRACKET(type) \ - ((type) == LEXER_LEFT_BRACE || (type) == LEXER_LEFT_PAREN || (type) == LEXER_LEFT_SQUARE) - -#define LEXER_IS_RIGHT_BRACKET(type) \ - ((type) == LEXER_RIGHT_BRACE || (type) == LEXER_RIGHT_PAREN || (type) == LEXER_RIGHT_SQUARE) - -#define LEXER_UNARY_OP_TOKEN_TO_OPCODE(token_type) \ - ((((token_type) - LEXER_PLUS) * 2) + CBC_PLUS) - -#define LEXER_UNARY_LVALUE_OP_TOKEN_TO_OPCODE(token_type) \ - ((((token_type) - LEXER_INCREASE) * 6) + CBC_PRE_INCR) - -#define LEXER_BINARY_OP_TOKEN_TO_OPCODE(token_type) \ - ((cbc_opcode_t) ((((token_type) - LEXER_BIT_OR) * 3) + CBC_BIT_OR)) - -#define LEXER_BINARY_LVALUE_OP_TOKEN_TO_OPCODE(token_type) \ - ((cbc_opcode_t) ((((token_type) - LEXER_ASSIGN_ADD) * 2) + CBC_ASSIGN_ADD)) - -/** - * Lexer newline flags. - */ -typedef enum -{ - LEXER_WAS_NEWLINE = (1u << 0), /**< newline was seen */ - LEXER_NO_SKIP_SPACES = (1u << 1) /**< ignore skip spaces */ -} lexer_newline_flags_t; - -/** - * Lexer object identifier parse options. - */ -typedef enum -{ - LEXER_OBJ_IDENT_NO_OPTS = (1u << 0), /**< no options */ - LEXER_OBJ_IDENT_ONLY_IDENTIFIERS = (1u << 1), /**< only identifiers are accepted */ - LEXER_OBJ_IDENT_CLASS_METHOD = (1u << 2), /**< expect identifier inside a class body */ -} lexer_obj_ident_opts_t; - -/** - * Lexer scan identifier parse options. - */ -typedef enum -{ - LEXER_SCAN_IDENT_NO_OPTS = (1u << 0), /**< no options */ - LEXER_SCAN_IDENT_PROPERTY = (1u << 1), /**< scan valid property names */ - LEXER_SCAN_IDENT_NO_KEYW = (1u << 2), /**< don't scan keywords (e.g. get/set) */ -#if ENABLED (JERRY_ES2015_CLASS) - LEXER_SCAN_CLASS_PROPERTY = (1u << 3), /**< scan valid class property names */ - LEXER_SCAN_CLASS_LEFT_PAREN = (1u << 4), /**< also parse left parenthesis */ -#endif /* ENABLED (JERRY_ES2015_CLASS) */ -} lexer_scan_ident_opts_t; - -/** - * Lexer literal object types. - */ -typedef enum -{ - LEXER_LITERAL_OBJECT_ANY, /**< unspecified object type */ - LEXER_LITERAL_OBJECT_EVAL, /**< reference is equal to eval */ - LEXER_LITERAL_OBJECT_ARGUMENTS, /**< reference is equal to arguments */ -} lexer_literal_object_type_t; - -/** - * Lexer number types. - */ -typedef enum -{ - LEXER_NUMBER_DECIMAL, /**< decimal number */ - LEXER_NUMBER_HEXADECIMAL, /**< hexadecimal number */ - LEXER_NUMBER_OCTAL, /**< octal number */ -} lexer_number_type_t; - -/** - * Lexer character (string / identifier) literal data. - */ -typedef struct -{ - const uint8_t *char_p; /**< start of identifier or string token */ - prop_length_t length; /**< length or index of a literal */ - uint8_t type; /**< type of the current literal */ - uint8_t has_escape; /**< has escape sequences */ -} lexer_lit_location_t; - -/** - * Lexer token. - */ -typedef struct -{ - uint8_t type; /**< token type */ - uint8_t literal_is_reserved; /**< future reserved keyword - * (when char_literal.type is LEXER_IDENT_LITERAL) */ - uint8_t extra_value; /**< helper value for different purposes */ - uint8_t flags; /**< flag bits for the current token */ - parser_line_counter_t line; /**< token start line */ - parser_line_counter_t column; /**< token start column */ - lexer_lit_location_t lit_location; /**< extra data for character literals */ -} lexer_token_t; - -/** - * Literal data set by lexer_construct_literal_object. - */ -typedef struct -{ - lexer_literal_t *literal_p; /**< pointer to the literal object */ - uint16_t index; /**< literal index */ - uint8_t type; /**< literal object type */ -} lexer_lit_object_t; - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_LEXER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-internal.h deleted file mode 100644 index d756f6dac..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-internal.h +++ /dev/null @@ -1,679 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_PARSER_INTERNAL_H -#define JS_PARSER_INTERNAL_H - -#include "common.h" - -#include "byte-code.h" -#include "debugger.h" -#include "js-parser.h" -#include "js-parser-limits.h" -#include "js-lexer.h" -#include "js-scanner.h" - -#include "ecma-module.h" - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_internals Internals - * @{ - */ - -/** - * General parser flags. - */ -typedef enum -{ - PARSER_IS_STRICT = (1u << 0), /**< strict mode code */ - PARSER_IS_FUNCTION = (1u << 1), /**< function body is parsed */ - PARSER_IS_CLOSURE = (1u << 2), /**< function body is encapsulated in {} block */ - PARSER_IS_FUNC_EXPRESSION = (1u << 3), /**< a function expression is parsed */ - PARSER_IS_PROPERTY_GETTER = (1u << 4), /**< a property getter function is parsed */ - PARSER_IS_PROPERTY_SETTER = (1u << 5), /**< a property setter function is parsed */ -#if ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) - PARSER_FUNCTION_HAS_REST_PARAM = (1u << 6), /**< function has rest parameter */ -#endif /* ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) */ - PARSER_HAS_NON_STRICT_ARG = (1u << 7), /**< the function has arguments which - * are not supported in strict mode */ - PARSER_ARGUMENTS_NEEDED = (1u << 8), /**< arguments object must be created */ - PARSER_ARGUMENTS_NOT_NEEDED = (1u << 9), /**< arguments object must NOT be created */ - PARSER_LEXICAL_ENV_NEEDED = (1u << 10), /**< lexical environment object must be created */ - PARSER_NO_REG_STORE = (1u << 11), /**< all local variables must be stored - * in the lexical environment object */ - PARSER_INSIDE_WITH = (1u << 12), /**< code block is inside a with statement */ - PARSER_RESOLVE_BASE_FOR_CALLS = (1u << 13), /**< the this object must be resolved when - * a function without a base object is called */ - PARSER_HAS_INITIALIZED_VARS = (1u << 14), /**< a CBC_INITIALIZE_VARS instruction must be emitted */ - PARSER_HAS_LATE_LIT_INIT = (1u << 15), /**< allocate memory for this string after - * the local parser data is freed */ - PARSER_NO_END_LABEL = (1u << 16), /**< return instruction must be inserted - * after the last byte code */ - PARSER_DEBUGGER_BREAKPOINT_APPENDED = (1u << 17), /**< pending (unsent) breakpoint - * info is available */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) - PARSER_IS_ARROW_FUNCTION = (1u << 18), /**< an arrow function is parsed */ - PARSER_ARROW_PARSE_ARGS = (1u << 19), /**< parse the argument list of an arrow function */ -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ -#if ENABLED (JERRY_ES2015_CLASS) - /* These four status flags must be in this order. See PARSER_CLASS_PARSE_OPTS_OFFSET. */ - PARSER_CLASS_CONSTRUCTOR = (1u << 20), /**< a class constructor is parsed (this value must be kept in - * in sync with ECMA_PARSE_CLASS_CONSTRUCTOR) */ - PARSER_CLASS_HAS_SUPER = (1u << 21), /**< class has super reference */ - PARSER_CLASS_IMPLICIT_SUPER = (1u << 22), /**< class has implicit parent class */ - PARSER_CLASS_STATIC_FUNCTION = (1u << 23), /**< this function is a static class method */ - PARSER_CLASS_SUPER_PROP_REFERENCE = (1u << 24), /**< super property call or assignment */ -#endif /* ENABLED (JERRY_ES2015_CLASS) */ -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) - PARSER_MODULE_DEFAULT_CLASS_OR_FUNC = (1u << 25), /**< parsing a function or class default export */ - PARSER_MODULE_STORE_IDENT = (1u << 26), /**< store identifier of the current export statement */ - PARSER_IS_EVAL = (1u << 27), /**< eval code */ -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ -#ifndef JERRY_NDEBUG - PARSER_SCANNING_SUCCESSFUL = (1u << 30), /**< scanning process was successful */ -#endif /* !JERRY_NDEBUG */ -} parser_general_flags_t; - -/** - * Expression parsing flags. - */ -typedef enum -{ - PARSE_EXPR = 0, /**< parse an expression without any special flags */ - PARSE_EXPR_NO_PUSH_RESULT = (1u << 0), /**< do not push the result of the expression onto the stack */ - PARSE_EXPR_NO_COMMA = (1u << 1), /**< do not parse comma operator */ - PARSE_EXPR_HAS_LITERAL = (1u << 2), /**< a primary literal is provided by a - * CBC_PUSH_LITERAL instruction */ -} parser_expression_flags_t; - -/** - * Mask for strict mode code - */ -#define PARSER_STRICT_MODE_MASK 0x1 - -#if ENABLED (JERRY_ES2015_CLASS) -/** - * Offset between PARSER_CLASS_CONSTRUCTOR and ECMA_PARSE_CLASS_CONSTRUCTOR - */ -#define PARSER_CLASS_PARSE_OPTS_OFFSET \ - (JERRY_LOG2 (PARSER_CLASS_CONSTRUCTOR) - JERRY_LOG2 (ECMA_PARSE_CLASS_CONSTRUCTOR)) - -/** - * Count of ecma_parse_opts_t class parsing options related bits - */ -#define PARSER_CLASS_PARSE_OPTS_COUNT \ - (JERRY_LOG2 (ECMA_PARSE_HAS_STATIC_SUPER) - JERRY_LOG2 (ECMA_PARSE_CLASS_CONSTRUCTOR)) - -/** - * Mask for get class option bits from ecma_parse_opts_t - */ -#define PARSER_CLASS_ECMA_PARSE_OPTS_TO_PARSER_OPTS_MASK \ - (((1 << PARSER_CLASS_PARSE_OPTS_COUNT) - 1) << JERRY_LOG2 (ECMA_PARSE_CLASS_CONSTRUCTOR)) - -/** - * Get class option bits from ecma_parse_opts_t - */ -#define PARSER_GET_CLASS_PARSER_OPTS(opts) \ - (((opts) & PARSER_CLASS_ECMA_PARSE_OPTS_TO_PARSER_OPTS_MASK) << PARSER_CLASS_PARSE_OPTS_OFFSET) - -/** - * Get class option bits from parser_general_flags_t - */ -#define PARSER_GET_CLASS_ECMA_PARSE_OPTS(opts) \ - ((uint16_t) (((opts) >> PARSER_CLASS_PARSE_OPTS_OFFSET) & PARSER_CLASS_ECMA_PARSE_OPTS_TO_PARSER_OPTS_MASK)) - -/** - * Class constructor with heritage context representing bits - */ -#define PARSER_CLASS_CONSTRUCTOR_SUPER (PARSER_CLASS_CONSTRUCTOR | PARSER_CLASS_HAS_SUPER) - -/** - * Check the scope is a class constructor with heritage context - */ -#define PARSER_IS_CLASS_CONSTRUCTOR_SUPER(flag) \ - (((flag) & PARSER_CLASS_CONSTRUCTOR_SUPER) == PARSER_CLASS_CONSTRUCTOR_SUPER) -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -/* The maximum of PARSER_CBC_STREAM_PAGE_SIZE is 127. */ -#define PARSER_CBC_STREAM_PAGE_SIZE \ - ((uint32_t) (64 - sizeof (void *))) - -#define PARSER_STACK_PAGE_SIZE \ - ((uint32_t) (((sizeof (void *) > 4) ? 128 : 64) - sizeof (void *))) - -/* Avoid compiler warnings for += operations. */ -#define PARSER_PLUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) + (value)) -#define PARSER_MINUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) - (value)) -#define PARSER_PLUS_EQUAL_LC(base, value) (base) = (parser_line_counter_t) ((base) + (value)) - -/** - * Argument for a compact-byte code. - */ -typedef struct -{ - uint16_t literal_index; /**< literal index argument */ - uint16_t value; /**< other argument (second literal or byte). */ - uint16_t third_literal_index; /**< literal index argument */ - uint8_t literal_type; /**< last literal type */ - uint8_t literal_object_type; /**< last literal object type */ -} cbc_argument_t; - -/* Useful parser macros. */ - -#define PARSER_CBC_UNAVAILABLE CBC_EXT_OPCODE - -#define PARSER_TO_EXT_OPCODE(opcode) ((uint16_t) ((opcode) + 256)) -#define PARSER_GET_EXT_OPCODE(opcode) ((opcode) - 256) -#define PARSER_IS_BASIC_OPCODE(opcode) ((opcode) < 256) -#define PARSER_IS_PUSH_LITERAL(opcode) \ - ((opcode) == CBC_PUSH_LITERAL \ - || (opcode) == CBC_PUSH_TWO_LITERALS \ - || (opcode) == CBC_PUSH_THREE_LITERALS) -#define PARSER_IS_PUSH_NUMBER(opcode) \ - ((opcode) == CBC_PUSH_NUMBER_0 \ - || (opcode) == CBC_PUSH_NUMBER_POS_BYTE \ - || (opcode) == CBC_PUSH_NUMBER_NEG_BYTE \ - || (opcode) == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_0) \ - || (opcode) == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_POS_BYTE) \ - || (opcode) == PARSER_TO_EXT_OPCODE (CBC_EXT_PUSH_LITERAL_PUSH_NUMBER_NEG_BYTE)) - -#define PARSER_IS_MUTABLE_PUSH_LITERAL(opcode) \ - ((opcode) >= CBC_PUSH_LITERAL && (opcode) <= CBC_PUSH_THIS_LITERAL) - -#define PARSER_IS_PUSH_LITERALS_WITH_THIS(opcode) \ - ((opcode) >= CBC_PUSH_LITERAL && (opcode) <= CBC_PUSH_THREE_LITERALS) - -#define PARSER_IS_PUSH_PROP(opcode) \ - ((opcode) >= CBC_PUSH_PROP && (opcode) <= CBC_PUSH_PROP_THIS_LITERAL) - -#define PARSER_IS_PUSH_PROP_LITERAL(opcode) \ - ((opcode) >= CBC_PUSH_PROP_LITERAL && (opcode) <= CBC_PUSH_PROP_THIS_LITERAL) - -#define PARSER_PUSH_LITERAL_TO_PUSH_PROP_LITERAL(opcode) \ - (uint16_t) ((opcode) + (CBC_PUSH_PROP_LITERAL - CBC_PUSH_LITERAL)) - -#define PARSER_PUSH_PROP_LITERAL_TO_PUSH_LITERAL(opcode) \ - (uint16_t) ((opcode) - (CBC_PUSH_PROP_LITERAL - CBC_PUSH_LITERAL)) - -#define PARSER_PUSH_PROP_TO_PUSH_PROP_REFERENCE(opcode) \ - (uint16_t) ((opcode) + (CBC_PUSH_PROP_REFERENCE - CBC_PUSH_PROP)) - -#define PARSER_PUSH_PROP_REFERENCE_TO_PUSH_PROP(opcode) \ - (uint16_t) ((opcode) - (CBC_PUSH_PROP_REFERENCE - CBC_PUSH_PROP)) - -#define PARSER_GET_LITERAL(literal_index) \ - ((lexer_literal_t *) parser_list_get (&context_p->literal_pool, (literal_index))) - -#define PARSER_TO_BINARY_OPERATION_WITH_RESULT(opcode) \ - (PARSER_TO_EXT_OPCODE(opcode) - CBC_ASSIGN_ADD + CBC_EXT_ASSIGN_ADD_PUSH_RESULT) - -#define PARSER_TO_BINARY_OPERATION_WITH_BLOCK(opcode) \ - ((uint16_t) (PARSER_TO_EXT_OPCODE(opcode) - CBC_ASSIGN_ADD + CBC_EXT_ASSIGN_ADD_BLOCK)) - -#define PARSER_GET_FLAGS(op) \ - (PARSER_IS_BASIC_OPCODE (op) ? cbc_flags[(op)] : cbc_ext_flags[PARSER_GET_EXT_OPCODE (op)]) - -#define PARSER_OPCODE_IS_RETURN(op) \ - ((op) == CBC_RETURN || (op) == CBC_RETURN_WITH_BLOCK || (op) == CBC_RETURN_WITH_LITERAL) - -#define PARSER_ARGS_EQ(op, types) \ - ((PARSER_GET_FLAGS (op) & CBC_ARG_TYPES) == (types)) - -/** - * All data allocated by the parser is - * stored in parser_data_pages in the memory. - */ -typedef struct parser_mem_page_t -{ - struct parser_mem_page_t *next_p; /**< next page */ - uint8_t bytes[1]; /**< memory bytes */ -} parser_mem_page_t; - -/** - * Structure for managing parser memory. - */ -typedef struct -{ - parser_mem_page_t *first_p; /**< first allocated page */ - parser_mem_page_t *last_p; /**< last allocated page */ - uint32_t last_position; /**< position of the last allocated byte */ -} parser_mem_data_t; - -/** - * Parser memory list. - */ -typedef struct -{ - parser_mem_data_t data; /**< storage space */ - uint32_t page_size; /**< size of each page */ - uint32_t item_size; /**< size of each item */ - uint32_t item_count; /**< number of items on each page */ -} parser_list_t; - -/** - * Iterator for parser memory list. - */ -typedef struct -{ - parser_list_t *list_p; /**< parser list */ - parser_mem_page_t *current_p; /**< currently processed page */ - size_t current_position; /**< current position on the page */ -} parser_list_iterator_t; - -/** - * Parser memory stack. - */ -typedef struct -{ - parser_mem_data_t data; /**< storage space */ - parser_mem_page_t *free_page_p; /**< space for fast allocation */ -} parser_stack_t; - -/** - * Iterator for parser memory stack. - */ -typedef struct -{ - parser_mem_page_t *current_p; /**< currently processed page */ - size_t current_position; /**< current position on the page */ -} parser_stack_iterator_t; - -/** - * Branch type. - */ -typedef struct -{ - parser_mem_page_t *page_p; /**< branch location page */ - uint32_t offset; /**< branch location offset */ -} parser_branch_t; - -/** - * Branch chain type. - */ -typedef struct parser_branch_node_t -{ - struct parser_branch_node_t *next_p; /**< next linked list node */ - parser_branch_t branch; /**< branch */ -} parser_branch_node_t; - -#if ENABLED (JERRY_DEBUGGER) -/** - * Extra information for each breakpoint. - */ -typedef struct -{ - uint32_t value; /**< line or offset of the breakpoint */ -} parser_breakpoint_info_t; - -/** - * Maximum number of breakpoint info. - */ -#define PARSER_MAX_BREAKPOINT_INFO_COUNT \ - (JERRY_DEBUGGER_TRANSPORT_MAX_BUFFER_SIZE / sizeof (parser_breakpoint_info_t)) - -#endif /* ENABLED (JERRY_DEBUGGER) */ - -/** - * Those members of a context which needs - * to be saved when a sub-function is parsed. - */ -typedef struct parser_saved_context_t -{ - /* Parser members. */ - uint32_t status_flags; /**< parsing options */ - uint16_t stack_depth; /**< current stack depth */ - uint16_t stack_limit; /**< maximum stack depth */ - struct parser_saved_context_t *prev_context_p; /**< last saved context */ - parser_stack_iterator_t last_statement; /**< last statement position */ - - /* Literal types */ - uint16_t argument_count; /**< number of function arguments */ - uint16_t register_count; /**< number of registers */ - uint16_t literal_count; /**< number of literals */ - - /* Memory storage members. */ - parser_mem_data_t byte_code; /**< byte code buffer */ - uint32_t byte_code_size; /**< byte code size for branches */ - parser_mem_data_t literal_pool_data; /**< literal list */ - -#ifndef JERRY_NDEBUG - uint16_t context_stack_depth; /**< current context stack depth */ -#endif /* !JERRY_NDEBUG */ -} parser_saved_context_t; - -/** - * Shared parser context. - */ -typedef struct -{ - PARSER_TRY_CONTEXT (try_buffer); /**< try_buffer */ - parser_error_t error; /**< error code */ - void *allocated_buffer_p; /**< dinamically allocated buffer - * which needs to be freed on error */ - uint32_t allocated_buffer_size; /**< size of the dinamically allocated buffer */ - - /* Parser members. */ - uint32_t status_flags; /**< status flags */ - uint16_t stack_depth; /**< current stack depth */ - uint16_t stack_limit; /**< maximum stack depth */ - parser_saved_context_t *last_context_p; /**< last saved context */ - parser_stack_iterator_t last_statement; /**< last statement position */ - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) - ecma_module_node_t *module_current_node_p; /**< import / export node that is being processed */ - lexer_literal_t *module_identifier_lit_p; /**< the literal for the identifier of the current element */ -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - - /* Lexer members. */ - lexer_token_t token; /**< current token */ - lexer_lit_object_t lit_object; /**< current literal object */ - const uint8_t *source_p; /**< next source byte */ - const uint8_t *source_end_p; /**< last source byte */ - parser_line_counter_t line; /**< current line */ - parser_line_counter_t column; /**< current column */ - - /* Scanner members. */ - scanner_info_t *next_scanner_info_p; /**< next scanner info block */ - scanner_info_t *active_scanner_info_p; /**< currently active scanner info block */ - scanner_info_t *skipped_scanner_info_p; /**< next scanner info block */ - scanner_info_t *skipped_scanner_info_end_p; /**< currently active scanner info block */ - - /* Compact byte code members. */ - cbc_argument_t last_cbc; /**< argument of the last cbc */ - uint16_t last_cbc_opcode; /**< opcode of the last cbc */ - - /* Literal types */ - uint16_t argument_count; /**< number of function arguments */ - uint16_t register_count; /**< number of registers */ - uint16_t literal_count; /**< number of literals */ - - /* Memory storage members. */ - parser_mem_data_t byte_code; /**< byte code buffer */ - uint32_t byte_code_size; /**< current byte code size for branches */ - parser_list_t literal_pool; /**< literal list */ - parser_mem_data_t stack; /**< storage space */ - parser_mem_page_t *free_page_p; /**< space for fast allocation */ - uint8_t stack_top_uint8; /**< top byte stored on the stack */ - -#ifndef JERRY_NDEBUG - /* Variables for debugging / logging. */ - uint16_t context_stack_depth; /**< current context stack depth */ -#endif /* !JERRY_NDEBUG */ - -#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) - int is_show_opcodes; /**< show opcodes */ - uint32_t total_byte_code_size; /**< total byte code size */ -#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */ - -#if ENABLED (JERRY_DEBUGGER) - parser_breakpoint_info_t breakpoint_info[PARSER_MAX_BREAKPOINT_INFO_COUNT]; /**< breakpoint info list */ - uint16_t breakpoint_info_count; /**< current breakpoint index */ - parser_line_counter_t last_breakpoint_line; /**< last line where breakpoint has been inserted */ -#endif /* ENABLED (JERRY_DEBUGGER) */ - -#if ENABLED (JERRY_LINE_INFO) - parser_line_counter_t last_line_info_line; /**< last line where line info has been inserted */ -#endif /* ENABLED (JERRY_LINE_INFO) */ -} parser_context_t; - -/** - * @} - * @} - * @} - * - * \addtogroup mem Memory allocation - * @{ - * - * \addtogroup mem_parser Parser memory manager - * @{ - */ - -/* Memory management. - * Note: throws an error if unsuccessful. */ -void *parser_malloc (parser_context_t *context_p, size_t size); -void parser_free (void *ptr, size_t size); -void *parser_malloc_local (parser_context_t *context_p, size_t size); -void parser_free_local (void *ptr, size_t size); - -/* Parser byte stream. */ - -void parser_cbc_stream_init (parser_mem_data_t *data_p); -void parser_cbc_stream_free (parser_mem_data_t *data_p); -void parser_cbc_stream_alloc_page (parser_context_t *context_p, parser_mem_data_t *data_p); - -/* Parser list. Ensures pointer alignment. */ - -void parser_list_init (parser_list_t *list_p, uint32_t item_size, uint32_t item_count); -void parser_list_free (parser_list_t *list_p); -void parser_list_reset (parser_list_t *list_p); -void *parser_list_append (parser_context_t *context_p, parser_list_t *list_p); -void *parser_list_get (parser_list_t *list_p, size_t index); -void parser_list_iterator_init (parser_list_t *list_p, parser_list_iterator_t *iterator_p); -void *parser_list_iterator_next (parser_list_iterator_t *iterator_p); - -/* Parser stack. Optimized for pushing bytes. - * Pop functions never throws error. */ - -void parser_stack_init (parser_context_t *context_p); -void parser_stack_free (parser_context_t *context_p); -void parser_stack_push_uint8 (parser_context_t *context_p, uint8_t uint8_value); -void parser_stack_pop_uint8 (parser_context_t *context_p); -void parser_stack_push_uint16 (parser_context_t *context_p, uint16_t uint16_value); -uint16_t parser_stack_pop_uint16 (parser_context_t *context_p); -void parser_stack_push (parser_context_t *context_p, const void *data_p, uint32_t length); -void parser_stack_pop (parser_context_t *context_p, void *data_p, uint32_t length); -void parser_stack_iterator_skip (parser_stack_iterator_t *iterator, size_t length); -void parser_stack_iterator_read (parser_stack_iterator_t *iterator, void *data_p, size_t length); -void parser_stack_iterator_write (parser_stack_iterator_t *iterator, const void *data_p, size_t length); - -/** - * @} - * @} - * - * \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_utils Utility - * @{ - */ - -/* Compact byte code emitting functions. */ - -void parser_flush_cbc (parser_context_t *context_p); -void parser_emit_cbc (parser_context_t *context_p, uint16_t opcode); -void parser_emit_cbc_literal (parser_context_t *context_p, uint16_t opcode, uint16_t literal_index); -void parser_emit_cbc_literal_from_token (parser_context_t *context_p, uint16_t opcode); -void parser_emit_cbc_call (parser_context_t *context_p, uint16_t opcode, size_t call_arguments); -void parser_emit_cbc_push_number (parser_context_t *context_p, bool is_negative_number); -void parser_emit_cbc_forward_branch (parser_context_t *context_p, uint16_t opcode, parser_branch_t *branch_p); -parser_branch_node_t *parser_emit_cbc_forward_branch_item (parser_context_t *context_p, uint16_t opcode, - parser_branch_node_t *next_p); -void parser_emit_cbc_backward_branch (parser_context_t *context_p, uint16_t opcode, uint32_t offset); -void parser_set_branch_to_current_position (parser_context_t *context_p, parser_branch_t *branch_p); -void parser_set_breaks_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p); -void parser_set_continues_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p); - -/* Convenience macros. */ -#define parser_emit_cbc_ext(context_p, opcode) \ - parser_emit_cbc ((context_p), PARSER_TO_EXT_OPCODE (opcode)) -#define parser_emit_cbc_ext_literal(context_p, opcode, literal_index) \ - parser_emit_cbc_literal ((context_p), PARSER_TO_EXT_OPCODE (opcode), (literal_index)) -#define parser_emit_cbc_ext_call(context_p, opcode, call_arguments) \ - parser_emit_cbc_call ((context_p), PARSER_TO_EXT_OPCODE (opcode), (call_arguments)) -#define parser_emit_cbc_ext_forward_branch(context_p, opcode, branch_p) \ - parser_emit_cbc_forward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (branch_p)) -#define parser_emit_cbc_ext_backward_branch(context_p, opcode, offset) \ - parser_emit_cbc_backward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (offset)) - -/** - * @} - * - * \addtogroup jsparser_lexer Lexer - * @{ - */ - -/* Lexer functions */ - -void lexer_next_token (parser_context_t *context_p); -bool lexer_check_next_character (parser_context_t *context_p, lit_utf8_byte_t character); -#if ENABLED (JERRY_ES2015_CLASS) -void lexer_skip_empty_statements (parser_context_t *context_p); -#endif /* ENABLED (JERRY_ES2015_CLASS) */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) -bool lexer_check_arrow (parser_context_t *context_p); -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ -void lexer_parse_string (parser_context_t *context_p); -void lexer_expect_identifier (parser_context_t *context_p, uint8_t literal_type); -void lexer_scan_identifier (parser_context_t *context_p, uint32_t ident_opts); -ecma_char_t lexer_hex_to_character (parser_context_t *context_p, const uint8_t *source_p, int length); -void lexer_expect_object_literal_id (parser_context_t *context_p, uint32_t ident_opts); -void lexer_construct_literal_object (parser_context_t *context_p, lexer_lit_location_t *literal_p, - uint8_t literal_type); -bool lexer_construct_number_object (parser_context_t *context_p, bool is_expr, bool is_negative_number); -void lexer_convert_push_number_to_push_literal (parser_context_t *context_p); -uint16_t lexer_construct_function_object (parser_context_t *context_p, uint32_t extra_status_flags); -void lexer_construct_regexp_object (parser_context_t *context_p, bool parse_only); -bool lexer_compare_identifier_to_current (parser_context_t *context_p, const lexer_lit_location_t *right_ident_p); -bool lexer_compare_literal_to_identifier (parser_context_t *context_p, const char *identifier_p, - size_t identifier_length); -bool lexer_compare_literal_to_string (parser_context_t *context_p, const char *string_p, size_t string_length); -uint8_t lexer_convert_binary_lvalue_token_to_binary (uint8_t token); - -/** - * @} - * - * \addtogroup jsparser_expr Expression parser - * @{ - */ - -/* Parser functions. */ - -void parser_parse_block_expression (parser_context_t *context_p, int options); -void parser_parse_expression_statement (parser_context_t *context_p, int options); -void parser_parse_expression (parser_context_t *context_p, int options); -#if ENABLED (JERRY_ES2015_CLASS) -void parser_parse_class (parser_context_t *context_p, bool is_statement); -void parser_parse_super_class_context_start (parser_context_t *context_p); -void parser_parse_super_class_context_end (parser_context_t *context_p, bool is_statement); -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - -/** - * @} - * - * \addtogroup jsparser_scanner Scanner - * @{ - */ - -void scanner_raise_error (parser_context_t *context_p); -void *scanner_malloc (parser_context_t *context_p, size_t size); -void scanner_free (void *ptr, size_t size); - -scanner_info_t *scanner_insert_info (parser_context_t *context_p, const uint8_t *source_p, size_t size); -void scanner_release_next (parser_context_t *context_p, size_t size); -void scanner_set_active (parser_context_t *context_p); -void scanner_release_active (parser_context_t *context_p, size_t size); -void scanner_release_switch_cases (scanner_case_info_t *case_p); -void scanner_seek (parser_context_t *context_p); -void scanner_reverse_info_list (parser_context_t *context_p); -void scanner_cleanup (parser_context_t *context_p); - -void scanner_get_location (scanner_location_t *location_p, parser_context_t *context_p); -void scanner_set_location (parser_context_t *context_p, scanner_location_t *location_p); - -void scanner_scan_all (parser_context_t *context_p, const uint8_t *arg_list_p, const uint8_t *arg_list_end_p, - const uint8_t *source_p, const uint8_t *source_end_p); - -/** - * @} - * - * \addtogroup jsparser_stmt Statement parser - * @{ - */ - -void parser_parse_statements (parser_context_t *context_p); -void parser_free_jumps (parser_stack_iterator_t iterator); - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) -/** - * @} - * - * \addtogroup jsparser_stmt Module statement parser - * @{ - */ - -extern const lexer_lit_location_t lexer_default_literal; -void parser_module_add_export_node_to_context (parser_context_t *context_p); -void parser_module_add_import_node_to_context (parser_context_t *context_p); -void parser_module_check_request_place (parser_context_t *context_p); -void parser_module_context_init (void); -void parser_module_handle_module_specifier (parser_context_t *context_p); -void parser_module_handle_requests (parser_context_t *context_p); -void parser_module_parse_export_clause (parser_context_t *context_p); -void parser_module_parse_import_clause (parser_context_t *context_p); -void parser_module_set_default (parser_context_t *context_p); -ecma_module_node_t *parser_module_create_module_node (parser_context_t *context_p); -bool parser_module_check_duplicate_import (parser_context_t *context_p, ecma_string_t *local_name_p); -bool parser_module_check_duplicate_export (parser_context_t *context_p, ecma_string_t *export_name_p); -void parser_module_add_names_to_node (parser_context_t *context_p, - ecma_string_t *imex_name_p, - ecma_string_t *local_name_p); - -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - -/** - * @} - * - * \addtogroup jsparser_parser Parser - * @{ - */ - -ecma_compiled_code_t *parser_parse_function (parser_context_t *context_p, uint32_t status_flags); -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) -ecma_compiled_code_t *parser_parse_arrow_function (parser_context_t *context_p, uint32_t status_flags); -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ - -/* Error management. */ - -void parser_raise_error (parser_context_t *context_p, parser_error_t error); - -/* Debug functions. */ - -#if ENABLED (JERRY_DEBUGGER) - -void parser_append_breakpoint_info (parser_context_t *context_p, jerry_debugger_header_type_t type, uint32_t value); - -#endif /* ENABLED (JERRY_DEBUGGER) */ - -#if ENABLED (JERRY_LINE_INFO) - -void parser_emit_line_info (parser_context_t *context_p, uint32_t line, bool flush_cbc); - -#endif /* ENABLED (JERRY_LINE_INFO) */ - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_PARSER_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-limits.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-limits.h deleted file mode 100644 index 89ed26732..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser-limits.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_PARSER_LIMITS_H -#define JS_PARSER_LIMITS_H - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_internals Internals - * @{ - */ - -/** - * Maximum identifier length accepted by the parser. - * Limit: LEXER_MAX_STRING_LENGTH. - */ -#ifndef PARSER_MAXIMUM_IDENT_LENGTH -#define PARSER_MAXIMUM_IDENT_LENGTH 255 -#endif /* !PARSER_MAXIMUM_IDENT_LENGTH */ - -/** - * Maximum string limit. - * Limit: 2147483647 / 65535. - */ -#if ENABLED (JERRY_CPOINTER_32_BIT) -#define PARSER_MAXIMUM_STRING_LIMIT 2147483647 -#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */ -#define PARSER_MAXIMUM_STRING_LIMIT 65535 -#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */ - -/** - * Maximum string length. - * Limit: PARSER_MAXIMUM_STRING_LIMIT. - */ -#ifndef PARSER_MAXIMUM_STRING_LENGTH -#define PARSER_MAXIMUM_STRING_LENGTH PARSER_MAXIMUM_STRING_LIMIT -#endif /* !PARSER_MAXIMUM_STRING_LENGTH */ - -/** - * Maximum number of literals. - * Limit: 32767. Recommended: 510, 32767 - */ -#ifndef PARSER_MAXIMUM_NUMBER_OF_LITERALS -#define PARSER_MAXIMUM_NUMBER_OF_LITERALS 32767 -#endif /* !PARSER_MAXIMUM_NUMBER_OF_LITERALS */ - -/** - * Maximum number of registers. - * Limit: PARSER_MAXIMUM_NUMBER_OF_LITERALS - */ -#ifndef PARSER_MAXIMUM_NUMBER_OF_REGISTERS -#define PARSER_MAXIMUM_NUMBER_OF_REGISTERS 256 -#endif /* !PARSER_MAXIMUM_NUMBER_OF_REGISTERS */ - -/** - * Maximum code size. - * Limit: 16777215. Recommended: 65535, 16777215. - */ -#ifndef PARSER_MAXIMUM_CODE_SIZE -#define PARSER_MAXIMUM_CODE_SIZE (65535 << (JMEM_ALIGNMENT_LOG)) -#endif /* !PARSER_MAXIMUM_CODE_SIZE */ - -/** - * Maximum number of values pushed onto the stack by a function. - * Limit: 65500. Recommended: 1024. - */ -#ifndef PARSER_MAXIMUM_STACK_LIMIT -#define PARSER_MAXIMUM_STACK_LIMIT 1024 - -#endif /* !PARSER_MAXIMUM_STACK_LIMIT */ - -/* Checks. */ - -#if (PARSER_MAXIMUM_STRING_LENGTH < 1) || (PARSER_MAXIMUM_STRING_LENGTH > PARSER_MAXIMUM_STRING_LIMIT) -#error "Maximum string length is not within range." -#endif /* (PARSER_MAXIMUM_STRING_LENGTH < 1) || (PARSER_MAXIMUM_STRING_LENGTH > PARSER_MAXIMUM_STRING_LIMIT) */ - -#if (PARSER_MAXIMUM_IDENT_LENGTH < 1) || (PARSER_MAXIMUM_IDENT_LENGTH > PARSER_MAXIMUM_STRING_LENGTH) -#error "Maximum identifier length is not within range." -#endif /* (PARSER_MAXIMUM_IDENT_LENGTH < 1) || (PARSER_MAXIMUM_IDENT_LENGTH > PARSER_MAXIMUM_STRING_LENGTH) */ - -#if (PARSER_MAXIMUM_NUMBER_OF_LITERALS < 1) || (PARSER_MAXIMUM_NUMBER_OF_LITERALS > 32767) -#error "Maximum number of literals is not within range." -#endif /* (PARSER_MAXIMUM_NUMBER_OF_LITERALS < 1) || (PARSER_MAXIMUM_NUMBER_OF_LITERALS > 32767) */ - -#if (PARSER_MAXIMUM_NUMBER_OF_REGISTERS > PARSER_MAXIMUM_NUMBER_OF_LITERALS) -#error "Maximum number of registers is not within range." -#endif /* (PARSER_MAXIMUM_NUMBER_OF_REGISTERS > PARSER_MAXIMUM_NUMBER_OF_LITERALS) */ - -#if (PARSER_MAXIMUM_CODE_SIZE < 4096) || (PARSER_MAXIMUM_CODE_SIZE > 16777215) -#error "Maximum code size is not within range." -#endif /* (PARSER_MAXIMUM_CODE_SIZE < 4096) || (PARSER_MAXIMUM_CODE_SIZE > 16777215) */ - -#if (PARSER_MAXIMUM_STACK_LIMIT < 16) || (PARSER_MAXIMUM_STACK_LIMIT > 65500) -#error "Maximum function stack usage is not within range." -#endif /* (PARSER_MAXIMUM_STACK_LIMIT < 16) || (PARSER_MAXIMUM_STACK_LIMIT > 65500) */ - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_PARSER_LIMITS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser.h deleted file mode 100644 index 599abeddc..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-parser.h +++ /dev/null @@ -1,182 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_PARSER_H -#define JS_PARSER_H - -#include "ecma-globals.h" - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_parser Parser - * @{ - */ - -/** - * Error codes. - */ -typedef enum -{ - PARSER_ERR_NO_ERROR, /**< no error */ - - PARSER_ERR_OUT_OF_MEMORY, /**< out of memory */ - PARSER_ERR_LITERAL_LIMIT_REACHED, /**< maximum number of literals reached */ - PARSER_ERR_ARGUMENT_LIMIT_REACHED, /**< maximum number of function arguments reached */ - PARSER_ERR_STACK_LIMIT_REACHED, /**< maximum function stack size reached */ - PARSER_ERR_REGISTER_LIMIT_REACHED, /**< maximum register size reached */ - - PARSER_ERR_INVALID_CHARACTER, /**< unexpected character */ - PARSER_ERR_INVALID_HEX_DIGIT, /**< invalid hexadecimal digit */ - PARSER_ERR_INVALID_ESCAPE_SEQUENCE, /**< invalid escape sequence */ - PARSER_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE, /**< invalid unicode escape sequence */ - PARSER_ERR_INVALID_IDENTIFIER_START, /**< character cannot be start of an identifier */ - PARSER_ERR_INVALID_IDENTIFIER_PART, /**< character cannot be part of an identifier */ - - PARSER_ERR_INVALID_NUMBER, /**< invalid number literal */ - PARSER_ERR_MISSING_EXPONENT, /**< missing exponent */ - PARSER_ERR_IDENTIFIER_AFTER_NUMBER, /**< identifier start after number */ - - PARSER_ERR_INVALID_REGEXP, /**< invalid regular expression */ - PARSER_ERR_UNKNOWN_REGEXP_FLAG, /**< unknown regexp flag */ - PARSER_ERR_DUPLICATED_REGEXP_FLAG, /**< duplicated regexp flag */ - PARSER_ERR_UNSUPPORTED_REGEXP, /**< regular expression is not supported */ - - PARSER_ERR_IDENTIFIER_TOO_LONG, /**< too long identifier */ - PARSER_ERR_STRING_TOO_LONG, /**< too long string literal */ - PARSER_ERR_NUMBER_TOO_LONG, /**< too long number literal */ - PARSER_ERR_REGEXP_TOO_LONG, /**< too long regexp literal */ - - PARSER_ERR_UNTERMINATED_MULTILINE_COMMENT, /**< unterminated multiline comment */ - PARSER_ERR_UNTERMINATED_STRING, /**< unterminated string literal */ - PARSER_ERR_UNTERMINATED_REGEXP, /**< unterminated regexp literal */ - - PARSER_ERR_NEWLINE_NOT_ALLOWED, /**< newline is not allowed */ - PARSER_ERR_OCTAL_NUMBER_NOT_ALLOWED, /**< octal numbers are not allowed in strict mode */ - PARSER_ERR_OCTAL_ESCAPE_NOT_ALLOWED, /**< octal escape sequences are not allowed in strict mode */ - PARSER_ERR_STRICT_IDENT_NOT_ALLOWED, /**< identifier name is reserved in strict mode */ - PARSER_ERR_EVAL_NOT_ALLOWED, /**< eval is not allowed here in strict mode */ - PARSER_ERR_ARGUMENTS_NOT_ALLOWED, /**< arguments is not allowed here in strict mode */ - PARSER_ERR_DELETE_IDENT_NOT_ALLOWED, /**< identifier delete is not allowed in strict mode */ - PARSER_ERR_EVAL_CANNOT_ASSIGNED, /**< eval cannot be assigned in strict mode */ - PARSER_ERR_ARGUMENTS_CANNOT_ASSIGNED, /**< arguments cannot be assigned in strict mode */ - PARSER_ERR_WITH_NOT_ALLOWED, /**< with statement is not allowed in strict mode */ - PARSER_ERR_MULTIPLE_DEFAULTS_NOT_ALLOWED, /**< multiple default cases are not allowed */ - PARSER_ERR_DEFAULT_NOT_IN_SWITCH, /**< default statement is not in switch block */ - PARSER_ERR_CASE_NOT_IN_SWITCH, /**< case statement is not in switch block */ -#if ENABLED (JERRY_ES2015_CLASS) - PARSER_ERR_MULTIPLE_CLASS_CONSTRUCTORS, /**< multiple class constructor */ - PARSER_ERR_CLASS_CONSTRUCTOR_AS_ACCESSOR, /**< class constructor cannot be an accessor */ - PARSER_ERR_CLASS_STATIC_PROTOTYPE, /**< static method name 'prototype' is not allowed */ - PARSER_ERR_UNEXPECTED_SUPER_REFERENCE, /**< unexpected super keyword */ -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - - PARSER_ERR_LEFT_PAREN_EXPECTED, /**< left paren expected */ - PARSER_ERR_LEFT_BRACE_EXPECTED, /**< left brace expected */ - PARSER_ERR_RIGHT_PAREN_EXPECTED, /**< right paren expected */ - PARSER_ERR_RIGHT_SQUARE_EXPECTED, /**< right square expected */ - -#if ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) - PARSER_ERR_RIGHT_BRACE_EXPECTED, /**< right brace expected */ -#endif /* ENABLED (JERRY_ES2015_TEMPLATE_STRINGS) */ - PARSER_ERR_COLON_EXPECTED, /**< colon expected */ - PARSER_ERR_COLON_FOR_CONDITIONAL_EXPECTED, /**< colon expected for conditional expression */ - PARSER_ERR_SEMICOLON_EXPECTED, /**< semicolon expected */ - PARSER_ERR_IN_EXPECTED, /**< in keyword expected */ -#if ENABLED (JERRY_ES2015_FOR_OF) - PARSER_ERR_OF_EXPECTED, /**< of keyword expected */ -#endif /* ENABLED (JERRY_ES2015_FOR_OF) */ - PARSER_ERR_WHILE_EXPECTED, /**< while expected for do-while loop */ - PARSER_ERR_CATCH_FINALLY_EXPECTED, /**< catch or finally expected */ - PARSER_ERR_ARRAY_ITEM_SEPARATOR_EXPECTED, /**< array item separator expected */ - PARSER_ERR_OBJECT_ITEM_SEPARATOR_EXPECTED, /**< object item separator expected */ - PARSER_ERR_IDENTIFIER_EXPECTED, /**< identifier expected */ - PARSER_ERR_EXPRESSION_EXPECTED, /**< expression expected */ - PARSER_ERR_PRIMARY_EXP_EXPECTED, /**< primary expression expected */ - PARSER_ERR_STATEMENT_EXPECTED, /**< statement expected */ - PARSER_ERR_PROPERTY_IDENTIFIER_EXPECTED, /**< property identifier expected */ - PARSER_ERR_ARGUMENT_LIST_EXPECTED, /**< argument list expected */ - PARSER_ERR_NO_ARGUMENTS_EXPECTED, /**< property getters must have no arguments */ - PARSER_ERR_ONE_ARGUMENT_EXPECTED, /**< property setters must have one argument */ - - PARSER_ERR_INVALID_EXPRESSION, /**< invalid expression */ - PARSER_ERR_INVALID_SWITCH, /**< invalid switch body */ - PARSER_ERR_INVALID_BREAK, /**< break must be inside a loop or switch */ - PARSER_ERR_INVALID_BREAK_LABEL, /**< break target not found */ - PARSER_ERR_INVALID_CONTINUE, /**< continue must be inside a loop */ - PARSER_ERR_INVALID_CONTINUE_LABEL, /**< continue target not found */ - PARSER_ERR_INVALID_RETURN, /**< return must be inside a function */ - PARSER_ERR_INVALID_RIGHT_SQUARE, /**< right square must terminate a block */ - PARSER_ERR_DUPLICATED_LABEL, /**< duplicated label */ -#if ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) || ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) - PARSER_ERR_DUPLICATED_ARGUMENT_NAMES, /**< duplicated argument names */ -#endif /* ENABLED (JERRY_ES2015_FUNCTION_PARAMETER_INITIALIZER) || ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) */ -#if ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) - PARSER_ERR_FORMAL_PARAM_AFTER_REST_PARAMETER, /**< formal parameter after rest parameter */ - PARSER_ERR_REST_PARAMETER_DEFAULT_INITIALIZER, /**< rest parameter default initializer */ -#endif /* ENABLED (JERRY_ES2015_FUNCTION_REST_PARAMETER) */ - PARSER_ERR_OBJECT_PROPERTY_REDEFINED, /**< property of object literal redefined */ - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) - PARSER_ERR_FILE_NOT_FOUND, /**< file not found*/ - PARSER_ERR_FROM_EXPECTED, /**< from expected */ - PARSER_ERR_FROM_COMMA_EXPECTED, /**< from or comma expected */ - PARSER_ERR_AS_EXPECTED, /**< as expected */ - PARSER_ERR_STRING_EXPECTED, /**< string literal expected */ - PARSER_ERR_MODULE_UNEXPECTED, /**< unexpected import or export statement */ - PARSER_ERR_LEFT_BRACE_MULTIPLY_LITERAL_EXPECTED, /**< left brace or multiply or literal expected */ - PARSER_ERR_LEFT_BRACE_MULTIPLY_EXPECTED, /**< left brace or multiply expected */ - PARSER_ERR_RIGHT_BRACE_COMMA_EXPECTED, /**< right brace or comma expected */ - PARSER_ERR_DUPLICATED_EXPORT_IDENTIFIER, /**< duplicated export identifier name */ - PARSER_ERR_DUPLICATED_IMPORT_BINDING, /**< duplicated import binding name */ -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - - PARSER_ERR_NON_STRICT_ARG_DEFINITION /**< non-strict argument definition */ -} parser_error_t; - -/** - * Source code line counter type. - */ -typedef uint32_t parser_line_counter_t; - -/** - * Error code location. - */ -typedef struct -{ - parser_error_t error; /**< error code */ - parser_line_counter_t line; /**< line where the error occured */ - parser_line_counter_t column; /**< column where the error occured */ -} parser_error_location_t; - -/* Note: source must be a valid UTF-8 string */ -ecma_value_t parser_parse_script (const uint8_t *arg_list_p, size_t arg_list_size, - const uint8_t *source_p, size_t source_size, - uint32_t parse_opts, ecma_compiled_code_t **bytecode_data_p); - -#if ENABLED (JERRY_ERROR_MESSAGES) -const char *parser_error_to_string (parser_error_t); -#endif /* ENABLED (JERRY_ERROR_MESSAGES) */ - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_PARSER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner-internal.h deleted file mode 100644 index ab1942c03..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner-internal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_SCANNER_INTERNAL_H -#define JS_SCANNER_INTERNAL_H - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_scanner Scanner - * @{ - */ - -/** - * Generic descriptor which stores only the start position. - */ -typedef struct -{ - const uint8_t *source_p; /**< start source byte */ -} scanner_source_start_t; - -/** - * For statement descriptor. - */ -typedef struct -{ - /** shared fields of for statements */ - union - { - const uint8_t *source_p; /**< start source byte */ - scanner_for_info_t *for_info_p; /**< for info */ - } u; -} scanner_for_statement_t; - -/** - * Switch statement descriptor. - */ -typedef struct -{ - scanner_case_info_t **last_case_p; /**< last case info */ -} scanner_switch_statement_t; - -/** - * Scanner context. - */ -typedef struct -{ - uint8_t mode; /**< scanner mode */ - scanner_switch_statement_t active_switch_statement; /**< currently active switch statement */ -} scanner_context_t; - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_SCANNER_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner.h deleted file mode 100644 index b44d0ebb6..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/js-scanner.h +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JS_SCANNER_H -#define JS_SCANNER_H - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup jsparser JavaScript - * @{ - * - * \addtogroup jsparser_scanner Scanner - * @{ - */ - -/** - * Allowed types for scanner_info_t structures. - */ -typedef enum -{ - SCANNER_TYPE_END, /**< mark the last info block */ - SCANNER_TYPE_END_ARGUMENTS, /**< mark the end of function arguments - * (only present if a function script is parsed) */ - SCANNER_TYPE_WHILE, /**< while statement */ - SCANNER_TYPE_FOR, /**< for statement */ - SCANNER_TYPE_FOR_IN, /**< for-in statement */ -#if ENABLED (JERRY_ES2015_FOR_OF) - SCANNER_TYPE_FOR_OF, /**< for-of statement */ -#endif /* ENABLED (JERRY_ES2015_FOR_OF) */ - SCANNER_TYPE_SWITCH, /**< switch statement */ - SCANNER_TYPE_CASE, /**< case statement */ -#if ENABLED (JERRY_ES2015_ARROW_FUNCTION) - SCANNER_TYPE_ARROW, /**< arrow function */ -#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */ -} scanner_info_type_t; - -/** - * Source code location which can be used to change the position of parsing. - */ -typedef struct -{ - const uint8_t *source_p; /**< next source byte */ - parser_line_counter_t line; /**< token start line */ - parser_line_counter_t column; /**< token start column */ -} scanner_location_t; - -/** - * Scanner info blocks which provides information for the parser. - */ -typedef struct scanner_info_t -{ - struct scanner_info_t *next_p; /**< next info structure */ - const uint8_t *source_p; /**< triggering position of this scanner info */ - uint8_t type; /**< type of the scanner info */ -} scanner_info_t; - -/** - * Scanner info extended with a location. - */ -typedef struct -{ - scanner_info_t info; /**< header */ - scanner_location_t location; /**< location */ -} scanner_location_info_t; - -/** - * Scanner info for "for" statements. - */ -typedef struct -{ - scanner_info_t info; /**< header */ - scanner_location_t expression_location; /**< location of expression start */ - scanner_location_t end_location; /**< location of expression end */ -} scanner_for_info_t; - -/** - * Case statement list for scanner_switch_info_t structure. - */ -typedef struct scanner_case_info_t -{ - struct scanner_case_info_t *next_p; /**< next case statement info */ - scanner_location_t location; /**< location of case statement */ -} scanner_case_info_t; - -/** - * Scanner info for "switch" statements. - */ -typedef struct -{ - scanner_info_t info; /**< header */ - scanner_case_info_t *case_p; /**< list of switch cases */ -} scanner_switch_info_t; - -/** - * @} - * @} - * @} - */ - -#endif /* !JS_SCANNER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-char-helpers.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-char-helpers.h deleted file mode 100644 index 08c0439a0..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-char-helpers.h +++ /dev/null @@ -1,247 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef LIT_CHAR_HELPERS_H -#define LIT_CHAR_HELPERS_H - -#include "lit-globals.h" - -#define LIT_CHAR_UNDEF ((ecma_char_t) 0xFFFF) /* undefined character */ - -/* - * Format control characters (ECMA-262 v5, Table 1) - */ -#define LIT_CHAR_ZWNJ ((ecma_char_t) 0x200C) /* zero width non-joiner */ -#define LIT_CHAR_ZWJ ((ecma_char_t) 0x200D) /* zero width joiner */ -#define LIT_CHAR_BOM ((ecma_char_t) 0xFEFF) /* byte order mark */ - -/* - * Whitespace characters (ECMA-262 v5, Table 2) - */ -#define LIT_CHAR_TAB ((ecma_char_t) 0x0009) /* tab */ -#define LIT_CHAR_VTAB ((ecma_char_t) 0x000B) /* vertical tab */ -#define LIT_CHAR_FF ((ecma_char_t) 0x000C) /* form feed */ -#define LIT_CHAR_SP ((ecma_char_t) 0x0020) /* space */ -#define LIT_CHAR_NBSP ((ecma_char_t) 0x00A0) /* no-break space */ -/* LIT_CHAR_BOM is defined above */ - -bool lit_char_is_white_space (ecma_char_t c); - -/* - * Line terminator characters (ECMA-262 v5, Table 3) - */ -#define LIT_CHAR_LF ((ecma_char_t) 0x000A) /* line feed */ -#define LIT_CHAR_CR ((ecma_char_t) 0x000D) /* carriage return */ -#define LIT_CHAR_LS ((ecma_char_t) 0x2028) /* line separator */ -#define LIT_CHAR_PS ((ecma_char_t) 0x2029) /* paragraph separator */ - -bool lit_char_is_line_terminator (ecma_char_t c); - -/* - * String Single Character Escape Sequences (ECMA-262 v5, Table 4) - */ -#define LIT_CHAR_BS ((ecma_char_t) 0x0008) /* backspace */ -/* LIT_CHAR_TAB is defined above */ -/* LIT_CHAR_LF is defined above */ -/* LIT_CHAR_VTAB is defined above */ -/* LIT_CHAR_FF is defined above */ -/* LIT_CHAR_CR is defined above */ -#define LIT_CHAR_DOUBLE_QUOTE ((ecma_char_t) '"') /* double quote */ -#define LIT_CHAR_SINGLE_QUOTE ((ecma_char_t) '\'') /* single quote */ -#define LIT_CHAR_BACKSLASH ((ecma_char_t) '\\') /* reverse solidus (backslash) */ - -/* - * Comment characters (ECMA-262 v5, 7.4) - */ -#define LIT_CHAR_SLASH ((ecma_char_t) '/') /* solidus */ -#define LIT_CHAR_ASTERISK ((ecma_char_t) '*') /* asterisk */ - -/* - * Identifier name characters (ECMA-262 v5, 7.6) - */ -#define LIT_CHAR_DOLLAR_SIGN ((ecma_char_t) '$') /* dollar sign */ -#define LIT_CHAR_UNDERSCORE ((ecma_char_t) '_') /* low line (underscore) */ -/* LIT_CHAR_BACKSLASH defined above */ - -bool lit_char_is_identifier_start (const uint8_t *src_p); -bool lit_char_is_identifier_part (const uint8_t *src_p); -bool lit_char_is_identifier_start_character (ecma_char_t chr); -bool lit_char_is_identifier_part_character (ecma_char_t chr); - -/* - * Punctuator characters (ECMA-262 v5, 7.7) - */ -#define LIT_CHAR_LEFT_BRACE ((ecma_char_t) '{') /* left curly bracket */ -#define LIT_CHAR_RIGHT_BRACE ((ecma_char_t) '}') /* right curly bracket */ -#define LIT_CHAR_LEFT_PAREN ((ecma_char_t) '(') /* left parenthesis */ -#define LIT_CHAR_RIGHT_PAREN ((ecma_char_t) ')') /* right parenthesis */ -#define LIT_CHAR_LEFT_SQUARE ((ecma_char_t) '[') /* left square bracket */ -#define LIT_CHAR_RIGHT_SQUARE ((ecma_char_t) ']') /* right square bracket */ -#define LIT_CHAR_DOT ((ecma_char_t) '.') /* dot */ -#define LIT_CHAR_SEMICOLON ((ecma_char_t) ';') /* semicolon */ -#define LIT_CHAR_COMMA ((ecma_char_t) ',') /* comma */ -#define LIT_CHAR_LESS_THAN ((ecma_char_t) '<') /* less-than sign */ -#define LIT_CHAR_GREATER_THAN ((ecma_char_t) '>') /* greater-than sign */ -#define LIT_CHAR_EQUALS ((ecma_char_t) '=') /* equals sign */ -#define LIT_CHAR_PLUS ((ecma_char_t) '+') /* plus sign */ -#define LIT_CHAR_MINUS ((ecma_char_t) '-') /* hyphen-minus */ -/* LIT_CHAR_ASTERISK is defined above */ -#define LIT_CHAR_PERCENT ((ecma_char_t) '%') /* percent sign */ -#define LIT_CHAR_AMPERSAND ((ecma_char_t) '&') /* ampersand */ -#define LIT_CHAR_VLINE ((ecma_char_t) '|') /* vertical line */ -#define LIT_CHAR_CIRCUMFLEX ((ecma_char_t) '^') /* circumflex accent */ -#define LIT_CHAR_EXCLAMATION ((ecma_char_t) '!') /* exclamation mark */ -#define LIT_CHAR_TILDE ((ecma_char_t) '~') /* tilde */ -#define LIT_CHAR_QUESTION ((ecma_char_t) '?') /* question mark */ -#define LIT_CHAR_COLON ((ecma_char_t) ':') /* colon */ - -/* - * Special characters for String.prototype.replace. - */ -#define LIT_CHAR_GRAVE_ACCENT ((ecma_char_t) '`') /* grave accent */ - -/** - * Uppercase ASCII letters - */ -#define LIT_CHAR_UPPERCASE_A ((ecma_char_t) 'A') -#define LIT_CHAR_UPPERCASE_B ((ecma_char_t) 'B') -#define LIT_CHAR_UPPERCASE_C ((ecma_char_t) 'C') -#define LIT_CHAR_UPPERCASE_D ((ecma_char_t) 'D') -#define LIT_CHAR_UPPERCASE_E ((ecma_char_t) 'E') -#define LIT_CHAR_UPPERCASE_F ((ecma_char_t) 'F') -#define LIT_CHAR_UPPERCASE_G ((ecma_char_t) 'G') -#define LIT_CHAR_UPPERCASE_H ((ecma_char_t) 'H') -#define LIT_CHAR_UPPERCASE_I ((ecma_char_t) 'I') -#define LIT_CHAR_UPPERCASE_J ((ecma_char_t) 'J') -#define LIT_CHAR_UPPERCASE_K ((ecma_char_t) 'K') -#define LIT_CHAR_UPPERCASE_L ((ecma_char_t) 'L') -#define LIT_CHAR_UPPERCASE_M ((ecma_char_t) 'M') -#define LIT_CHAR_UPPERCASE_N ((ecma_char_t) 'N') -#define LIT_CHAR_UPPERCASE_O ((ecma_char_t) 'O') -#define LIT_CHAR_UPPERCASE_P ((ecma_char_t) 'P') -#define LIT_CHAR_UPPERCASE_Q ((ecma_char_t) 'Q') -#define LIT_CHAR_UPPERCASE_R ((ecma_char_t) 'R') -#define LIT_CHAR_UPPERCASE_S ((ecma_char_t) 'S') -#define LIT_CHAR_UPPERCASE_T ((ecma_char_t) 'T') -#define LIT_CHAR_UPPERCASE_U ((ecma_char_t) 'U') -#define LIT_CHAR_UPPERCASE_V ((ecma_char_t) 'V') -#define LIT_CHAR_UPPERCASE_W ((ecma_char_t) 'W') -#define LIT_CHAR_UPPERCASE_X ((ecma_char_t) 'X') -#define LIT_CHAR_UPPERCASE_Y ((ecma_char_t) 'Y') -#define LIT_CHAR_UPPERCASE_Z ((ecma_char_t) 'Z') - -/** - * Lowercase ASCII letters - */ -#define LIT_CHAR_LOWERCASE_A ((ecma_char_t) 'a') -#define LIT_CHAR_LOWERCASE_B ((ecma_char_t) 'b') -#define LIT_CHAR_LOWERCASE_C ((ecma_char_t) 'c') -#define LIT_CHAR_LOWERCASE_D ((ecma_char_t) 'd') -#define LIT_CHAR_LOWERCASE_E ((ecma_char_t) 'e') -#define LIT_CHAR_LOWERCASE_F ((ecma_char_t) 'f') -#define LIT_CHAR_LOWERCASE_G ((ecma_char_t) 'g') -#define LIT_CHAR_LOWERCASE_H ((ecma_char_t) 'h') -#define LIT_CHAR_LOWERCASE_I ((ecma_char_t) 'i') -#define LIT_CHAR_LOWERCASE_J ((ecma_char_t) 'j') -#define LIT_CHAR_LOWERCASE_K ((ecma_char_t) 'k') -#define LIT_CHAR_LOWERCASE_L ((ecma_char_t) 'l') -#define LIT_CHAR_LOWERCASE_M ((ecma_char_t) 'm') -#define LIT_CHAR_LOWERCASE_N ((ecma_char_t) 'n') -#define LIT_CHAR_LOWERCASE_O ((ecma_char_t) 'o') -#define LIT_CHAR_LOWERCASE_P ((ecma_char_t) 'p') -#define LIT_CHAR_LOWERCASE_Q ((ecma_char_t) 'q') -#define LIT_CHAR_LOWERCASE_R ((ecma_char_t) 'r') -#define LIT_CHAR_LOWERCASE_S ((ecma_char_t) 's') -#define LIT_CHAR_LOWERCASE_T ((ecma_char_t) 't') -#define LIT_CHAR_LOWERCASE_U ((ecma_char_t) 'u') -#define LIT_CHAR_LOWERCASE_V ((ecma_char_t) 'v') -#define LIT_CHAR_LOWERCASE_W ((ecma_char_t) 'w') -#define LIT_CHAR_LOWERCASE_X ((ecma_char_t) 'x') -#define LIT_CHAR_LOWERCASE_Y ((ecma_char_t) 'y') -#define LIT_CHAR_LOWERCASE_Z ((ecma_char_t) 'z') - -/** - * ASCII decimal digits - */ -#define LIT_CHAR_0 ((ecma_char_t) '0') -#define LIT_CHAR_1 ((ecma_char_t) '1') -#define LIT_CHAR_2 ((ecma_char_t) '2') -#define LIT_CHAR_3 ((ecma_char_t) '3') -#define LIT_CHAR_4 ((ecma_char_t) '4') -#define LIT_CHAR_5 ((ecma_char_t) '5') -#define LIT_CHAR_6 ((ecma_char_t) '6') -#define LIT_CHAR_7 ((ecma_char_t) '7') -#define LIT_CHAR_8 ((ecma_char_t) '8') -#define LIT_CHAR_9 ((ecma_char_t) '9') - -/** - * ASCII character ranges - */ -#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_BEGIN LIT_CHAR_UPPERCASE_A /* uppercase letters range */ -#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_END LIT_CHAR_UPPERCASE_Z - -#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_BEGIN LIT_CHAR_LOWERCASE_A /* lowercase letters range */ -#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_END LIT_CHAR_LOWERCASE_Z - -#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_BEGIN LIT_CHAR_UPPERCASE_A /* uppercase letters for - * hexadecimal digits range */ -#define LIT_CHAR_ASCII_UPPERCASE_LETTERS_HEX_END LIT_CHAR_UPPERCASE_F - -#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_BEGIN LIT_CHAR_LOWERCASE_A /* lowercase letters for - * hexadecimal digits range */ -#define LIT_CHAR_ASCII_LOWERCASE_LETTERS_HEX_END LIT_CHAR_LOWERCASE_F - -#define LIT_CHAR_ASCII_OCTAL_DIGITS_BEGIN LIT_CHAR_0 /* octal digits range */ -#define LIT_CHAR_ASCII_OCTAL_DIGITS_END LIT_CHAR_7 - -#define LIT_CHAR_ASCII_DIGITS_BEGIN LIT_CHAR_0 /* decimal digits range */ -#define LIT_CHAR_ASCII_DIGITS_END LIT_CHAR_9 - -#define LEXER_TO_ASCII_LOWERCASE(character) ((character) | LIT_CHAR_SP) - -bool lit_char_is_octal_digit (ecma_char_t c); -bool lit_char_is_decimal_digit (ecma_char_t c); -bool lit_char_is_hex_digit (ecma_char_t c); -uint32_t lit_char_hex_to_int (ecma_char_t c); -size_t lit_char_to_utf8_bytes (uint8_t *dst_p, ecma_char_t chr); -size_t lit_char_get_utf8_length (ecma_char_t chr); - -/* read a hex encoded code point from a zero terminated buffer */ -bool lit_read_code_unit_from_hex (const lit_utf8_byte_t *buf_p, lit_utf8_size_t number_of_characters, - ecma_char_t *out_code_unit_p); - -/** - * Null character - */ -#define LIT_CHAR_NULL ((ecma_char_t) '\0') - -/* - * Part of IsWordChar abstract operation (ECMA-262 v5, 15.10.2.6, step 3) - */ -bool lit_char_is_word_char (ecma_char_t c); - -/* - * Utility functions for uppercasing / lowercasing - */ - -/** - * Minimum buffer size for lit_char_to_lower_case / lit_char_to_upper_case functions. - */ -#define LIT_MAXIMUM_OTHER_CASE_LENGTH (3) - -ecma_length_t lit_char_to_lower_case (ecma_char_t character, ecma_char_t *output_buffer_p, ecma_length_t buffer_size); -ecma_length_t lit_char_to_upper_case (ecma_char_t character, ecma_char_t *output_buffer_p, ecma_length_t buffer_size); - -#endif /* !LIT_CHAR_HELPERS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-strings.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-strings.h deleted file mode 100644 index 208108bde..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-strings.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef LIT_STRINGS_H -#define LIT_STRINGS_H - -#include "jrt.h" -#include "lit-globals.h" - -/** - * Null character (used in few cases as utf-8 string end marker) - */ -#define LIT_BYTE_NULL (0) - -/** - * For the formal definition of Unicode transformation formats (UTF) see Section 3.9, Unicode Encoding Forms in The - * Unicode Standard (http://www.unicode.org/versions/Unicode3.0.0/ch03.pdf#G7404). - */ -#define LIT_UNICODE_CODE_POINT_NULL (0x0) -#define LIT_UNICODE_CODE_POINT_MAX (0x10FFFF) - -#define LIT_UTF16_CODE_UNIT_MAX (0xFFFF) -#define LIT_UTF16_FIRST_SURROGATE_CODE_POINT (0x10000) -#define LIT_UTF16_LOW_SURROGATE_MARKER (0xDC00) -#define LIT_UTF16_HIGH_SURROGATE_MARKER (0xD800) -#define LIT_UTF16_HIGH_SURROGATE_MIN (0xD800) -#define LIT_UTF16_HIGH_SURROGATE_MAX (0xDBFF) -#define LIT_UTF16_LOW_SURROGATE_MIN (0xDC00) -#define LIT_UTF16_LOW_SURROGATE_MAX (0xDFFF) -#define LIT_UTF16_BITS_IN_SURROGATE (10) -#define LIT_UTF16_LAST_10_BITS_MASK (0x3FF) - -#define LIT_UTF8_1_BYTE_MARKER (0x00) -#define LIT_UTF8_2_BYTE_MARKER (0xC0) -#define LIT_UTF8_3_BYTE_MARKER (0xE0) -#define LIT_UTF8_4_BYTE_MARKER (0xF0) -#define LIT_UTF8_5_BYTE_MARKER (0xF8) -#define LIT_UTF8_EXTRA_BYTE_MARKER (0x80) - -#define LIT_UTF8_1_BYTE_MASK (0x80) -#define LIT_UTF8_2_BYTE_MASK (0xE0) -#define LIT_UTF8_3_BYTE_MASK (0xF0) -#define LIT_UTF8_4_BYTE_MASK (0xF8) -#define LIT_UTF8_EXTRA_BYTE_MASK (0xC0) - -#define LIT_UTF8_LAST_7_BITS_MASK (0x7F) -#define LIT_UTF8_LAST_6_BITS_MASK (0x3F) -#define LIT_UTF8_LAST_5_BITS_MASK (0x1F) -#define LIT_UTF8_LAST_4_BITS_MASK (0x0F) -#define LIT_UTF8_LAST_3_BITS_MASK (0x07) -#define LIT_UTF8_LAST_2_BITS_MASK (0x03) -#define LIT_UTF8_LAST_1_BIT_MASK (0x01) - -#define LIT_UTF8_BITS_IN_EXTRA_BYTES (6) - -#define LIT_UTF8_1_BYTE_CODE_POINT_MAX (0x7F) -#define LIT_UTF8_2_BYTE_CODE_POINT_MIN (0x80) -#define LIT_UTF8_2_BYTE_CODE_POINT_MAX (0x7FF) -#define LIT_UTF8_3_BYTE_CODE_POINT_MIN (0x800) -#define LIT_UTF8_3_BYTE_CODE_POINT_MAX (LIT_UTF16_CODE_UNIT_MAX) -#define LIT_UTF8_4_BYTE_CODE_POINT_MIN (0x10000) -#define LIT_UTF8_4_BYTE_CODE_POINT_MAX (LIT_UNICODE_CODE_POINT_MAX) - -/** - * Differnce between byte count needed to represent code point greater than 0xFFFF - * in common UTF-8 (4 bytes required) and CESU-8 (6 bytes required) - */ -#define LIT_UTF8_CESU8_SURROGATE_SIZE_DIF (2 * LIT_UTF8_MAX_BYTES_IN_CODE_UNIT - LIT_UTF8_MAX_BYTES_IN_CODE_POINT) - -/** - * Byte values >= LIT_UTF8_FIRST_BYTE_MAX are not allowed in internal strings - */ -#define LIT_UTF8_FIRST_BYTE_MAX LIT_UTF8_5_BYTE_MARKER - -/* validation */ -bool lit_is_valid_utf8_string (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t buf_size); -bool lit_is_valid_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t buf_size); - -/* checks */ -bool lit_is_code_point_utf16_low_surrogate (lit_code_point_t code_point); -bool lit_is_code_point_utf16_high_surrogate (lit_code_point_t code_point); - -/* size */ -lit_utf8_size_t lit_zt_utf8_string_size (const lit_utf8_byte_t *utf8_str_p); -lit_utf8_size_t lit_get_utf8_size_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t cesu8_buf_size); - -/* length */ -ecma_length_t lit_utf8_string_length (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size); -ecma_length_t lit_get_utf8_length_of_cesu8_string (const lit_utf8_byte_t *cesu8_buf_p, lit_utf8_size_t cesu8_buf_size); - -/* hash */ -lit_string_hash_t lit_utf8_string_calc_hash (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size); -lit_string_hash_t lit_utf8_string_hash_combine (lit_string_hash_t hash_basis, const lit_utf8_byte_t *utf8_buf_p, - lit_utf8_size_t utf8_buf_size); - -/* code unit access */ -ecma_char_t lit_utf8_string_code_unit_at (const lit_utf8_byte_t *utf8_buf_p, lit_utf8_size_t utf8_buf_size, - ecma_length_t code_unit_offset); -lit_utf8_size_t lit_get_unicode_char_size_by_utf8_first_byte (const lit_utf8_byte_t first_byte); - -/* conversion */ -lit_utf8_size_t lit_code_unit_to_utf8 (ecma_char_t code_unit, lit_utf8_byte_t *buf_p); -lit_utf8_size_t lit_code_point_to_utf8 (lit_code_point_t code_point, lit_utf8_byte_t *buf); -lit_utf8_size_t lit_code_point_to_cesu8 (lit_code_point_t code_point, lit_utf8_byte_t *buf); -lit_utf8_size_t lit_convert_cesu8_string_to_utf8_string (const lit_utf8_byte_t *cesu8_string, - lit_utf8_size_t cesu8_size, - lit_utf8_byte_t *utf8_string, - lit_utf8_size_t utf8_size); -lit_code_point_t lit_convert_surrogate_pair_to_code_point (ecma_char_t high_surrogate, ecma_char_t low_surrogate); - -bool lit_compare_utf8_strings_relational (const lit_utf8_byte_t *string1_p, lit_utf8_size_t string1_size, - const lit_utf8_byte_t *string2_p, lit_utf8_size_t string2_size); - -/* read code point from buffer */ -lit_utf8_size_t lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, lit_utf8_size_t buf_size, - lit_code_point_t *code_point); - -lit_utf8_size_t lit_read_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p, - ecma_char_t *code_point); - -lit_utf8_size_t lit_read_prev_code_unit_from_utf8 (const lit_utf8_byte_t *buf_p, - ecma_char_t *code_point); - -ecma_char_t lit_utf8_read_next (const lit_utf8_byte_t **buf_p); -ecma_char_t lit_utf8_read_prev (const lit_utf8_byte_t **buf_p); -ecma_char_t lit_utf8_peek_next (const lit_utf8_byte_t *buf_p); -ecma_char_t lit_utf8_peek_prev (const lit_utf8_byte_t *buf_p); -void lit_utf8_incr (const lit_utf8_byte_t **buf_p); -void lit_utf8_decr (const lit_utf8_byte_t **buf_p); - -#endif /* !LIT_STRINGS_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-conversions.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-conversions.inc.h deleted file mode 100644 index 1398597ef..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-conversions.inc.h +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* This file is automatically generated by the gen-unicode.py script - * from UnicodeData-9.0.0.txt and SpecialCasing-9.0.0.txt files. Do not edit! */ - -/* Contains start points of character case ranges (these are bidirectional conversions). */ -static const uint16_t lit_character_case_ranges[] JERRY_ATTR_CONST_DATA = -{ - 0x00c0, 0x00e0, 0x00d8, 0x00f8, 0x0189, 0x0256, 0x01b1, 0x028a, 0x0388, 0x03ad, - 0x038e, 0x03cd, 0x0391, 0x03b1, 0x03a3, 0x03c3, 0x03fd, 0x037b, 0x0400, 0x0450, - 0x0410, 0x0430, 0x0531, 0x0561, 0x10a0, 0x2d00, 0x13a0, 0xab70, 0x13f0, 0x13f8, - 0x1f08, 0x1f00, 0x1f18, 0x1f10, 0x1f28, 0x1f20, 0x1f38, 0x1f30, 0x1f48, 0x1f40, - 0x1f68, 0x1f60, 0x1fb8, 0x1fb0, 0x1fba, 0x1f70, 0x1fc8, 0x1f72, 0x1fd8, 0x1fd0, - 0x1fda, 0x1f76, 0x1fe8, 0x1fe0, 0x1fea, 0x1f7a, 0x1ff8, 0x1f78, 0x1ffa, 0x1f7c, - 0x2160, 0x2170, 0x24b6, 0x24d0, 0x2c00, 0x2c30, 0x2c7e, 0x023f, 0xff21, 0xff41 -}; - -/* Interval lengths of start points in `character_case_ranges` table. */ -static const uint8_t lit_character_case_range_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x0017, 0x0007, 0x0002, 0x0002, 0x0003, 0x0002, 0x0011, 0x0009, 0x0003, 0x0010, - 0x0020, 0x0026, 0x0026, 0x0050, 0x0006, 0x0008, 0x0006, 0x0008, 0x0008, 0x0006, - 0x0008, 0x0002, 0x0002, 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0010, 0x001a, 0x002f, 0x0002, 0x001a -}; - -/* Contains the start points of bidirectional conversion ranges. */ -static const uint16_t lit_character_pair_ranges[] JERRY_ATTR_CONST_DATA = -{ - 0x0100, 0x0132, 0x0139, 0x014a, 0x0179, 0x0182, 0x0187, 0x018b, 0x0191, 0x0198, - 0x01a0, 0x01a7, 0x01ac, 0x01af, 0x01b3, 0x01b8, 0x01bc, 0x01cd, 0x01de, 0x01f4, - 0x01f8, 0x0222, 0x023b, 0x0241, 0x0246, 0x0370, 0x0376, 0x03d8, 0x03f7, 0x03fa, - 0x0460, 0x048a, 0x04c1, 0x04d0, 0x1e00, 0x1ea0, 0x2183, 0x2c60, 0x2c67, 0x2c72, - 0x2c75, 0x2c80, 0x2ceb, 0x2cf2, 0xa640, 0xa680, 0xa722, 0xa732, 0xa779, 0xa77e, - 0xa78b, 0xa790, 0xa796, 0xa7b4 -}; - -/* Interval lengths of start points in `character_pair_ranges` table. */ -static const uint8_t lit_character_pair_range_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x0030, 0x0006, 0x0010, 0x002e, 0x0006, 0x0004, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0006, 0x0002, 0x0002, 0x0002, 0x0004, 0x0002, 0x0002, 0x0010, 0x0012, 0x0002, - 0x0028, 0x0012, 0x0002, 0x0002, 0x000a, 0x0004, 0x0002, 0x0018, 0x0002, 0x0002, - 0x0022, 0x0036, 0x000e, 0x0060, 0x0096, 0x0060, 0x0002, 0x0002, 0x0006, 0x0002, - 0x0002, 0x0064, 0x0004, 0x0002, 0x002e, 0x001c, 0x000e, 0x003e, 0x0004, 0x000a, - 0x0002, 0x0004, 0x0014, 0x0004 -}; - -/* Contains lower/upper case bidirectional conversion pairs. */ -static const uint16_t lit_character_pairs[] JERRY_ATTR_CONST_DATA = -{ - 0x0178, 0x00ff, 0x0181, 0x0253, 0x0186, 0x0254, 0x018e, 0x01dd, 0x018f, 0x0259, - 0x0190, 0x025b, 0x0193, 0x0260, 0x0194, 0x0263, 0x0196, 0x0269, 0x0197, 0x0268, - 0x019c, 0x026f, 0x019d, 0x0272, 0x019f, 0x0275, 0x01a6, 0x0280, 0x01a9, 0x0283, - 0x01ae, 0x0288, 0x01b7, 0x0292, 0x01c4, 0x01c6, 0x01c7, 0x01c9, 0x01ca, 0x01cc, - 0x01f1, 0x01f3, 0x01f6, 0x0195, 0x01f7, 0x01bf, 0x0220, 0x019e, 0x023a, 0x2c65, - 0x023d, 0x019a, 0x023e, 0x2c66, 0x0243, 0x0180, 0x0244, 0x0289, 0x0245, 0x028c, - 0x037f, 0x03f3, 0x0386, 0x03ac, 0x038c, 0x03cc, 0x03cf, 0x03d7, 0x03f9, 0x03f2, - 0x04c0, 0x04cf, 0x10c7, 0x2d27, 0x10cd, 0x2d2d, 0x1f59, 0x1f51, 0x1f5b, 0x1f53, - 0x1f5d, 0x1f55, 0x1f5f, 0x1f57, 0x1fec, 0x1fe5, 0x2132, 0x214e, 0x2c62, 0x026b, - 0x2c63, 0x1d7d, 0x2c64, 0x027d, 0x2c6d, 0x0251, 0x2c6e, 0x0271, 0x2c6f, 0x0250, - 0x2c70, 0x0252, 0xa77d, 0x1d79, 0xa78d, 0x0265, 0xa7aa, 0x0266, 0xa7ab, 0x025c, - 0xa7ac, 0x0261, 0xa7ad, 0x026c, 0xa7ae, 0x026a, 0xa7b0, 0x029e, 0xa7b1, 0x0287, - 0xa7b2, 0x029d, 0xa7b3, 0xab53 -}; - -/* Contains start points of one-to-two uppercase ranges where the second character - * is always the same. - */ -static const uint16_t lit_upper_case_special_ranges[] JERRY_ATTR_CONST_DATA = -{ - 0x1f80, 0x1f08, 0x0399, 0x1f88, 0x1f08, 0x0399, 0x1f90, 0x1f28, 0x0399, 0x1f98, - 0x1f28, 0x0399, 0x1fa0, 0x1f68, 0x0399, 0x1fa8, 0x1f68, 0x0399 -}; - -/* Interval lengths for start points in `upper_case_special_ranges` table. */ -static const uint8_t lit_upper_case_special_range_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007 -}; - -/* Contains start points of lowercase ranges. */ -static const uint16_t lit_lower_case_ranges[] JERRY_ATTR_CONST_DATA = -{ - 0x1e96, 0x1e96, 0x1f80, 0x1f80, 0x1f88, 0x1f80, 0x1f90, 0x1f90, 0x1f98, 0x1f90, - 0x1fa0, 0x1fa0, 0x1fa8, 0x1fa0, 0x1fb2, 0x1fb2, 0x1fb6, 0x1fb6, 0x1fc2, 0x1fc2, - 0x1fc6, 0x1fc6, 0x1fd2, 0x1fd2, 0x1fd6, 0x1fd6, 0x1fe2, 0x1fe2, 0x1fe6, 0x1fe6, - 0x1ff2, 0x1ff2, 0x1ff6, 0x1ff6, 0xfb00, 0xfb00, 0xfb13, 0xfb13 -}; - -/* Interval lengths for start points in `lower_case_ranges` table. */ -static const uint8_t lit_lower_case_range_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x0005, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0003, 0x0002, 0x0003, - 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0003, 0x0002, 0x0007, 0x0005 -}; - -/* The remaining lowercase conversions. The lowercase variant can be one-to-three character long. */ -static const uint16_t lit_lower_case_conversions[] JERRY_ATTR_CONST_DATA = -{ - 0x00df, 0x00df, 0x0149, 0x0149, 0x01c5, 0x01c6, 0x01c8, 0x01c9, 0x01cb, 0x01cc, - 0x01f0, 0x01f0, 0x01f2, 0x01f3, 0x0390, 0x0390, 0x03b0, 0x03b0, 0x03f4, 0x03b8, - 0x0587, 0x0587, 0x1e9e, 0x00df, 0x1f50, 0x1f50, 0x1f52, 0x1f52, 0x1f54, 0x1f54, - 0x1f56, 0x1f56, 0x1fbc, 0x1fb3, 0x1fcc, 0x1fc3, 0x1ffc, 0x1ff3, 0x2126, 0x03c9, - 0x212a, 0x006b, 0x212b, 0x00e5, 0x0130, 0x0069, 0x0307 -}; - -/* Number of one-to-one, one-to-two, and one-to-three lowercase conversions. */ -static const uint8_t lit_lower_case_conversion_counters[] JERRY_ATTR_CONST_DATA = -{ - 0x0016, 0x0001, 0x0000 -}; - -/* The remaining uppercase conversions. The uppercase variant can be one-to-three character long. */ -static const uint16_t lit_upper_case_conversions[] JERRY_ATTR_CONST_DATA = -{ - 0x00b5, 0x039c, 0x0130, 0x0130, 0x0131, 0x0049, 0x017f, 0x0053, 0x01c5, 0x01c4, - 0x01c8, 0x01c7, 0x01cb, 0x01ca, 0x01f2, 0x01f1, 0x0345, 0x0399, 0x03c2, 0x03a3, - 0x03d0, 0x0392, 0x03d1, 0x0398, 0x03d5, 0x03a6, 0x03d6, 0x03a0, 0x03f0, 0x039a, - 0x03f1, 0x03a1, 0x03f5, 0x0395, 0x1c80, 0x0412, 0x1c81, 0x0414, 0x1c82, 0x041e, - 0x1c83, 0x0421, 0x1c84, 0x0422, 0x1c85, 0x0422, 0x1c86, 0x042a, 0x1c87, 0x0462, - 0x1c88, 0xa64a, 0x1e9b, 0x1e60, 0x1fbe, 0x0399, 0x00df, 0x0053, 0x0053, 0x0149, - 0x02bc, 0x004e, 0x01f0, 0x004a, 0x030c, 0x0587, 0x0535, 0x0552, 0x1e96, 0x0048, - 0x0331, 0x1e97, 0x0054, 0x0308, 0x1e98, 0x0057, 0x030a, 0x1e99, 0x0059, 0x030a, - 0x1e9a, 0x0041, 0x02be, 0x1f50, 0x03a5, 0x0313, 0x1f87, 0x1f0f, 0x0399, 0x1f8f, - 0x1f0f, 0x0399, 0x1f97, 0x1f2f, 0x0399, 0x1f9f, 0x1f2f, 0x0399, 0x1fa7, 0x1f6f, - 0x0399, 0x1faf, 0x1f6f, 0x0399, 0x1fb2, 0x1fba, 0x0399, 0x1fb3, 0x0391, 0x0399, - 0x1fb4, 0x0386, 0x0399, 0x1fb6, 0x0391, 0x0342, 0x1fbc, 0x0391, 0x0399, 0x1fc2, - 0x1fca, 0x0399, 0x1fc3, 0x0397, 0x0399, 0x1fc4, 0x0389, 0x0399, 0x1fc6, 0x0397, - 0x0342, 0x1fcc, 0x0397, 0x0399, 0x1fd6, 0x0399, 0x0342, 0x1fe4, 0x03a1, 0x0313, - 0x1fe6, 0x03a5, 0x0342, 0x1ff2, 0x1ffa, 0x0399, 0x1ff3, 0x03a9, 0x0399, 0x1ff4, - 0x038f, 0x0399, 0x1ff6, 0x03a9, 0x0342, 0x1ffc, 0x03a9, 0x0399, 0xfb00, 0x0046, - 0x0046, 0xfb01, 0x0046, 0x0049, 0xfb02, 0x0046, 0x004c, 0xfb05, 0x0053, 0x0054, - 0xfb06, 0x0053, 0x0054, 0xfb13, 0x0544, 0x0546, 0xfb14, 0x0544, 0x0535, 0xfb15, - 0x0544, 0x053b, 0xfb16, 0x054e, 0x0546, 0xfb17, 0x0544, 0x053d, 0x0390, 0x0399, - 0x0308, 0x0301, 0x03b0, 0x03a5, 0x0308, 0x0301, 0x1f52, 0x03a5, 0x0313, 0x0300, - 0x1f54, 0x03a5, 0x0313, 0x0301, 0x1f56, 0x03a5, 0x0313, 0x0342, 0x1fb7, 0x0391, - 0x0342, 0x0399, 0x1fc7, 0x0397, 0x0342, 0x0399, 0x1fd2, 0x0399, 0x0308, 0x0300, - 0x1fd3, 0x0399, 0x0308, 0x0301, 0x1fd7, 0x0399, 0x0308, 0x0342, 0x1fe2, 0x03a5, - 0x0308, 0x0300, 0x1fe3, 0x03a5, 0x0308, 0x0301, 0x1fe7, 0x03a5, 0x0308, 0x0342, - 0x1ff7, 0x03a9, 0x0342, 0x0399, 0xfb03, 0x0046, 0x0046, 0x0049, 0xfb04, 0x0046, - 0x0046, 0x004c -}; - -/* Number of one-to-one, one-to-two, and one-to-three uppercase conversions. */ -static const uint8_t lit_upper_case_conversion_counters[] JERRY_ATTR_CONST_DATA = -{ - 0x001c, 0x002c, 0x0010 -}; diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-ranges.inc.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-ranges.inc.h deleted file mode 100644 index 1749feaf6..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/lit-unicode-ranges.inc.h +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -/* This file is automatically generated by the gen-unicode.py script - * from UnicodeData-9.0.0.txt. Do not edit! */ - -/** - * Character interval starting points for the unicode letters. - * - * The characters covered by these intervals are from - * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl - */ -static const uint16_t lit_unicode_letter_interval_sps[] JERRY_ATTR_CONST_DATA = -{ - 0x00c0, 0x00d8, 0x00f8, 0x01f8, 0x02c6, 0x02e0, 0x0370, 0x0376, 0x037a, 0x0388, - 0x038e, 0x03a3, 0x03f7, 0x048a, 0x0531, 0x0561, 0x05d0, 0x05f0, 0x0620, 0x066e, - 0x0671, 0x06e5, 0x06ee, 0x06fa, 0x0712, 0x074d, 0x07ca, 0x07f4, 0x0800, 0x0840, - 0x08a0, 0x08b6, 0x0904, 0x0958, 0x0971, 0x0985, 0x098f, 0x0993, 0x09aa, 0x09b6, - 0x09dc, 0x09df, 0x09f0, 0x0a05, 0x0a0f, 0x0a13, 0x0a2a, 0x0a32, 0x0a35, 0x0a38, - 0x0a59, 0x0a72, 0x0a85, 0x0a8f, 0x0a93, 0x0aaa, 0x0ab2, 0x0ab5, 0x0ae0, 0x0b05, - 0x0b0f, 0x0b13, 0x0b2a, 0x0b32, 0x0b35, 0x0b5c, 0x0b5f, 0x0b85, 0x0b8e, 0x0b92, - 0x0b99, 0x0b9e, 0x0ba3, 0x0ba8, 0x0bae, 0x0c05, 0x0c0e, 0x0c12, 0x0c2a, 0x0c58, - 0x0c60, 0x0c85, 0x0c8e, 0x0c92, 0x0caa, 0x0cb5, 0x0ce0, 0x0cf1, 0x0d05, 0x0d0e, - 0x0d12, 0x0d54, 0x0d5f, 0x0d7a, 0x0d85, 0x0d9a, 0x0db3, 0x0dc0, 0x0e01, 0x0e32, - 0x0e40, 0x0e81, 0x0e87, 0x0e94, 0x0e99, 0x0ea1, 0x0eaa, 0x0ead, 0x0eb2, 0x0ec0, - 0x0edc, 0x0f40, 0x0f49, 0x0f88, 0x1000, 0x1050, 0x105a, 0x1065, 0x106e, 0x1075, - 0x10a0, 0x10d0, 0x10fc, 0x11fc, 0x124a, 0x1250, 0x125a, 0x1260, 0x128a, 0x1290, - 0x12b2, 0x12b8, 0x12c2, 0x12c8, 0x12d8, 0x1312, 0x1318, 0x1380, 0x13a0, 0x13f8, - 0x1401, 0x1501, 0x1601, 0x166f, 0x1681, 0x16a0, 0x16ee, 0x1700, 0x170e, 0x1720, - 0x1740, 0x1760, 0x176e, 0x1780, 0x1820, 0x1880, 0x1887, 0x18b0, 0x1900, 0x1950, - 0x1970, 0x1980, 0x19b0, 0x1a00, 0x1a20, 0x1b05, 0x1b45, 0x1b83, 0x1bae, 0x1bba, - 0x1c00, 0x1c4d, 0x1c5a, 0x1c80, 0x1ce9, 0x1cee, 0x1cf5, 0x1d00, 0x1e00, 0x1f00, - 0x1f18, 0x1f20, 0x1f48, 0x1f50, 0x1f5f, 0x1f80, 0x1fb6, 0x1fc2, 0x1fc6, 0x1fd0, - 0x1fd6, 0x1fe0, 0x1ff2, 0x1ff6, 0x2090, 0x210a, 0x2119, 0x212a, 0x212f, 0x213c, - 0x2145, 0x2160, 0x2c00, 0x2c30, 0x2c60, 0x2ceb, 0x2cf2, 0x2d00, 0x2d30, 0x2d80, - 0x2da0, 0x2da8, 0x2db0, 0x2db8, 0x2dc0, 0x2dc8, 0x2dd0, 0x2dd8, 0x3005, 0x3021, - 0x3031, 0x3038, 0x3041, 0x309d, 0x30a1, 0x30fc, 0x3105, 0x3131, 0x31a0, 0x31f0, - 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3a00, 0x3b00, 0x3c00, 0x3d00, - 0x3e00, 0x3f00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, - 0x4800, 0x4900, 0x4a00, 0x4b00, 0x4c00, 0x4d00, 0x4e00, 0x4f00, 0x5000, 0x5100, - 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5a00, 0x5b00, - 0x5c00, 0x5d00, 0x5e00, 0x5f00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, - 0x6600, 0x6700, 0x6800, 0x6900, 0x6a00, 0x6b00, 0x6c00, 0x6d00, 0x6e00, 0x6f00, - 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, - 0x7a00, 0x7b00, 0x7c00, 0x7d00, 0x7e00, 0x7f00, 0x8000, 0x8100, 0x8200, 0x8300, - 0x8400, 0x8500, 0x8600, 0x8700, 0x8800, 0x8900, 0x8a00, 0x8b00, 0x8c00, 0x8d00, - 0x8e00, 0x8f00, 0x9000, 0x9100, 0x9200, 0x9300, 0x9400, 0x9500, 0x9600, 0x9700, - 0x9800, 0x9900, 0x9a00, 0x9b00, 0x9c00, 0x9d00, 0x9e00, 0x9f00, 0xa000, 0xa100, - 0xa200, 0xa300, 0xa400, 0xa4d0, 0xa500, 0xa600, 0xa610, 0xa62a, 0xa640, 0xa67f, - 0xa6a0, 0xa717, 0xa722, 0xa78b, 0xa7b0, 0xa7f7, 0xa803, 0xa807, 0xa80c, 0xa840, - 0xa882, 0xa8f2, 0xa90a, 0xa930, 0xa960, 0xa984, 0xa9e0, 0xa9e6, 0xa9fa, 0xaa00, - 0xaa40, 0xaa44, 0xaa60, 0xaa7e, 0xaab5, 0xaab9, 0xaadb, 0xaae0, 0xaaf2, 0xab01, - 0xab09, 0xab11, 0xab20, 0xab28, 0xab30, 0xab5c, 0xab70, 0xac00, 0xad00, 0xae00, - 0xaf00, 0xb000, 0xb100, 0xb200, 0xb300, 0xb400, 0xb500, 0xb600, 0xb700, 0xb800, - 0xb900, 0xba00, 0xbb00, 0xbc00, 0xbd00, 0xbe00, 0xbf00, 0xc000, 0xc100, 0xc200, - 0xc300, 0xc400, 0xc500, 0xc600, 0xc700, 0xc800, 0xc900, 0xca00, 0xcb00, 0xcc00, - 0xcd00, 0xce00, 0xcf00, 0xd000, 0xd100, 0xd200, 0xd300, 0xd400, 0xd500, 0xd600, - 0xd700, 0xd7b0, 0xd7cb, 0xf900, 0xfa00, 0xfa70, 0xfb00, 0xfb13, 0xfb1f, 0xfb2a, - 0xfb38, 0xfb40, 0xfb43, 0xfb46, 0xfbd3, 0xfcd3, 0xfd50, 0xfd92, 0xfdf0, 0xfe70, - 0xfe76, 0xff21, 0xff41, 0xff66, 0xffc2, 0xffca, 0xffd2, 0xffda -}; - -/** - * Character lengths for the unicode letters. - * - * The characters covered by these intervals are from - * the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl - */ -static const uint8_t lit_unicode_letter_interval_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x0016, 0x001e, 0x00ff, 0x00c9, 0x000b, 0x0004, 0x0004, 0x0001, 0x0003, 0x0002, - 0x0013, 0x0052, 0x008a, 0x00a5, 0x0025, 0x0026, 0x001a, 0x0002, 0x002a, 0x0001, - 0x0062, 0x0001, 0x0001, 0x0002, 0x001d, 0x0058, 0x0020, 0x0001, 0x0015, 0x0018, - 0x0014, 0x0007, 0x0035, 0x0009, 0x000f, 0x0007, 0x0001, 0x0015, 0x0006, 0x0003, - 0x0001, 0x0002, 0x0001, 0x0005, 0x0001, 0x0015, 0x0006, 0x0001, 0x0001, 0x0001, - 0x0003, 0x0002, 0x0008, 0x0002, 0x0015, 0x0006, 0x0001, 0x0004, 0x0001, 0x0007, - 0x0001, 0x0015, 0x0006, 0x0001, 0x0004, 0x0001, 0x0002, 0x0005, 0x0002, 0x0003, - 0x0001, 0x0001, 0x0001, 0x0002, 0x000b, 0x0007, 0x0002, 0x0016, 0x000f, 0x0002, - 0x0001, 0x0007, 0x0002, 0x0016, 0x0009, 0x0004, 0x0001, 0x0001, 0x0007, 0x0002, - 0x0028, 0x0002, 0x0002, 0x0005, 0x0011, 0x0017, 0x0008, 0x0006, 0x002f, 0x0001, - 0x0006, 0x0001, 0x0001, 0x0003, 0x0006, 0x0002, 0x0001, 0x0003, 0x0001, 0x0004, - 0x0003, 0x0007, 0x0023, 0x0004, 0x002a, 0x0005, 0x0003, 0x0001, 0x0002, 0x000c, - 0x0025, 0x002a, 0x00ff, 0x004c, 0x0003, 0x0006, 0x0003, 0x0028, 0x0003, 0x0020, - 0x0003, 0x0006, 0x0003, 0x000e, 0x0038, 0x0003, 0x0042, 0x000f, 0x0055, 0x0005, - 0x00ff, 0x00ff, 0x006b, 0x0010, 0x0019, 0x004a, 0x000a, 0x000c, 0x0003, 0x0011, - 0x0011, 0x000c, 0x0002, 0x0033, 0x0057, 0x0004, 0x0021, 0x0045, 0x001e, 0x001d, - 0x0004, 0x002b, 0x0019, 0x0016, 0x0034, 0x002e, 0x0006, 0x001d, 0x0001, 0x002b, - 0x0023, 0x0002, 0x0023, 0x0008, 0x0003, 0x0003, 0x0001, 0x00bf, 0x00ff, 0x0015, - 0x0005, 0x0025, 0x0005, 0x0007, 0x001e, 0x0034, 0x0006, 0x0002, 0x0006, 0x0003, - 0x0005, 0x000c, 0x0002, 0x0006, 0x000c, 0x0009, 0x0004, 0x0003, 0x000a, 0x0003, - 0x0004, 0x0028, 0x002e, 0x002e, 0x0084, 0x0003, 0x0001, 0x0025, 0x0037, 0x0016, - 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0008, - 0x0004, 0x0004, 0x0055, 0x0002, 0x0059, 0x0003, 0x0028, 0x005d, 0x001a, 0x000f, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00b5, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00d5, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x008c, 0x002d, 0x00ff, 0x000c, 0x000f, 0x0001, 0x002e, 0x001e, - 0x004f, 0x0008, 0x0066, 0x0023, 0x0007, 0x000a, 0x0002, 0x0003, 0x0016, 0x0033, - 0x0031, 0x0005, 0x001b, 0x0016, 0x001c, 0x002e, 0x0004, 0x0009, 0x0004, 0x0028, - 0x0002, 0x0007, 0x0016, 0x0031, 0x0001, 0x0004, 0x0002, 0x000a, 0x0002, 0x0005, - 0x0005, 0x0005, 0x0006, 0x0006, 0x002a, 0x0009, 0x0072, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, 0x00ff, - 0x00a3, 0x0016, 0x0030, 0x00ff, 0x006d, 0x0069, 0x0006, 0x0004, 0x0009, 0x000c, - 0x0004, 0x0001, 0x0001, 0x006b, 0x00ff, 0x006a, 0x003f, 0x0035, 0x000b, 0x0004, - 0x0086, 0x0019, 0x0019, 0x0058, 0x0005, 0x0005, 0x0005, 0x0002 -}; - -/** - * Those unicode letter characters that are not inside any of - * the intervals specified in lit_unicode_letter_interval_sps array. - * - * The characters are from the following Unicode categories: - * Lu, Ll, Lt, Lm, Lo, Nl - */ -static const uint16_t lit_unicode_letter_chars[] JERRY_ATTR_CONST_DATA = -{ - 0x00aa, 0x00b5, 0x00ba, 0x02ec, 0x02ee, 0x037f, 0x0386, 0x038c, 0x0559, 0x06d5, - 0x06ff, 0x0710, 0x07b1, 0x07fa, 0x081a, 0x0824, 0x0828, 0x093d, 0x0950, 0x09b2, - 0x09bd, 0x09ce, 0x0a5e, 0x0abd, 0x0ad0, 0x0af9, 0x0b3d, 0x0b71, 0x0b83, 0x0b9c, - 0x0bd0, 0x0c3d, 0x0c80, 0x0cbd, 0x0cde, 0x0d3d, 0x0d4e, 0x0dbd, 0x0e84, 0x0e8a, - 0x0e8d, 0x0ea5, 0x0ea7, 0x0ebd, 0x0ec6, 0x0f00, 0x103f, 0x1061, 0x108e, 0x10c7, - 0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1f59, 0x1f5b, 0x1f5d, - 0x1fbe, 0x2071, 0x207f, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x214e, - 0x2d27, 0x2d2d, 0x2d6f, 0x2e2f, 0x3400, 0x4e00, 0xa8fb, 0xa8fd, 0xa9cf, 0xaa7a, - 0xaab1, 0xaac0, 0xaac2, 0xac00, 0xfb1d, 0xfb3e -}; - -/** - * Character interval starting points for non-letter character - * that can be used as a non-first character of an identifier. - * - * The characters covered by these intervals are from - * the following Unicode categories: Nd, Mn, Mc, Pc - */ -static const uint16_t lit_unicode_non_letter_ident_part_interval_sps[] JERRY_ATTR_CONST_DATA = -{ - 0x0300, 0x0483, 0x0591, 0x05c1, 0x05c4, 0x0610, 0x064b, 0x06d6, 0x06df, 0x06e7, - 0x06ea, 0x06f0, 0x0730, 0x07a6, 0x07c0, 0x07eb, 0x0816, 0x081b, 0x0825, 0x0829, - 0x0859, 0x08d4, 0x08e3, 0x093a, 0x093e, 0x0951, 0x0962, 0x0966, 0x0981, 0x09be, - 0x09c7, 0x09cb, 0x09e2, 0x09e6, 0x0a01, 0x0a3e, 0x0a47, 0x0a4b, 0x0a66, 0x0a81, - 0x0abe, 0x0ac7, 0x0acb, 0x0ae2, 0x0ae6, 0x0b01, 0x0b3e, 0x0b47, 0x0b4b, 0x0b56, - 0x0b62, 0x0b66, 0x0bbe, 0x0bc6, 0x0bca, 0x0be6, 0x0c00, 0x0c3e, 0x0c46, 0x0c4a, - 0x0c55, 0x0c62, 0x0c66, 0x0c81, 0x0cbe, 0x0cc6, 0x0cca, 0x0cd5, 0x0ce2, 0x0ce6, - 0x0d01, 0x0d3e, 0x0d46, 0x0d4a, 0x0d62, 0x0d66, 0x0d82, 0x0dcf, 0x0dd8, 0x0de6, - 0x0df2, 0x0e34, 0x0e47, 0x0e50, 0x0eb4, 0x0ebb, 0x0ec8, 0x0ed0, 0x0f18, 0x0f20, - 0x0f3e, 0x0f71, 0x0f86, 0x0f8d, 0x0f99, 0x102b, 0x1040, 0x1056, 0x105e, 0x1062, - 0x1067, 0x1071, 0x1082, 0x108f, 0x135d, 0x1712, 0x1732, 0x1752, 0x1772, 0x17b4, - 0x17e0, 0x180b, 0x1810, 0x1885, 0x1920, 0x1930, 0x1946, 0x19d0, 0x1a17, 0x1a55, - 0x1a60, 0x1a7f, 0x1a90, 0x1ab0, 0x1b00, 0x1b34, 0x1b50, 0x1b6b, 0x1b80, 0x1ba1, - 0x1bb0, 0x1be6, 0x1c24, 0x1c40, 0x1c50, 0x1cd0, 0x1cd4, 0x1cf2, 0x1cf8, 0x1dc0, - 0x1dfb, 0x203f, 0x20d0, 0x20e5, 0x2cef, 0x2de0, 0x302a, 0x3099, 0xa620, 0xa674, - 0xa69e, 0xa6f0, 0xa823, 0xa880, 0xa8b4, 0xa8d0, 0xa8e0, 0xa900, 0xa926, 0xa947, - 0xa980, 0xa9b3, 0xa9d0, 0xa9f0, 0xaa29, 0xaa4c, 0xaa50, 0xaa7b, 0xaab2, 0xaab7, - 0xaabe, 0xaaeb, 0xaaf5, 0xabe3, 0xabec, 0xabf0, 0xfe00, 0xfe20, 0xfe33, 0xfe4d, - 0xff10 -}; - -/** - * Character interval lengths for non-letter character - * that can be used as a non-first character of an identifier. - * - * The characters covered by these intervals are from - * the following Unicode categories: Nd, Mn, Mc, Pc - */ -static const uint8_t lit_unicode_non_letter_ident_part_interval_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x006f, 0x0004, 0x002c, 0x0001, 0x0001, 0x000a, 0x001e, 0x0006, 0x0005, 0x0001, - 0x0003, 0x0009, 0x001a, 0x000a, 0x0009, 0x0008, 0x0003, 0x0008, 0x0002, 0x0004, - 0x0002, 0x000d, 0x0020, 0x0002, 0x0011, 0x0006, 0x0001, 0x0009, 0x0002, 0x0006, - 0x0001, 0x0002, 0x0001, 0x0009, 0x0002, 0x0004, 0x0001, 0x0002, 0x000b, 0x0002, - 0x0007, 0x0002, 0x0002, 0x0001, 0x0009, 0x0002, 0x0006, 0x0001, 0x0002, 0x0001, - 0x0001, 0x0009, 0x0004, 0x0002, 0x0003, 0x0009, 0x0003, 0x0006, 0x0002, 0x0003, - 0x0001, 0x0001, 0x0009, 0x0002, 0x0006, 0x0002, 0x0003, 0x0001, 0x0001, 0x0009, - 0x0002, 0x0006, 0x0002, 0x0003, 0x0001, 0x0009, 0x0001, 0x0005, 0x0007, 0x0009, - 0x0001, 0x0006, 0x0007, 0x0009, 0x0005, 0x0001, 0x0005, 0x0009, 0x0001, 0x0009, - 0x0001, 0x0013, 0x0001, 0x000a, 0x0023, 0x0013, 0x0009, 0x0003, 0x0002, 0x0002, - 0x0006, 0x0003, 0x000b, 0x000e, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x001f, - 0x0009, 0x0002, 0x0009, 0x0001, 0x000b, 0x000b, 0x0009, 0x0009, 0x0004, 0x0009, - 0x001c, 0x000a, 0x0009, 0x000d, 0x0004, 0x0010, 0x0009, 0x0008, 0x0002, 0x000c, - 0x0009, 0x000d, 0x0013, 0x0009, 0x0009, 0x0002, 0x0014, 0x0002, 0x0001, 0x0035, - 0x0004, 0x0001, 0x000c, 0x000b, 0x0002, 0x001f, 0x0005, 0x0001, 0x0009, 0x0009, - 0x0001, 0x0001, 0x0004, 0x0001, 0x0011, 0x0009, 0x0011, 0x0009, 0x0007, 0x000c, - 0x0003, 0x000d, 0x0009, 0x0009, 0x000d, 0x0001, 0x0009, 0x0002, 0x0002, 0x0001, - 0x0001, 0x0004, 0x0001, 0x0007, 0x0001, 0x0009, 0x000f, 0x000f, 0x0001, 0x0002, - 0x0009 -}; - -/** - * Those non-letter characters that can be used as a non-first - * character of an identifier and not included in any of the intervals - * specified in lit_unicode_non_letter_ident_part_interval_sps array. - * - * The characters are from the following Unicode categories: - * Nd, Mn, Mc, Pc - */ -static const uint16_t lit_unicode_non_letter_ident_part_chars[] JERRY_ATTR_CONST_DATA = -{ - 0x05bf, 0x05c7, 0x0670, 0x0711, 0x09bc, 0x09d7, 0x0a3c, 0x0a51, 0x0a75, 0x0abc, - 0x0b3c, 0x0b82, 0x0bd7, 0x0cbc, 0x0d57, 0x0dca, 0x0dd6, 0x0e31, 0x0eb1, 0x0f35, - 0x0f37, 0x0f39, 0x0fc6, 0x17dd, 0x18a9, 0x1ced, 0x2054, 0x20e1, 0x2d7f, 0xa66f, - 0xa802, 0xa806, 0xa80b, 0xa9e5, 0xaa43, 0xaab0, 0xaac1, 0xfb1e, 0xff3f -}; - -/** - * Unicode separator character interval starting points from Unicode category: Zs - */ -static const uint16_t lit_unicode_separator_char_interval_sps[] JERRY_ATTR_CONST_DATA = -{ - 0x2000 -}; - -/** - * Unicode separator character interval lengths from Unicode category: Zs - */ -static const uint8_t lit_unicode_separator_char_interval_lengths[] JERRY_ATTR_CONST_DATA = -{ - 0x000b -}; - -/** - * Unicode separator characters that are not in the - * lit_unicode_separator_char_intervals array. - * - * Unicode category: Zs - */ -static const uint16_t lit_unicode_separator_chars[] JERRY_ATTR_CONST_DATA = -{ - 0x1680, 0x180e, 0x202f, 0x205f, 0x3000 -}; diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/opcodes.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/opcodes.h deleted file mode 100644 index faafba7c7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/opcodes.h +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef OPCODES_H -#define OPCODES_H - -#include "ecma-globals.h" -#include "vm-defines.h" - -/** \addtogroup vm Virtual machine - * @{ - * - * \addtogroup vm_opcodes Opcodes - * @{ - */ - -/** - * Number arithmetic operations. - */ -typedef enum -{ - NUMBER_ARITHMETIC_SUBSTRACTION, /**< substraction */ - NUMBER_ARITHMETIC_MULTIPLICATION, /**< multiplication */ - NUMBER_ARITHMETIC_DIVISION, /**< division */ - NUMBER_ARITHMETIC_REMAINDER, /**< remainder calculation */ -} number_arithmetic_op; - -/** - * Number bitwise logic operations. - */ -typedef enum -{ - NUMBER_BITWISE_LOGIC_AND, /**< bitwise AND calculation */ - NUMBER_BITWISE_LOGIC_OR, /**< bitwise OR calculation */ - NUMBER_BITWISE_LOGIC_XOR, /**< bitwise XOR calculation */ - NUMBER_BITWISE_SHIFT_LEFT, /**< bitwise LEFT SHIFT calculation */ - NUMBER_BITWISE_SHIFT_RIGHT, /**< bitwise RIGHT_SHIFT calculation */ - NUMBER_BITWISE_SHIFT_URIGHT, /**< bitwise UNSIGNED RIGHT SHIFT calculation */ - NUMBER_BITWISE_NOT, /**< bitwise NOT calculation */ -} number_bitwise_logic_op; - -ecma_value_t -vm_var_decl (vm_frame_ctx_t *frame_ctx_p, ecma_string_t *var_name_str_p); - -ecma_value_t -opfunc_equality (ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -do_number_arithmetic (number_arithmetic_op op, ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -opfunc_unary_operation (ecma_value_t left_value, bool is_plus); - -ecma_value_t -do_number_bitwise_logic (number_bitwise_logic_op op, ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -opfunc_addition (ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -opfunc_relation (ecma_value_t left_value, ecma_value_t right_value, bool left_first, bool is_invert); - -ecma_value_t -opfunc_in (ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value); - -ecma_value_t -opfunc_typeof (ecma_value_t left_value); - -void -opfunc_set_accessor (bool is_getter, ecma_value_t object, ecma_string_t *accessor_name_p, ecma_value_t accessor); - -ecma_value_t -vm_op_delete_prop (ecma_value_t object, ecma_value_t property, bool is_strict); - -ecma_value_t -vm_op_delete_var (ecma_value_t name_literal, ecma_object_t *lex_env_p); - -ecma_collection_t * -opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p); - -/** - * @} - * @} - */ - -#endif /* !OPCODES_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-bytecode.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-bytecode.h deleted file mode 100644 index 715170bb1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-bytecode.h +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef RE_BYTECODE_H -#define RE_BYTECODE_H - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -#include "ecma-globals.h" - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup regexparser Regular expression - * @{ - * - * \addtogroup regexparser_bytecode Bytecode - * @{ - */ - -/** - * Size of the RegExp bytecode cache - */ -#define RE_CACHE_SIZE 8u - -/** - * RegExp flags mask (first 10 bits are for reference count and the rest for the actual RegExp flags) - */ -#define RE_FLAGS_MASK 0x3F - -/** - * RegExp opcodes - */ -typedef enum -{ - RE_OP_EOF, - /* Group opcode order is important, because RE_IS_CAPTURE_GROUP is based on it. - * Change it carefully. Capture opcodes should be at first. - */ - RE_OP_CAPTURE_GROUP_START, /**< group start */ - RE_OP_CAPTURE_GREEDY_ZERO_GROUP_START, /**< greedy zero group start */ - RE_OP_CAPTURE_NON_GREEDY_ZERO_GROUP_START, /**< non-greedy zero group start */ - RE_OP_CAPTURE_GREEDY_GROUP_END, /**< greedy group end */ - RE_OP_CAPTURE_NON_GREEDY_GROUP_END, /**< non-greedy group end */ - RE_OP_NON_CAPTURE_GROUP_START, /**< non-capture group start */ - RE_OP_NON_CAPTURE_GREEDY_ZERO_GROUP_START, /**< non-capture greedy zero group start */ - RE_OP_NON_CAPTURE_NON_GREEDY_ZERO_GROUP_START, /**< non-capture non-greedy zero group start */ - RE_OP_NON_CAPTURE_GREEDY_GROUP_END, /**< non-capture greedy group end */ - RE_OP_NON_CAPTURE_NON_GREEDY_GROUP_END, /**< non-capture non-greedy group end */ - - RE_OP_MATCH, /**< match */ - RE_OP_CHAR, /**< any character */ - RE_OP_SAVE_AT_START, /**< save at start */ - RE_OP_SAVE_AND_MATCH, /**< save and match */ - RE_OP_PERIOD, /**< "." */ - RE_OP_ALTERNATIVE, /**< "|" */ - RE_OP_GREEDY_ITERATOR, /**< greedy iterator */ - RE_OP_NON_GREEDY_ITERATOR, /**< non-greedy iterator */ - RE_OP_ASSERT_START, /**< "^" */ - RE_OP_ASSERT_END, /**< "$" */ - RE_OP_ASSERT_WORD_BOUNDARY, /**< "\b" */ - RE_OP_ASSERT_NOT_WORD_BOUNDARY, /**< "\B" */ - RE_OP_LOOKAHEAD_POS, /**< lookahead pos */ - RE_OP_LOOKAHEAD_NEG, /**< lookahead neg */ - RE_OP_BACKREFERENCE, /**< "\[0..9]" */ - RE_OP_CHAR_CLASS, /**< "[ ]" */ - RE_OP_INV_CHAR_CLASS /**< "[^ ]" */ -} re_opcode_t; - -/** - * Compiled byte code data. - */ -typedef struct -{ - ecma_compiled_code_t header; /**< compiled code header */ - ecma_value_t source; /**< original RegExp pattern */ - uint32_t captures_count; /**< number of capturing brackets */ - uint32_t non_captures_count; /**< number of non capturing brackets */ -} re_compiled_code_t; - -/** - * Context of RegExp bytecode container - */ -typedef struct -{ - uint8_t *block_start_p; /**< start of bytecode block */ - uint8_t *block_end_p; /**< end of bytecode block */ - uint8_t *current_p; /**< current position in bytecode */ -} re_bytecode_ctx_t; - -re_opcode_t re_get_opcode (const uint8_t **bc_p); -ecma_char_t re_get_char (const uint8_t **bc_p); -uint32_t re_get_value (const uint8_t **bc_p); -uint32_t JERRY_ATTR_PURE re_get_bytecode_length (re_bytecode_ctx_t *bc_ctx_p); - -void re_initialize_regexp_bytecode (re_bytecode_ctx_t *bc_ctx_p); - -void re_append_opcode (re_bytecode_ctx_t *bc_ctx_p, const re_opcode_t opcode); -void re_append_u32 (re_bytecode_ctx_t *bc_ctx_p, const uint32_t value); -void re_append_char (re_bytecode_ctx_t *bc_ctx_p, const ecma_char_t input_char); -void re_append_jump_offset (re_bytecode_ctx_t *bc_ctx_p, uint32_t value); - -void re_insert_opcode (re_bytecode_ctx_t *bc_ctx_p, const uint32_t offset, const re_opcode_t opcode); -void re_insert_u32 (re_bytecode_ctx_t *bc_ctx_p, const uint32_t offset, const uint32_t value); -void re_bytecode_list_insert (re_bytecode_ctx_t *bc_ctx_p, - const size_t offset, - const uint8_t *bytecode_p, - const size_t length); - -#if ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE) -void re_dump_bytecode (re_bytecode_ctx_t *bc_ctx); -#endif /* ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE) */ - -/** - * @} - * @} - * @} - */ - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ -#endif /* !RE_BYTECODE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-compiler.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-compiler.h deleted file mode 100644 index 8dd2a72e1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-compiler.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef RE_COMPILER_H -#define RE_COMPILER_H - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -#include "ecma-globals.h" -#include "re-bytecode.h" -#include "re-parser.h" - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup regexparser Regular expression - * @{ - * - * \addtogroup regexparser_compiler Compiler - * @{ - */ - -/** - * Context of RegExp compiler - */ -typedef struct -{ - uint16_t flags; /**< RegExp flags */ - uint32_t captures_count; /**< number of capture groups */ - uint32_t non_captures_count; /**< number of non-capture groups */ - uint32_t highest_backref; /**< highest backreference */ - re_bytecode_ctx_t *bytecode_ctx_p; /**< pointer of RegExp bytecode context */ - re_token_t current_token; /**< current token */ - re_parser_ctx_t *parser_ctx_p; /**< pointer of RegExp parser context */ -} re_compiler_ctx_t; - -ecma_value_t -re_compile_bytecode (const re_compiled_code_t **out_bytecode_p, ecma_string_t *pattern_str_p, uint16_t flags); - -void re_cache_gc_run (void); - -/** - * @} - * @} - * @} - */ - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ -#endif /* !RE_COMPILER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-parser.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-parser.h deleted file mode 100644 index 7e3c2e2c6..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/re-parser.h +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef RE_PARSER_H -#define RE_PARSER_H - -#if ENABLED (JERRY_BUILTIN_REGEXP) - -/** \addtogroup parser Parser - * @{ - * - * \addtogroup regexparser Regular expression - * @{ - * - * \addtogroup regexparser_bytecode Bytecode - * @{ - */ - -/** - * RegExp token type definitions - */ -typedef enum -{ - RE_TOK_EOF, /**< EOF */ - RE_TOK_BACKREFERENCE, /**< "\[0..9]" */ - RE_TOK_CHAR, /**< any character */ - RE_TOK_ALTERNATIVE, /**< "|" */ - RE_TOK_ASSERT_START, /**< "^" */ - RE_TOK_ASSERT_END, /**< "$" */ - RE_TOK_PERIOD, /**< "." */ - RE_TOK_START_CAPTURE_GROUP, /**< "(" */ - RE_TOK_START_NON_CAPTURE_GROUP, /**< "(?:" */ - RE_TOK_END_GROUP, /**< ")" */ - RE_TOK_ASSERT_START_POS_LOOKAHEAD, /**< "(?=" */ - RE_TOK_ASSERT_START_NEG_LOOKAHEAD, /**< "(?!" */ - RE_TOK_ASSERT_WORD_BOUNDARY, /**< "\b" */ - RE_TOK_ASSERT_NOT_WORD_BOUNDARY, /**< "\B" */ - RE_TOK_DIGIT, /**< "\d" */ - RE_TOK_NOT_DIGIT, /**< "\D" */ - RE_TOK_WHITE, /**< "\s" */ - RE_TOK_NOT_WHITE, /**< "\S" */ - RE_TOK_WORD_CHAR, /**< "\w" */ - RE_TOK_NOT_WORD_CHAR, /**< "\W" */ - RE_TOK_START_CHAR_CLASS, /**< "[ ]" */ - RE_TOK_START_INV_CHAR_CLASS, /**< "[^ ]" */ -} re_token_type_t; - -/** - * @} - * - * \addtogroup regexparser_parser Parser - * @{ - */ - -/** - * RegExp constant of infinite - */ -#define RE_ITERATOR_INFINITE ((uint32_t) - 1) - -/** - * Maximum number of decimal escape digits - */ -#define RE_MAX_RE_DECESC_DIGITS 9 - -/** - * RegExp token type - */ -typedef struct -{ - re_token_type_t type; /**< type of the token */ - uint32_t value; /**< value of the token */ - uint32_t qmin; /**< minimum number of token iterations */ - uint32_t qmax; /**< maximum number of token iterations */ - bool greedy; /**< type of iteration */ -} re_token_t; - -/** - * RegExp parser context - */ -typedef struct -{ - const lit_utf8_byte_t *input_start_p; /**< start of input pattern */ - const lit_utf8_byte_t *input_curr_p; /**< current position in input pattern */ - const lit_utf8_byte_t *input_end_p; /**< end of input pattern */ - int groups_count; /**< number of groups */ - uint32_t classes_count; /**< number of character classes */ -} re_parser_ctx_t; - -bool re_hex_lookup (re_parser_ctx_t *parser_ctx_p, uint32_t lookup); -uint32_t re_parse_octal (re_parser_ctx_t *parser_ctx_p); -ecma_value_t re_parse_iterator (re_parser_ctx_t *parser_ctx_p, re_token_t *re_token_p); -ecma_value_t re_parse_next_token (re_parser_ctx_t *parser_ctx_p, re_token_t *out_token_p); - -/** - * @} - * @} - * @} - */ - -#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */ -#endif /* !RE_PARSER_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-defines.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-defines.h deleted file mode 100644 index d757876e7..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-defines.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ -#ifndef VM_DEFINES_H -#define VM_DEFINES_H - -#include "byte-code.h" -#include "ecma-globals.h" - -/** \addtogroup vm Virtual machine - * @{ - * - * \addtogroup vm_executor Executor - * @{ - */ - -/** - * Helper for += on uint16_t values. - */ -#define VM_PLUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) + (value)) - -/** - * Helper for -= on uint16_t values. - */ -#define VM_MINUS_EQUAL_U16(base, value) (base) = (uint16_t) ((base) - (value)) - -/** - * Context of interpreter, related to a JS stack frame - */ -typedef struct vm_frame_ctx_t -{ - const ecma_compiled_code_t *bytecode_header_p; /**< currently executed byte-code data */ - uint8_t *byte_code_p; /**< current byte code pointer */ - uint8_t *byte_code_start_p; /**< byte code start pointer */ - ecma_value_t *registers_p; /**< register start pointer */ - ecma_value_t *stack_top_p; /**< stack top pointer */ - ecma_value_t *literal_start_p; /**< literal list start pointer */ - ecma_object_t *lex_env_p; /**< current lexical environment */ -#if defined (JERRY_DEBUGGER) || ENABLED (JERRY_LINE_INFO) - struct vm_frame_ctx_t *prev_context_p; /**< previous context */ -#endif /* defined (JERRY_DEBUGGER) || ENABLED (JERRY_LINE_INFO) */ - ecma_value_t this_binding; /**< this binding */ - ecma_value_t block_result; /**< block result */ -#if ENABLED (JERRY_LINE_INFO) - ecma_value_t resource_name; /**< current resource name (usually a file name) */ - uint32_t current_line; /**< currently executed line */ -#endif /* ENABLED (JERRY_LINE_INFO) */ - uint16_t context_depth; /**< current context depth */ - uint8_t is_eval_code; /**< eval mode flag */ - uint8_t call_operation; /**< perform a call or construct operation */ -} vm_frame_ctx_t; - -/** - * @} - * @} - */ - -#endif /* !VM_DEFINES_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-stack.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-stack.h deleted file mode 100644 index 331c264b0..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm-stack.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef VM_STACK_H -#define VM_STACK_H - -#include "ecma-globals.h" - -/** \addtogroup vm Virtual machine - * @{ - * - * \addtogroup stack VM stack - * @{ - */ - -#define VM_CREATE_CONTEXT(type, end_offset) ((ecma_value_t) ((type) | (end_offset) << 4)) -#define VM_GET_CONTEXT_TYPE(value) ((vm_stack_context_type_t) ((value) & 0xf)) -#define VM_GET_CONTEXT_END(value) ((value) >> 4) - -/** - * Context types for the vm stack. - */ -typedef enum -{ - VM_CONTEXT_FINALLY_JUMP, /**< finally context with a jump */ - VM_CONTEXT_FINALLY_THROW, /**< finally context with a throw */ - VM_CONTEXT_FINALLY_RETURN, /**< finally context with a return */ - VM_CONTEXT_TRY, /**< try context */ - VM_CONTEXT_CATCH, /**< catch context */ - VM_CONTEXT_WITH, /**< with context */ -#if ENABLED (JERRY_ES2015_CLASS) - VM_CONTEXT_SUPER_CLASS, /**< super class context */ -#endif /* ENABLED (JERRY_ES2015_CLASS) */ - VM_CONTEXT_FOR_IN, /**< for-in context */ -#if ENABLED (JERRY_ES2015_FOR_OF) - VM_CONTEXT_FOR_OF, /**< for-of context */ -#endif /* ENABLED (JERRY_ES2015_FOR_OF) */ -} vm_stack_context_type_t; - -ecma_value_t *vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *vm_stack_top_p); -bool vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top_ref_p, - vm_stack_context_type_t finally_type, uint32_t search_limit); - -/** - * @} - * @} - */ - -#endif /* !VM_STACK_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm.h deleted file mode 100644 index b2a2f25d2..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrycore/vm.h +++ /dev/null @@ -1,387 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef VM_H -#define VM_H - -#include "ecma-globals.h" -#include "jrt.h" -#include "vm-defines.h" - -/** \addtogroup vm Virtual machine - * @{ - * - * \addtogroup vm_executor Executor - * @{ - */ - -/** - * Each CBC opcode is transformed to three vm opcodes: - * - * - first opcode is a "get arguments" opcode which specifies - * the type (register, literal, stack, etc.) and number - * (from 0 to 2) of input arguments - * - second opcode is a "group" opcode which specifies - * the actual operation (add, increment, call, etc.) - * - third opcode is a "put result" opcode which specifies - * the destination where the result is stored (register, - * stack, etc.) - */ - -/** - * If VM_OC_GET_ARGS_INDEX(opcode) == VM_OC_GET_BRANCH, - * this flag signals that the branch is a backward branch. - */ -#define VM_OC_BACKWARD_BRANCH 0x4000 - -/** - * Position of "get arguments" opcode. - */ -#define VM_OC_GET_ARGS_SHIFT 7 - -/** - * Mask of "get arguments" opcode. - */ -#define VM_OC_GET_ARGS_MASK 0x7 - -/** - * Generate the binary representation of a "get arguments" opcode. - */ -#define VM_OC_GET_ARGS_CREATE_INDEX(V) (((V) & VM_OC_GET_ARGS_MASK) << VM_OC_GET_ARGS_SHIFT) - -/** - * Extract the "get arguments" opcode. - */ -#define VM_OC_GET_ARGS_INDEX(O) ((O) & (VM_OC_GET_ARGS_MASK << VM_OC_GET_ARGS_SHIFT)) - -/** - * Checks whether the result is stored somewhere. - */ -#define VM_OC_HAS_GET_ARGS(V) ((V) & (VM_OC_GET_ARGS_MASK << VM_OC_GET_ARGS_SHIFT)) - -/** - * Argument getters that are part of the opcodes. - */ -typedef enum -{ - VM_OC_GET_NONE = VM_OC_GET_ARGS_CREATE_INDEX (0), /**< do nothing */ - VM_OC_GET_BRANCH = VM_OC_GET_ARGS_CREATE_INDEX (1), /**< branch argument */ - VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2), /**< pop one element from the stack */ - VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (3), /**< pop two elements from the stack */ - - VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4), /**< resolve literal */ - VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5), /**< resolve two literals */ - VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6), /**< pop one element from the stack - * and resolve a literal */ - VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (7), /**< get this and resolve a literal */ -} vm_oc_get_types; - -/** - * Mask of "group" opcode. - */ -#define VM_OC_GROUP_MASK 0x7f - -/** - * Extract the "group" opcode. - */ -#define VM_OC_GROUP_GET_INDEX(O) ((O) & VM_OC_GROUP_MASK) - -/** - * Opcodes. - */ -typedef enum -{ - VM_OC_POP, /**< pop from stack */ - VM_OC_POP_BLOCK, /**< pop block */ - VM_OC_PUSH, /**< push one literal */ - VM_OC_PUSH_TWO, /**< push two literals */ - VM_OC_PUSH_THREE, /**< push three literals */ - VM_OC_PUSH_UNDEFINED, /**< push undefined value */ - VM_OC_PUSH_TRUE, /**< push true value */ - VM_OC_PUSH_FALSE, /**< push false value */ - VM_OC_PUSH_NULL, /**< push null value */ - VM_OC_PUSH_THIS, /**< push this */ - VM_OC_PUSH_0, /**< push number zero */ - VM_OC_PUSH_POS_BYTE, /**< push number between 1 and 256 */ - VM_OC_PUSH_NEG_BYTE, /**< push number between -1 and -256 */ - VM_OC_PUSH_LIT_0, /**< push literal and number zero */ - VM_OC_PUSH_LIT_POS_BYTE, /**< push literal and number between 1 and 256 */ - VM_OC_PUSH_LIT_NEG_BYTE, /**< push literal and number between -1 and -256 */ - VM_OC_PUSH_OBJECT, /**< push object */ - VM_OC_PUSH_NAMED_FUNC_EXPR, /**< push named function expression */ - VM_OC_SET_PROPERTY, /**< set property */ -#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) - VM_OC_SET_COMPUTED_PROPERTY, /**< set computed property */ -#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */ - VM_OC_SET_GETTER, /**< set getter */ - VM_OC_SET_SETTER, /**< set setter */ - VM_OC_PUSH_UNDEFINED_BASE, /**< push undefined base */ - VM_OC_PUSH_ARRAY, /**< push array */ - VM_OC_PUSH_ELISON, /**< push elison */ - VM_OC_APPEND_ARRAY, /**< append array */ - VM_OC_IDENT_REFERENCE, /**< ident reference */ - VM_OC_PROP_REFERENCE, /**< prop reference */ - VM_OC_PROP_GET, /**< prop get */ - - /* These eight opcodes must be in this order. */ - VM_OC_PROP_PRE_INCR, /**< prefix increment of a property */ - VM_OC_PROP_PRE_DECR, /**< prop prefix decrement of a property */ - VM_OC_PROP_POST_INCR, /**< prop postfix increment of a property */ - VM_OC_PROP_POST_DECR, /**< prop postfix decrement of a property */ - VM_OC_PRE_INCR, /**< prefix increment */ - VM_OC_PRE_DECR, /**< prefix decrement */ - VM_OC_POST_INCR, /**< postfix increment */ - VM_OC_POST_DECR, /**< postfix decrement */ - - VM_OC_PROP_DELETE, /**< delete property */ - VM_OC_DELETE, /**< delete */ - - VM_OC_MOV_IDENT, /**< move identifier register reference */ - VM_OC_ASSIGN, /**< assign */ - VM_OC_ASSIGN_PROP, /**< assign property */ - VM_OC_ASSIGN_PROP_THIS, /**< assign prop this */ - - VM_OC_RET, /**< return */ - VM_OC_THROW, /**< throw */ - VM_OC_THROW_REFERENCE_ERROR, /**< throw reference error */ - - VM_OC_EVAL, /**< eval */ - VM_OC_CALL, /**< call */ - VM_OC_NEW, /**< new */ - VM_OC_RESOLVE_BASE_FOR_CALL, /**< resolve base value before call */ - VM_OC_ERROR, /**< error while the vm_loop is suspended */ - - VM_OC_JUMP, /**< jump */ - VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if stric equal */ - - /* These four opcodes must be in this order. */ - VM_OC_BRANCH_IF_TRUE, /**< branch if true */ - VM_OC_BRANCH_IF_FALSE, /**< branch if false */ - VM_OC_BRANCH_IF_LOGICAL_TRUE, /**< branch if logical true */ - VM_OC_BRANCH_IF_LOGICAL_FALSE, /**< branch if logical false */ - - VM_OC_PLUS, /**< unary plus */ - VM_OC_MINUS, /**< unary minus */ - VM_OC_NOT, /**< not */ - VM_OC_BIT_NOT, /**< bitwise not */ - VM_OC_VOID, /**< void */ - VM_OC_TYPEOF_IDENT, /**< typeof identifier */ - VM_OC_TYPEOF, /**< typeof */ - - VM_OC_ADD, /**< binary add */ - VM_OC_SUB, /**< binary sub */ - VM_OC_MUL, /**< mul */ - VM_OC_DIV, /**< div */ - VM_OC_MOD, /**< mod */ - - VM_OC_EQUAL, /**< equal */ - VM_OC_NOT_EQUAL, /**< not equal */ - VM_OC_STRICT_EQUAL, /**< strict equal */ - VM_OC_STRICT_NOT_EQUAL, /**< strict not equal */ - VM_OC_LESS, /**< less */ - VM_OC_GREATER, /**< greater */ - VM_OC_LESS_EQUAL, /**< less equal */ - VM_OC_GREATER_EQUAL, /**< greater equal */ - VM_OC_IN, /**< in */ - VM_OC_INSTANCEOF, /**< instanceof */ - - VM_OC_BIT_OR, /**< bitwise or */ - VM_OC_BIT_XOR, /**< bitwise xor */ - VM_OC_BIT_AND, /**< bitwise and */ - VM_OC_LEFT_SHIFT, /**< left shift */ - VM_OC_RIGHT_SHIFT, /**< right shift */ - VM_OC_UNS_RIGHT_SHIFT, /**< unsigned right shift */ - - VM_OC_WITH, /**< with */ - VM_OC_FOR_IN_CREATE_CONTEXT, /**< for in create context */ - VM_OC_FOR_IN_GET_NEXT, /**< get next */ - VM_OC_FOR_IN_HAS_NEXT, /**< has next */ -#if ENABLED (JERRY_ES2015_FOR_OF) - VM_OC_FOR_OF_CREATE_CONTEXT, /**< for of create context */ - VM_OC_FOR_OF_GET_NEXT, /**< get next */ - VM_OC_FOR_OF_HAS_NEXT, /**< has next */ -#endif /* ENABLED (JERRY_ES2015_FOR_OF) */ - VM_OC_TRY, /**< try */ - VM_OC_CATCH, /**< catch */ - VM_OC_FINALLY, /**< finally */ - VM_OC_CONTEXT_END, /**< context end */ - VM_OC_JUMP_AND_EXIT_CONTEXT, /**< jump and exit context */ -#if ENABLED (JERRY_ES2015_CLASS) - VM_OC_CLASS_HERITAGE, /**< create a super class context */ - VM_OC_CLASS_INHERITANCE, /**< inherit properties from the 'super' class */ - VM_OC_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE, /**< push class constructor */ - VM_OC_SET_CLASS_CONSTRUCTOR, /**< set class constructor to the given function literal */ - VM_OC_PUSH_IMPL_CONSTRUCTOR, /**< create implicit class constructor */ - VM_OC_CLASS_EXPR_CONTEXT_END, /**< class expression heritage context end */ - VM_OC_CLASS_EVAL, /**< eval inside a class */ - VM_OC_SUPER_CALL, /**< call the 'super' constructor */ - VM_OC_SUPER_PROP_REFERENCE, /**< resolve super property reference */ - VM_OC_PUSH_SUPER, /**< push resolvable super reference */ - VM_OC_PUSH_CONSTRUCTOR_SUPER, /**< push 'super' inside a class constructor */ - VM_OC_PUSH_CONSTRUCTOR_THIS, /**< push 'this' inside a class constructor */ - VM_OC_CONSTRUCTOR_RET, /**< explicit return from a class constructor */ -#endif /* ENABLED (JERRY_ES2015_CLASS) */ -#if ENABLED (JERRY_DEBUGGER) - VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */ - VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */ -#endif /* ENABLED (JERRY_DEBUGGER) */ -#if ENABLED (JERRY_LINE_INFO) - VM_OC_RESOURCE_NAME, /**< resource name of the current function */ - VM_OC_LINE, /**< line number of the next statement */ -#endif /* ENABLED (JERRY_LINE_INFO) */ - VM_OC_NONE, /**< a special opcode for unsupported byte codes */ -} vm_oc_types; - -/** - * Unused opcodes, but required by byte-code types. - */ -typedef enum -{ -#if !ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) - VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */ -#endif /* !ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */ -#if !ENABLED (JERRY_DEBUGGER) - VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */ - VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */ -#endif /* !ENABLED (JERRY_DEBUGGER) */ -#if !ENABLED (JERRY_LINE_INFO) - VM_OC_RESOURCE_NAME = VM_OC_NONE, /**< resource name of the current function is unused */ - VM_OC_LINE = VM_OC_NONE, /**< line number of the next statement is unused */ -#endif /* !ENABLED (JERRY_LINE_INFO) */ -#if !ENABLED (JERRY_ES2015_CLASS) - VM_OC_CLASS_HERITAGE = VM_OC_NONE, /**< create a super class context */ - VM_OC_CLASS_INHERITANCE = VM_OC_NONE, /**< inherit properties from the 'super' class */ - VM_OC_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE = VM_OC_NONE, /**< push class constructor */ - VM_OC_SET_CLASS_CONSTRUCTOR = VM_OC_NONE, /**< set class constructor to the given function literal */ - VM_OC_PUSH_IMPL_CONSTRUCTOR = VM_OC_NONE, /**< create implicit class constructor */ - VM_OC_CLASS_EXPR_CONTEXT_END = VM_OC_NONE, /**< class expression heritage context end */ - VM_OC_CLASS_EVAL = VM_OC_NONE, /**< eval inside a class */ - VM_OC_SUPER_CALL = VM_OC_NONE, /**< call the 'super' constructor */ - VM_OC_SUPER_PROP_REFERENCE = VM_OC_NONE, /**< resolve super property reference */ - VM_OC_PUSH_SUPER = VM_OC_NONE, /**< push resolvable super reference */ - VM_OC_PUSH_CONSTRUCTOR_SUPER = VM_OC_NONE, /**< push 'super' inside a class constructor */ - VM_OC_PUSH_CONSTRUCTOR_THIS = VM_OC_NONE, /**< push 'this' inside a class constructor */ - VM_OC_CONSTRUCTOR_RET = VM_OC_NONE, /**< explicit return from a class constructor */ -#endif /* !ENABLED (JERRY_ES2015_CLASS) */ -#if !ENABLED (JERRY_ES2015_FOR_OF) - VM_OC_FOR_OF_CREATE_CONTEXT = VM_OC_NONE, /**< for of create context */ - VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< get next */ - VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< has next */ -#endif /* !ENABLED (JERRY_ES2015_FOR_OF) */ - VM_OC_UNUSED = VM_OC_NONE /**< placeholder if the list is empty */ -} vm_oc_unused_types; - -/** - * Decrement operator. - */ -#define VM_OC_DECREMENT_OPERATOR_FLAG 0x1 - -/** - * Postfix increment/decrement operator. - */ -#define VM_OC_POST_INCR_DECR_OPERATOR_FLAG 0x2 - -/** - * An named variable is updated by the increment/decrement operator. - */ -#define VM_OC_IDENT_INCR_DECR_OPERATOR_FLAG 0x4 - -/** - * Jump to target offset if input value is logical false. - */ -#define VM_OC_BRANCH_IF_FALSE_FLAG 0x1 - -/** - * Branch optimized for logical and/or opcodes. - */ -#define VM_OC_LOGICAL_BRANCH_FLAG 0x2 - -/** - * Bit index shift for non-static property initializers. - */ -#define VM_OC_NON_STATIC_SHIFT 14 - -/** - * This flag is set for static property initializers. - */ -#define VM_OC_NON_STATIC_FLAG (0x1 << VM_OC_NON_STATIC_SHIFT) - -/** - * Position of "put result" opcode. - */ -#define VM_OC_PUT_RESULT_SHIFT 10 - -/** - * Mask of "put result" opcode. - */ -#define VM_OC_PUT_RESULT_MASK 0xf - -/** - * Generate a "put result" opcode flag bit. - */ -#define VM_OC_PUT_RESULT_CREATE_FLAG(V) (((V) & VM_OC_PUT_RESULT_MASK) << VM_OC_PUT_RESULT_SHIFT) - -/** - * Checks whether the result is stored somewhere. - */ -#define VM_OC_HAS_PUT_RESULT(V) ((V) & (VM_OC_PUT_RESULT_MASK << VM_OC_PUT_RESULT_SHIFT)) - -/** - * Specify where the result is stored - */ -typedef enum -{ - VM_OC_PUT_IDENT = VM_OC_PUT_RESULT_CREATE_FLAG (0x1), - VM_OC_PUT_REFERENCE = VM_OC_PUT_RESULT_CREATE_FLAG (0x2), - VM_OC_PUT_STACK = VM_OC_PUT_RESULT_CREATE_FLAG (0x4), - VM_OC_PUT_BLOCK = VM_OC_PUT_RESULT_CREATE_FLAG (0x8), -} vm_oc_put_types; - -/** - * Non-recursive vm_loop: the vm_loop can be suspended - * to execute a call /construct operation. These return - * types of the vm_loop tells whether a call operation - * is in progress or the vm_loop is finished. - */ -typedef enum -{ - VM_NO_EXEC_OP, /**< do nothing */ - VM_EXEC_CALL, /**< invoke a function */ - VM_EXEC_SUPER_CALL, /**< invoke a function through 'super' keyword */ - VM_EXEC_CONSTRUCT, /**< construct a new object */ -} vm_call_operation; - -ecma_value_t vm_run_global (const ecma_compiled_code_t *bytecode_p); -ecma_value_t vm_run_eval (ecma_compiled_code_t *bytecode_data_p, uint32_t parse_opts); - -#if ENABLED (JERRY_ES2015_MODULE_SYSTEM) -ecma_value_t vm_run_module (const ecma_compiled_code_t *bytecode_p, ecma_object_t *lex_env_p); -#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ - -ecma_value_t vm_run (const ecma_compiled_code_t *bytecode_header_p, ecma_value_t this_binding_value, - ecma_object_t *lex_env_p, uint32_t parse_opts, const ecma_value_t *arg_list_p, - ecma_length_t arg_list_len); - -bool vm_is_strict_mode (void); -bool vm_is_direct_eval_form_call (void); - -ecma_value_t vm_get_backtrace (uint32_t max_depth); - -/** - * @} - * @} - */ - -#endif /* !VM_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/arg-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/arg-internal.h deleted file mode 100644 index 3f9c4fe07..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/arg-internal.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_INTERNAL_H -#define JERRYX_ARG_INTERNAL_H - -#include "jerryscript.h" - -/** - * The iterator structor for JS arguments. - */ -struct jerryx_arg_js_iterator_t -{ - const jerry_value_t *js_arg_p; /**< the JS arguments */ - const jerry_length_t js_arg_cnt; /**< the total num of JS arguments */ - jerry_length_t js_arg_idx; /**< current index of JS argument */ -}; - -#endif /* !JERRYX_ARG_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/debugger-sha1.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/debugger-sha1.h deleted file mode 100644 index 16fe56362..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/debugger-sha1.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef DEBUGGER_SHA1_H -#define DEBUGGER_SHA1_H - -#include "jerryscript-debugger-transport.h" - -#if defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1) - -/* JerryScript debugger protocol is a simplified version of RFC-6455 (WebSockets). */ - -void jerryx_debugger_compute_sha1 (const uint8_t *input1, size_t input1_len, - const uint8_t *input2, size_t input2_len, - uint8_t output[20]); - -#endif /* defined (JERRY_DEBUGGER) && (JERRY_DEBUGGER == 1) */ - -#endif /* !DEBUGGER_SHA1_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/handle-scope-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/handle-scope-internal.h deleted file mode 100644 index 34d80a31f..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/handle-scope-internal.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_HANDLE_SCOPE_INTERNAL_H -#define JERRYX_HANDLE_SCOPE_INTERNAL_H - -#include "jerryscript.h" -#include "jerryscript-port.h" -#include "jerryscript-ext/handle-scope.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#define JERRYX_HANDLE_SCOPE_ASSERT(x) \ - do \ - { \ - if (!(x)) \ - { \ - jerry_port_log (JERRY_LOG_LEVEL_ERROR, \ - "JerryXHandleScope: Assertion '%s' failed at %s(%s):%lu.\n", \ - #x, \ - __FILE__, \ - __func__, \ - (unsigned long) __LINE__); \ - jerry_port_fatal (ERR_FAILED_INTERNAL_ASSERTION); \ - } \ - } while (0) - -/** MARK: - handle-scope-allocator.c */ -typedef struct jerryx_handle_scope_pool_s jerryx_handle_scope_pool_t; -/** - * A linear allocating memory pool for type jerryx_handle_scope_t, - * in which allocated item shall be released in reversed order of allocation - */ -struct jerryx_handle_scope_pool_s -{ - jerryx_handle_scope_t prelist[JERRYX_SCOPE_PRELIST_SIZE]; /**< inlined handle scopes in the pool */ - size_t count; /**< number of handle scopes in the pool */ - jerryx_handle_scope_dynamic_t *start; /**< start address of dynamically allocated handle scope list */ -}; - -jerryx_handle_scope_t * -jerryx_handle_scope_get_parent (jerryx_handle_scope_t *scope); - -jerryx_handle_scope_t * -jerryx_handle_scope_get_child (jerryx_handle_scope_t *scope); - -jerryx_handle_scope_t * -jerryx_handle_scope_alloc (void); - -void -jerryx_handle_scope_free (jerryx_handle_scope_t *scope); -/** MARK: - END handle-scope-allocator.c */ - -/** MARK: - handle-scope.c */ -void -jerryx_handle_scope_release_handles (jerryx_handle_scope scope); - -jerry_value_t -jerryx_hand_scope_escape_handle_from_prelist (jerryx_handle_scope scope, size_t idx); - -jerry_value_t -jerryx_handle_scope_add_handle_to (jerryx_handle_t *handle, jerryx_handle_scope scope); - -jerryx_handle_scope_status -jerryx_escape_handle_internal (jerryx_escapable_handle_scope scope, - jerry_value_t escapee, - jerry_value_t *result, - bool should_promote); -/** MARK: - END handle-scope.c */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_HANDLE_SCOPE_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.h deleted file mode 100644 index 8171bcf3c..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.h +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_H -#define JERRYX_ARG_H - -#include -#include -#include -#include "jerryscript.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** - * The forward declaration of jerryx_arg_t. - */ -typedef struct jerryx_arg_t jerryx_arg_t; - -/** - * The forward declaration of jerryx_arg_js_iterator_t - */ -typedef struct jerryx_arg_js_iterator_t jerryx_arg_js_iterator_t; - -/** - * Signature of the transform function. - */ -typedef jerry_value_t (*jerryx_arg_transform_func_t) (jerryx_arg_js_iterator_t *js_arg_iter_p, /**< available JS args */ - const jerryx_arg_t *c_arg_p); /**< native arg */ - -/** - * The structure used in jerryx_arg_object_properties - */ -typedef struct -{ - const jerry_char_t **name_p; /**< property name list of the JS object */ - jerry_length_t name_cnt; /**< count of the name list */ - const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */ - jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */ -} jerryx_arg_object_props_t; - -/** - * The structure used in jerryx_arg_array - */ -typedef struct -{ - const jerryx_arg_t *c_arg_p; /**< points to the array of transformation steps */ - jerry_length_t c_arg_cnt; /**< the count of the `c_arg_p` array */ -} jerryx_arg_array_items_t; - -/** - * The structure defining a single validation & transformation step. - */ -struct jerryx_arg_t -{ - jerryx_arg_transform_func_t func; /**< the transform function */ - void *dest; /**< pointer to destination where func should store the result */ - uintptr_t extra_info; /**< extra information, specific to func */ -}; - -jerry_value_t jerryx_arg_transform_this_and_args (const jerry_value_t this_val, - const jerry_value_t *js_arg_p, - const jerry_length_t js_arg_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -jerry_value_t jerryx_arg_transform_args (const jerry_value_t *js_arg_p, - const jerry_length_t js_arg_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -jerry_value_t jerryx_arg_transform_object_properties (const jerry_value_t obj_val, - const jerry_char_t **name_p, - const jerry_length_t name_cnt, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); -jerry_value_t jerryx_arg_transform_array (const jerry_value_t array_val, - const jerryx_arg_t *c_arg_p, - jerry_length_t c_arg_cnt); - -/** - * Indicates whether an argument is allowed to be coerced into the expected JS type. - */ -typedef enum -{ - JERRYX_ARG_COERCE, /**< the transform inside will invoke toNumber, toBoolean or toString */ - JERRYX_ARG_NO_COERCE /**< the type coercion is not allowed. */ -} jerryx_arg_coerce_t; - -/** - * Indicates whether an argument is optional or required. - */ -typedef enum -{ - /** - * The argument is optional. If the argument is `undefined` the transform is - * successful and `c_arg_p->dest` remains untouched. - */ - JERRYX_ARG_OPTIONAL, - /** - * The argument is required. If the argument is `undefined` the transform - * will fail and `c_arg_p->dest` remains untouched. - */ - JERRYX_ARG_REQUIRED -} jerryx_arg_optional_t; - -/** - * Indicates the rounding policy which will be chosen to transform an integer. - */ -typedef enum -{ - JERRYX_ARG_ROUND, /**< round */ - JERRYX_ARG_FLOOR, /**< floor */ - JERRYX_ARG_CEIL /**< ceil */ -} jerryx_arg_round_t; - -/** - * Indicates the clamping policy which will be chosen to transform an integer. - * If the policy is NO_CLAMP, and the number is out of range, - * then the transformer will throw a range error. - */ -typedef enum -{ - JERRYX_ARG_CLAMP,/**< clamp the number when it is out of range */ - JERRYX_ARG_NO_CLAMP /**< throw a range error */ -} jerryx_arg_clamp_t; - -/* Inline functions for initializing jerryx_arg_t */ - -#define JERRYX_ARG_INTEGER(type) \ - static inline jerryx_arg_t \ - jerryx_arg_ ## type (type ## _t *dest, \ - jerryx_arg_round_t round_flag, \ - jerryx_arg_clamp_t clamp_flag, \ - jerryx_arg_coerce_t coerce_flag, \ - jerryx_arg_optional_t opt_flag); - -JERRYX_ARG_INTEGER (uint8) -JERRYX_ARG_INTEGER (int8) -JERRYX_ARG_INTEGER (uint16) -JERRYX_ARG_INTEGER (int16) -JERRYX_ARG_INTEGER (uint32) -JERRYX_ARG_INTEGER (int32) - -#undef JERRYX_ARG_INTEGER - -static inline jerryx_arg_t -jerryx_arg_number (double *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_boolean (bool *dest, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_string (char *dest, uint32_t size, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_utf8_string (char *dest, uint32_t size, jerryx_arg_coerce_t coerce_flag, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_function (jerry_value_t *dest, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_native_pointer (void **dest, const jerry_object_native_info_t *info_p, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_ignore (void); -static inline jerryx_arg_t -jerryx_arg_custom (void *dest, uintptr_t extra_info, jerryx_arg_transform_func_t func); -static inline jerryx_arg_t -jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props_p, jerryx_arg_optional_t opt_flag); -static inline jerryx_arg_t -jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, jerryx_arg_optional_t opt_flag); - -jerry_value_t -jerryx_arg_transform_optional (jerryx_arg_js_iterator_t *js_arg_iter_p, - const jerryx_arg_t *c_arg_p, - jerryx_arg_transform_func_t func); - -/* Helper functions for transform functions. */ -jerry_value_t jerryx_arg_js_iterator_pop (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_value_t jerryx_arg_js_iterator_restore (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_value_t jerryx_arg_js_iterator_peek (jerryx_arg_js_iterator_t *js_arg_iter_p); -jerry_length_t jerryx_arg_js_iterator_index (jerryx_arg_js_iterator_t *js_arg_iter_p); - -#include "arg.impl.h" - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_ARG_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.impl.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.impl.h deleted file mode 100644 index 1b3111e5a..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/arg.impl.h +++ /dev/null @@ -1,443 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_ARG_IMPL_H -#define JERRYX_ARG_IMPL_H - -/* transform functions for each type. */ - -#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL(type) \ - jerry_value_t jerryx_arg_transform_ ## type (jerryx_arg_js_iterator_t *js_arg_iter_p, \ - const jerryx_arg_t *c_arg_p); \ - jerry_value_t jerryx_arg_transform_ ## type ## _optional (jerryx_arg_js_iterator_t *js_arg_iter_p, \ - const jerryx_arg_t *c_arg_p); - -#define JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT(type) \ - JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type) \ - JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (type ## _strict) - -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint8) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int8) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint16) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int16) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (uint32) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (int32) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (number) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (string) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (utf8_string) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT (boolean) - -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (function) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (native_pointer) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (object_props) -JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL (array_items) - -jerry_value_t jerryx_arg_transform_ignore (jerryx_arg_js_iterator_t *js_arg_iter_p, - const jerryx_arg_t *c_arg_p); - -#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL -#undef JERRYX_ARG_TRANSFORM_FUNC_WITH_OPTIONAL_AND_STRICT - -/** - * The structure indicates the options used to transform integer argument. - * It will be passed into jerryx_arg_t's extra_info field. - */ -typedef struct -{ - uint8_t round; /**< rounding policy */ - uint8_t clamp; /**< clamping policy */ -} jerryx_arg_int_option_t; - -/** - * The macro used to generate jerryx_arg_xxx for int type. - */ -#define JERRYX_ARG_INT(type) \ - static inline jerryx_arg_t \ - jerryx_arg_ ## type (type ## _t *dest, \ - jerryx_arg_round_t round_flag, \ - jerryx_arg_clamp_t clamp_flag, \ - jerryx_arg_coerce_t coerce_flag, \ - jerryx_arg_optional_t opt_flag) \ - { \ - jerryx_arg_transform_func_t func; \ - if (coerce_flag == JERRYX_ARG_NO_COERCE) \ - { \ - if (opt_flag == JERRYX_ARG_OPTIONAL) \ - { \ - func = jerryx_arg_transform_ ## type ## _strict_optional; \ - } \ - else \ - { \ - func = jerryx_arg_transform_ ## type ## _strict; \ - } \ - } \ - else \ - { \ - if (opt_flag == JERRYX_ARG_OPTIONAL) \ - { \ - func = jerryx_arg_transform_ ## type ## _optional; \ - } \ - else \ - { \ - func = jerryx_arg_transform_ ## type; \ - } \ - } \ - union \ - { \ - jerryx_arg_int_option_t int_option; \ - uintptr_t extra_info; \ - } u = { .int_option = { .round = (uint8_t) round_flag, .clamp = (uint8_t) clamp_flag } }; \ - return (jerryx_arg_t) \ - { \ - .func = func, \ - .dest = (void *) dest, \ - .extra_info = u.extra_info \ - }; \ - } - -JERRYX_ARG_INT (uint8) -JERRYX_ARG_INT (int8) -JERRYX_ARG_INT (uint16) -JERRYX_ARG_INT (int16) -JERRYX_ARG_INT (uint32) -JERRYX_ARG_INT (int32) - -#undef JERRYX_ARG_INT - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `number` JS argument and stores it into a C `double`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_number (double *dest, /**< pointer to the double where the result should be stored */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_number_strict_optional; - } - else - { - func = jerryx_arg_transform_number_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_number_optional; - } - else - { - func = jerryx_arg_transform_number; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_number */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `boolean` JS argument and stores it into a C `bool`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_boolean (bool *dest, /**< points to the native bool */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_boolean_strict_optional; - } - else - { - func = jerryx_arg_transform_boolean_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_boolean_optional; - } - else - { - func = jerryx_arg_transform_boolean; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_boolean */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `string` JS argument and stores it into a C `char` array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_string (char *dest, /**< pointer to the native char array where the result should be stored */ - uint32_t size, /**< the size of native char array */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_string_strict_optional; - } - else - { - func = jerryx_arg_transform_string_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_string_optional; - } - else - { - func = jerryx_arg_transform_string; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) size - }; -} /* jerryx_arg_string */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `string` JS argument and stores it into a C utf8 `char` array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_utf8_string (char *dest, /**< [out] pointer to the native char array where the result should be stored */ - uint32_t size, /**< the size of native char array */ - jerryx_arg_coerce_t coerce_flag, /**< whether type coercion is allowed */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (coerce_flag == JERRYX_ARG_NO_COERCE) - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_utf8_string_strict_optional; - } - else - { - func = jerryx_arg_transform_utf8_string_strict; - } - } - else - { - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_utf8_string_optional; - } - else - { - func = jerryx_arg_transform_utf8_string; - } - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) size - }; -} /* jerryx_arg_utf8_string */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `function` JS argument and stores it into a C `jerry_value_t`. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_function (jerry_value_t *dest, /**< pointer to the jerry_value_t where the result should be stored */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_function_optional; - } - else - { - func = jerryx_arg_transform_function; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest - }; -} /* jerryx_arg_function */ - -/** - * Create a validation/transformation step (`jerryx_arg_t`) that expects to - * consume one `object` JS argument that is 'backed' with a native pointer with - * a given type info. In case the native pointer info matches, the transform - * will succeed and the object's native pointer will be assigned to *dest. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_native_pointer (void **dest, /**< pointer to where the resulting native pointer should be stored */ - const jerry_object_native_info_t *info_p, /**< expected the type info */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_native_pointer_optional; - } - else - { - func = jerryx_arg_transform_native_pointer; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = (void *) dest, - .extra_info = (uintptr_t) info_p - }; -} /* jerryx_arg_native_pointer */ - -/** - * Create a jerryx_arg_t instance for ignored argument. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_ignore (void) -{ - return (jerryx_arg_t) - { - .func = jerryx_arg_transform_ignore - }; -} /* jerryx_arg_ignore */ - -/** - * Create a jerryx_arg_t instance with custom transform. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_custom (void *dest, /**< pointer to the native argument where the result should be stored */ - uintptr_t extra_info, /**< the extra parameter, specific to the transform function */ - jerryx_arg_transform_func_t func) /**< the custom transform function */ -{ - return (jerryx_arg_t) - { - .func = func, - .dest = dest, - .extra_info = extra_info - }; -} /* jerryx_arg_custom */ - -/** - * Create a jerryx_arg_t instance for object properties. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props, /**< pointer to object property mapping */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_object_props_optional; - } - else - { - func = jerryx_arg_transform_object_props; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = NULL, - .extra_info = (uintptr_t) object_props - }; -} /* jerryx_arg_object_properties */ - -/** - * Create a jerryx_arg_t instance for array. - * - * @return a jerryx_arg_t instance. - */ -static inline jerryx_arg_t -jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, /**< pointer to array items mapping */ - jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */ -{ - jerryx_arg_transform_func_t func; - - if (opt_flag == JERRYX_ARG_OPTIONAL) - { - func = jerryx_arg_transform_array_items_optional; - } - else - { - func = jerryx_arg_transform_array_items; - } - - return (jerryx_arg_t) - { - .func = func, - .dest = NULL, - .extra_info = (uintptr_t) array_items_p - }; -} /* jerryx_arg_array */ - -#endif /* !JERRYX_ARG_IMPL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.h deleted file mode 100644 index f7cf7dea1..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_AUTORELEASE_H -#define JERRYX_AUTORELEASE_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include "autorelease.impl.h" - -/* - * Macro for `const jerry_value_t` for which jerry_release_value () is - * automatically called when the variable goes out of scope. - * - * Example usage: - * static void foo (bool enable) - * { - * JERRYX_AR_VALUE_T bar = jerry_create_string (...); - * - * if (enable) { - * JERRYX_AR_VALUE_T baz = jerry_get_global_object (); - * - * // ... - * - * // jerry_release_value (baz) and jerry_release_value (bar) is called automatically before - * // returning, because `baz` and `bar` go out of scope. - * return; - * } - * - * // jerry_release_value (bar) is called automatically when the function returns, - * // because `bar` goes out of scope. - * } - */ -#define JERRYX_AR_VALUE_T __JERRYX_AR_VALUE_T_IMPL - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_AUTORELEASE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.impl.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.impl.h deleted file mode 100644 index 558b17095..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/autorelease.impl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_AUTORELEASE_IMPL_H -#define JERRYX_AUTORELEASE_IMPL_H - -#include "jerryscript.h" - -#ifdef __GNUC__ -/* - * Calls jerry_release_value (*value). - * The GCC __cleanup__ function must take a pointer to the variable to clean up. - * - * @return void - */ -static inline void -jerryx_autorelease_cleanup (const jerry_value_t *value) /**< jerry value */ -{ - jerry_release_value (*value); -} /* jerryx_autorelease_cleanup */ - -#define __JERRYX_AR_VALUE_T_IMPL const jerry_value_t __attribute__ ((__cleanup__(jerryx_autorelease_cleanup))) -#else /* !__GNUC__ */ -/* TODO: for other compilers */ -#error "No autorelease implementation for your compiler!" -#endif /* __GNUC__ */ - -#endif /* !JERRYX_AUTORELEASE_IMPL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handle-scope.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handle-scope.h deleted file mode 100644 index bd871fb73..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/handle-scope.h +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_HANDLE_SCOPE_H -#define JERRYX_HANDLE_SCOPE_H - -#include "jerryscript.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#ifndef JERRYX_HANDLE_PRELIST_SIZE -#define JERRYX_HANDLE_PRELIST_SIZE 20 -#endif - -#ifndef JERRYX_SCOPE_PRELIST_SIZE -#define JERRYX_SCOPE_PRELIST_SIZE 20 -#endif - -#define STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1] - -STATIC_ASSERT (JERRYX_SCOPE_PRELIST_SIZE < 32, JERRYX_SCOPE_PRELIST_SIZE_must_be_less_than_size_of_uint8_t); - -#undef STATIC_ASSERT - -typedef struct jerryx_handle_t jerryx_handle_t; -/** - * Dynamically allocated handle in the scopes. - * Scopes has it's own size-limited linear storage of handles. Still there - * might be not enough space left for new handles, dynamically allocated - * `jerryx_handle_t` could ease the pre-allocated linear memory burden. - */ -struct jerryx_handle_t -{ - jerry_value_t jval; /**< jerry value of the handle bound to */ - jerryx_handle_t *sibling; /**< next sibling the the handle */ -}; - -#define JERRYX_HANDLE_SCOPE_FIELDS \ - jerry_value_t handle_prelist[JERRYX_HANDLE_PRELIST_SIZE]; \ - uint8_t prelist_handle_count; \ - bool escaped; \ - jerryx_handle_t *handle_ptr - -typedef struct jerryx_handle_scope_s jerryx_handle_scope_t; -typedef jerryx_handle_scope_t *jerryx_handle_scope; -typedef jerryx_handle_scope_t *jerryx_escapable_handle_scope; -/** - * Inlined simple handle scope type. - */ -struct jerryx_handle_scope_s -{ - JERRYX_HANDLE_SCOPE_FIELDS; /**< common handle scope fields */ -}; - - -typedef struct jerryx_handle_scope_dynamic_s jerryx_handle_scope_dynamic_t; -/** - * Dynamically allocated handle scope type. - */ -struct jerryx_handle_scope_dynamic_s -{ - JERRYX_HANDLE_SCOPE_FIELDS; /**< common handle scope fields */ - jerryx_handle_scope_dynamic_t *child; /**< child dynamically allocated handle scope */ - jerryx_handle_scope_dynamic_t *parent; /**< parent dynamically allocated handle scope */ -}; - -#undef JERRYX_HANDLE_SCOPE_FIELDS - -typedef enum -{ - jerryx_handle_scope_ok = 0, - - jerryx_escape_called_twice, - jerryx_handle_scope_mismatch, -} jerryx_handle_scope_status; - -jerryx_handle_scope_status -jerryx_open_handle_scope (jerryx_handle_scope *result); - -jerryx_handle_scope_status -jerryx_close_handle_scope (jerryx_handle_scope scope); - -jerryx_handle_scope_status -jerryx_open_escapable_handle_scope (jerryx_handle_scope *result); - -jerryx_handle_scope_status -jerryx_close_escapable_handle_scope (jerryx_handle_scope scope); - -jerryx_handle_scope_status -jerryx_escape_handle (jerryx_escapable_handle_scope scope, - jerry_value_t escapee, - jerry_value_t *result); - -/** - * Completely escape a handle from handle scope, - * leave life time management totally up to user. - */ -jerryx_handle_scope_status -jerryx_remove_handle (jerryx_escapable_handle_scope scope, - jerry_value_t escapee, - jerry_value_t *result); - -jerry_value_t -jerryx_create_handle (jerry_value_t jval); - -jerry_value_t -jerryx_create_handle_in_scope (jerry_value_t jval, jerryx_handle_scope scope); - -/** MARK: - handle-scope-allocator.c */ -jerryx_handle_scope_t * -jerryx_handle_scope_get_current (void); - -jerryx_handle_scope_t * -jerryx_handle_scope_get_root (void); -/** MARK: - END handle-scope-allocator.c */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_HANDLE_SCOPE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/module.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/module.h deleted file mode 100644 index 1c1025d56..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/module.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYX_MODULE_H -#define JERRYX_MODULE_H - -#include "jerryscript.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** - * Declare the signature for the module initialization function. - */ -typedef jerry_value_t (*jerryx_native_module_on_resolve_t) (void); - -/** - * Declare the structure used to define a module. One should only make use of this structure via the - * JERRYX_NATIVE_MODULE macro declared below. - */ -typedef struct jerryx_native_module_t -{ - const jerry_char_t *name_p; /**< name of the module */ - const jerryx_native_module_on_resolve_t on_resolve_p; /**< function that returns a new instance of the module */ - struct jerryx_native_module_t *next_p; /**< pointer to next module in the list */ -} jerryx_native_module_t; - -/** - * Declare the constructor and destructor attributes. These evaluate to nothing if this extension is built without - * library constructor/destructor support. - */ -#ifdef ENABLE_INIT_FINI -#ifdef _MSC_VER -#error "`FEATURE_INIT_FINI` build flag isn't supported on Windows, because Microsoft Visual C/C++ Compiler \ -doesn't support library constructors and destructors." -#endif -#define JERRYX_MODULE_CONSTRUCTOR_ATTRIBUTE __attribute__((constructor)) -#define JERRYX_MODULE_DESTRUCTOR_ATTRIBUTE __attribute__((destructor)) -#define JERRYX_MODULE_REGISTRATION_QUALIFIER static -#else /* !ENABLE_INIT_FINI */ -#define JERRYX_MODULE_CONSTRUCTOR_ATTRIBUTE -#define JERRYX_MODULE_DESTRUCTOR_ATTRIBUTE -#define JERRYX_MODULE_REGISTRATION_QUALIFIER -#endif /* ENABLE_INIT_FINI */ - -/** - * Having two levels of macros allows strings to be used unquoted. - */ -#define JERRYX_NATIVE_MODULE(module_name, on_resolve_cb) \ - JERRYX_NATIVE_MODULE_IMPLEM(module_name, on_resolve_cb) - -#define JERRYX_NATIVE_MODULE_IMPLEM(module_name, on_resolve_cb) \ - static jerryx_native_module_t _ ## module_name ## _definition = \ - { \ - .name_p = (jerry_char_t *) #module_name, \ - .on_resolve_p = (on_resolve_cb), \ - .next_p = NULL \ - }; \ - \ - JERRYX_MODULE_REGISTRATION_QUALIFIER void \ - module_name ## _register (void) JERRYX_MODULE_CONSTRUCTOR_ATTRIBUTE; \ - JERRYX_MODULE_REGISTRATION_QUALIFIER void \ - module_name ## _register (void) \ - { \ - jerryx_native_module_register(&_##module_name##_definition); \ - } \ - \ - JERRYX_MODULE_REGISTRATION_QUALIFIER void \ - module_name ## _unregister (void) \ - JERRYX_MODULE_DESTRUCTOR_ATTRIBUTE; \ - JERRYX_MODULE_REGISTRATION_QUALIFIER void \ - module_name ## _unregister (void) \ - { \ - jerryx_native_module_unregister(&_##module_name##_definition); \ - } - -/** - * Register a native module. This makes it available for loading via jerryx_module_resolve, when - * jerryx_module_native_resolver is passed in as a possible resolver. - */ -void jerryx_native_module_register (jerryx_native_module_t *module_p); - -/** - * Unregister a native module. This removes the module from the list of available native modules, meaning that - * subsequent calls to jerryx_module_resolve with jerryx_module_native_resolver will not be able to find it. - */ -void jerryx_native_module_unregister (jerryx_native_module_t *module_p); - -/** - * Declare the function pointer type for canonical name resolution. - */ -typedef jerry_value_t (*jerryx_module_get_canonical_name_t) (const jerry_value_t name); /**< The name for which to - * compute the canonical - * name */ - -/** - * Declare the function pointer type for module resolution. - */ -typedef bool (*jerryx_module_resolve_t) (const jerry_value_t canonical_name, /**< The module's canonical name */ - jerry_value_t *result); /**< The resulting module, if the function returns - * true */ - -/** - * Declare the structure for module resolvers. - */ -typedef struct -{ - jerryx_module_get_canonical_name_t get_canonical_name_p; /**< function pointer to establish the canonical name of a - * module */ - jerryx_module_resolve_t resolve_p; /**< function pointer to resolve a module */ -} jerryx_module_resolver_t; - -/** - * Declare the JerryScript module resolver so that it may be added to an array of jerryx_module_resolver_t items and - * thus passed to jerryx_module_resolve. - */ -extern jerryx_module_resolver_t jerryx_module_native_resolver; - -/** - * Load a copy of a module into the current context using the provided module resolvers, or return one that was already - * loaded if it is found. - */ -jerry_value_t jerryx_module_resolve (const jerry_value_t name, - const jerryx_module_resolver_t **resolvers, - size_t count); - -/** - * Delete a module from the cache or, if name has the JavaScript value of undefined, clear the entire cache. - */ -void jerryx_module_clear_cache (const jerry_value_t name, - const jerryx_module_resolver_t **resolvers, - size_t count); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYX_MODULE_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jext-common.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jext-common.h deleted file mode 100644 index 9c59e0b0d..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jext-common.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JEXT_COMMON_H -#define JEXT_COMMON_H - -#include -#include - -#include "jerryscript.h" -#include "jerryscript-port.h" - -/* - * Make sure unused parameters, variables, or expressions trigger no compiler warning. - */ -#define JERRYX_UNUSED(x) ((void) (x)) - -/* - * Asserts - * - * Warning: - * Don't use JERRY_STATIC_ASSERT in headers, because - * __LINE__ may be the same for asserts in a header - * and in an implementation file. - */ -#define JERRYX_STATIC_ASSERT_GLUE_(a, b, c) a ## b ## _ ## c -#define JERRYX_STATIC_ASSERT_GLUE(a, b, c) JERRYX_STATIC_ASSERT_GLUE_ (a, b, c) -#define JERRYX_STATIC_ASSERT(x, msg) \ - enum { JERRYX_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) = 1 / (!!(x)) } - -#ifndef JERRY_NDEBUG -void JERRY_ATTR_NORETURN -jerry_assert_fail (const char *assertion, const char *file, const char *function, const uint32_t line); -void JERRY_ATTR_NORETURN -jerry_unreachable (const char *file, const char *function, const uint32_t line); - -#define JERRYX_ASSERT(x) \ - do \ - { \ - if (JERRY_UNLIKELY (!(x))) \ - { \ - jerry_assert_fail (#x, __FILE__, __func__, __LINE__); \ - } \ - } while (0) - -#define JERRYX_UNREACHABLE() \ - do \ - { \ - jerry_unreachable (__FILE__, __func__, __LINE__); \ - } while (0) -#else /* JERRY_NDEBUG */ -#define JERRYX_ASSERT(x) \ - do \ - { \ - if (false) \ - { \ - JERRYX_UNUSED (x); \ - } \ - } while (0) - -#ifdef __GNUC__ -#define JERRYX_UNREACHABLE() __builtin_unreachable () -#endif /* __GNUC__ */ - -#ifdef _MSC_VER -#define JERRYX_UNREACHABLE() _assume (0) -#endif /* _MSC_VER */ - -#ifndef JERRYX_UNREACHABLE -#define JERRYX_UNREACHABLE() -#endif /* !JERRYX_UNREACHABLE */ - -#endif /* !JERRY_NDEBUG */ - -/* - * Logging - */ -#define JERRYX_ERROR_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_ERROR, __VA_ARGS__) -#define JERRYX_WARNING_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_WARNING, __VA_ARGS__) -#define JERRYX_DEBUG_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_DEBUG, __VA_ARGS__) -#define JERRYX_TRACE_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_TRACE, __VA_ARGS__) - -#endif /* !JEXT_COMMON_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/jerry-libm-internal.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/jerry-libm-internal.h deleted file mode 100644 index fb29c7f44..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/jerry-libm-internal.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - * - * This file is based on work under the following copyright and permission - * notice: - * - * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. - * - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * - * @(#)fdlibm.h 1.5 04/04/22 - */ - -#ifndef JERRY_LIBM_INTERNAL_H -#define JERRY_LIBM_INTERNAL_H - -/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly - but these catch some common cases. */ - - -#ifndef __LITTLE_ENDIAN -/* Check if compiler has byte order macro. Some older versions do not. - * If byte order is supported and set to little or target is among common - * cases checked define __LITTLE_ENDIAN. - */ -#if (defined (i386) || defined (__i386) || defined (__i386__) || \ - defined (i486) || defined (__i486) || defined (__i486__) || \ - defined (intel) || defined (x86) || defined (i86pc) || \ - defined (__alpha) || defined (__osf__) || \ - defined (__x86_64__) || defined (__arm__) || defined (__aarch64__) || \ - defined (__xtensa__) || defined (__MIPSEL)) || \ -(defined (__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) -#define __LITTLE_ENDIAN -#endif -#endif /* !__LITTLE_ENDIAN */ - -#ifdef __LITTLE_ENDIAN -#define __HI(x) *(1 + (const int *) &x) -#define __LO(x) *(const int *) &x -typedef union -{ - double dbl; - struct - { - int lo; - int hi; - } as_int; -} double_accessor; -#else /* !__LITTLE_ENDIAN */ -#define __HI(x) *(const int *) &x -#define __LO(x) *(1 + (const int *) &x) - -typedef union -{ - double dbl; - struct - { - int hi; - int lo; - } as_int; -} double_accessor; -#endif /* __LITTLE_ENDIAN */ - -#ifndef NAN -#define NAN (0.0/0.0) -#endif - -/* - * ANSI/POSIX - */ -double acos (double x); -double asin (double x); -double atan (double x); -double atan2 (double y, double x); -double cos (double x); -double sin (double x); -double tan (double x); - -double exp (double x); -double log (double x); - -double pow (double x, double y); -double sqrt (double x); - -double ceil (double x); -double fabs (double x); -double floor (double x); -double fmod (double x, double y); - -int isnan (double x); -int finite (double x); - -double nextafter (double x, double y); - -/* - * Functions callable from C, intended to support IEEE arithmetic. - */ -double copysign (double x, double y); -double scalbn (double x, int n); - -#endif /* !JERRY_LIBM_INTERNAL_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/math.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/math.h deleted file mode 100644 index 496c24267..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerrylibm/math.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRY_LIBM_MATH_H -#define JERRY_LIBM_MATH_H - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* General Constants. */ -#define INFINITY (1.0/0.0) -#define NAN (0.0/0.0) -#define HUGE_VAL INFINITY - -#define isnan(x) ((x) != (x)) -#define isinf(x) (((x) == INFINITY) || ((x) == -INFINITY)) -#define isfinite(x) (!(isinf(x)) && (x != NAN)) - -/* Exponential and Logarithmic constants. */ -#define M_E 2.7182818284590452353602874713526625 -#define M_SQRT2 1.4142135623730950488016887242096981 -#define M_SQRT1_2 0.7071067811865475244008443621048490 -#define M_LOG2E 1.4426950408889634073599246810018921 -#define M_LOG10E 0.4342944819032518276511289189166051 -#define M_LN2 0.6931471805599453094172321214581765 -#define M_LN10 2.3025850929940456840179914546843642 - -/* Trigonometric Constants. */ -#define M_PI 3.1415926535897932384626433832795029 -#define M_PI_2 1.5707963267948966192313216916397514 -#define M_PI_4 0.7853981633974483096156608458198757 -#define M_1_PI 0.3183098861837906715377675267450287 -#define M_2_PI 0.6366197723675813430755350534900574 -#define M_2_SQRTPI 1.1283791670955125738961589031215452 - -/* Trigonometric functions. */ -double cos (double); -double sin (double); -double tan (double); -double acos (double); -double asin (double); -double atan (double); -double atan2 (double, double); - -/* Exponential and logarithmic functions. */ -double exp (double); -double log (double); - -/* Power functions. */ -double pow (double, double); -double sqrt (double); - -/* Rounding and remainder functions. */ -double ceil (double); -double floor (double); - -/* Other functions. */ -double fabs (double); -double fmod (double, double); - -double nextafter (double, double); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRY_LIBM_MATH_H */ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryport/jerryscript-port-default.h b/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryport/jerryscript-port-default.h deleted file mode 100644 index ba7208140..000000000 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryport/jerryscript-port-default.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * - * 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. - */ - -#ifndef JERRYSCRIPT_PORT_DEFAULT_H -#define JERRYSCRIPT_PORT_DEFAULT_H - -#include - -#include "jerryscript.h" -#include "jerryscript-port.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** \addtogroup jerry_port_default Default Jerry engine port API - * These functions are only available if the default port of Jerry is used. - * @{ - */ - -jerry_log_level_t jerry_port_default_get_log_level (void); -void jerry_port_default_set_log_level (jerry_log_level_t level); - -void jerry_port_default_set_current_context (jerry_context_t *context_p); - -typedef void (* fatal_handler_t)(int code); - -void jerry_port_default_set_fatal_handler (fatal_handler_t handler); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* !JERRYSCRIPT_PORT_DEFAULT_H */ diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/CMakeLists.txt b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/CMakeLists.txt new file mode 100644 index 000000000..f896ace40 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/CMakeLists.txt @@ -0,0 +1,63 @@ +#=============================================================================== +# @brief cmake file +# Copyright (c) CompanyNameMagicTag 2022-2023. All rights reserved. +#=============================================================================== +set(COMPONENT_NAME "storage_jsapi") + +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/kvstorekit/src/nativeapi_kv_impl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/kvstorekit/src/nativeapi_kv.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/filekit/src/nativeapi_fs_impl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/filekit/src/nativeapi_fs.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/common/src/nativeapi_common.cpp +) + +set(PUBLIC_HEADER +) + +set(PRIVATE_HEADER + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/jsi + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/ + ${CMAKE_CURRENT_SOURCE_DIR}/common/include + ${CMAKE_CURRENT_SOURCE_DIR}/kvstorekit/include + ${CMAKE_CURRENT_SOURCE_DIR}/filekit/include +) + +set(PRIVATE_DEFINES +) + +set(PUBLIC_DEFINES + FEATURE_MODULE_STORAGE +) + +# use this when you want to add ccflags like -include xxx +set(COMPONENT_PUBLIC_CCFLAGS +) +set(COMPONENT_CCFLAGS + -std=c++11 + -Wno-error + -Wno-unused-parameter + -fno-exceptions + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -Wno-undef + -Wno-bitwise-op-parentheses + -Wno-shift-op-parentheses + -nostdlibinc + -nostdinc + -nostdlib + -Wno-c++11-narrowing + -Wno-error=unused-function +) + +set(WHOLE_LINK + true +) + +set(MAIN_COMPONENT + false +) + +build_component() diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_common.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_common.h new file mode 100644 index 000000000..c72848fe9 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_common.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef JS_NATIVE_API_COMMON_H +#define JS_NATIVE_API_COMMON_H + +#include "jsi/jsi.h" + +namespace OHOS { +namespace ACELite { +struct FuncParams { + JSIValue args = JSI::CreateUndefined(); + JSIValue thisVal = JSI::CreateUndefined(); + bool flag = false; +}; + +class NativeapiCommon { +public: + static void FailCallBack(const JSIValue thisVal, const JSIValue args, int ret); + static void SuccessCallBack(const JSIValue thisVal, const JSIValue args, JSIValue jsiValue); + static bool IsValidJSIValue(const JSIValue* args, uint8_t argsNum); +private: + NativeapiCommon() = default; + ~NativeapiCommon() = default; +}; +} +} + +#endif /* JS_NATIVE_API_CALLBACK_H */ \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_config.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_config.h new file mode 100644 index 000000000..a0a83948a --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/include/nativeapi_config.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef JS_NATIVE_API_CONFIG_H +#define JS_NATIVE_API_CONFIG_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif /* __cplusplus */ + +#define FILE_NAME_MAX_LEN 300 +#define URI_NAME_MAX_LEN 128 +#define TEXT_MAX_READ_LEN 4096 +#define DIR_LEVEL 5 +#define ERROR_CODE "code" +#define TEXT "text" +#define FILE_URI "uri" +#define FILE_SOURCE_URI "srcUri" +#define FILE_DESTINATION_URI "dstUri" +#define FILE_LENGTH "length" +#define FILE_LAST_MODIFIED_TIME "lastModifiedTime" +#define FILE_TYPE "type" +#define FILE_POSITION "position" +#define FILE_APPEND "append" +#define FILE_BUFFER "buffer" +#define KV_KEY "key" +#define KV_VALUE "value" +#define DEFAULT "default" +#define FILE_PREFIX "internal://app" +#define DEFAULT_FOLDER_PATH "kvstore" +#define TYPE_FILE "file" +#define TYPE_DIR "dir" +#define FILE_LIST "fileList" +#define RECURSIVE "recursive" +#define SUB_FILES "subFiles" +#define ERR_NO_FILE "File or directory not exist" +#define ERR_IO_EXCEPTION "I/O error" +#define ERR_ILLEGAL_PARAM "Invalid parameter" +#define ERR_GENERAL "System error" +#define ERR_READ_TOO_LONG "The content of the file to be read exceeds 4KB" + +#define NATIVE_FEATURE_ON 1 +#define NATIVE_FEATURE_OFF 0 + +enum ErrorCode { + NATIVE_SUCCESS = 0, + ERROR_FR_NO_FILE = -2, + ERROR_DIR_NOT_EMPTY = -39, + ERROR_CODE_GENERAL = -200, + ERROR_CODE_PARAM = -202, + ERROR_CODE_IO = -300, + ERROR_CODE_NO_FILE = -301, + ERROR_CODE_READ_TOO_LONG = -302 +}; + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* JS_NATIVE_API_COMMON_H */ \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/src/nativeapi_common.cpp b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/src/nativeapi_common.cpp new file mode 100644 index 000000000..181beb2c5 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/common/src/nativeapi_common.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "nativeapi_common.h" +#include "jsi/jsi_types.h" +#include "nativeapi_config.h" + +namespace OHOS { +namespace ACELite { +void NativeapiCommon::FailCallBack(const JSIValue thisVal, const JSIValue args, int ret) +{ + if (JSI::ValueIsUndefined(args)) { + return; + } + JSIValue errInfo; + if (ret == ERROR_CODE_IO) { + errInfo = JSI::CreateString(ERR_IO_EXCEPTION); + ret = (-ERROR_CODE_IO); + } else if ((ret == ERROR_CODE_PARAM) || (ret == ERROR_DIR_NOT_EMPTY)) { + errInfo = JSI::CreateString(ERR_ILLEGAL_PARAM); + ret = (-ERROR_CODE_PARAM); + } else if (ret == ERROR_FR_NO_FILE) { + errInfo = JSI::CreateString(ERR_NO_FILE); + ret = (-ERROR_CODE_NO_FILE); + } else if (ret == ERROR_CODE_READ_TOO_LONG) { + errInfo = JSI::CreateString(ERR_READ_TOO_LONG); + ret = (-ERROR_CODE_READ_TOO_LONG); + } else { + errInfo = JSI::CreateString(ERR_GENERAL); + ret = (-ERROR_CODE_GENERAL); + } + JSIValue errCode = JSI::CreateNumber(ret); + JSIValue fail = JSI::GetNamedProperty(args, CB_FAIL); + JSIValue complete = JSI::GetNamedProperty(args, CB_COMPLETE); + JSIValue argv[ARGC_TWO] = {errInfo, errCode}; + if (!JSI::ValueIsUndefined(fail)) { + JSI::CallFunction(fail, thisVal, argv, ARGC_TWO); + } + if (!JSI::ValueIsUndefined(complete)) { + JSI::CallFunction(complete, thisVal, nullptr, 0); + } + JSI::ReleaseValueList(fail, complete, errInfo, errCode, ARGS_END); +} + +void NativeapiCommon::SuccessCallBack(const JSIValue thisVal, const JSIValue args, JSIValue jsiValue) +{ + if (JSI::ValueIsUndefined(args)) { + return; + } + JSIValue success = JSI::GetNamedProperty(args, CB_SUCCESS); + JSIValue complete = JSI::GetNamedProperty(args, CB_COMPLETE); + if (!JSI::ValueIsUndefined(success)) { + if (JSI::ValueIsUndefined(jsiValue)) { + JSI::CallFunction(success, thisVal, nullptr, 0); + } else { + JSI::CallFunction(success, thisVal, &jsiValue, ARGC_ONE); + } + } + if (!JSI::ValueIsUndefined(complete)) { + JSI::CallFunction(complete, thisVal, nullptr, 0); + } + JSI::ReleaseValueList(success, complete, ARGS_END); +} + +bool NativeapiCommon::IsValidJSIValue(const JSIValue* args, uint8_t argsNum) +{ + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return false; + } + return true; +} +} +} diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs.h new file mode 100644 index 000000000..2a3c2b5fd --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef JS_NATIVE_API_FS_H +#define JS_NATIVE_API_FS_H + +#include "jsi/jsi.h" +#include "nativeapi_config.h" + +namespace OHOS { +namespace ACELite { +class NativeapiFs { +public: + NativeapiFs() = default; + ~NativeapiFs() = default; + + static JSIValue MoveFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue CopyFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue DeleteFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue GetFileList(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue GetFileInfo(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue WriteTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue ReadTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue Access(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue CreateDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue RemoveDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + +#if (JS_FWK_TYPEDARRAY == NATIVE_FEATURE_ON) + static JSIValue ReadArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue WriteArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); +#endif /* JS_FWK_TYPEDARRAY */ +}; +void InitNativeApiFs(JSIValue exports); +} // ACELite +} // OHOS + +#endif /* JS_NATIVE_API_FS_H */ diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs_impl.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs_impl.h new file mode 100644 index 000000000..6b1fdd5b5 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/include/nativeapi_fs_impl.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef JS_NATIVE_API_FS_IMPL_H +#define JS_NATIVE_API_FS_IMPL_H + +#include +#include +#include +#include "nativeapi_config.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif /* __cplusplus */ + +typedef struct { + char fileName[FILE_NAME_MAX_LEN + 1]; + off_t fileSize; + time_t fileMtime; + mode_t fileMode; +} FileMetaInfo; + +int StatImpl(const char* path, struct stat* buf); +int DeleteFileImpl(const char* src); +int CopyFileImpl(const char* src, const char* dest); +int WriteTextFile(const char* fileName, const void* buf, size_t len, bool append); +int WriteArrayFile(const char* fileName, const void* buf, size_t len, unsigned int position, bool append); +int ReadFileImpl(const char* fileName, void* text, size_t len, unsigned int position, size_t* actualLen); +int GetFileListImpl(const char* dirName, FileMetaInfo* fileList, unsigned int listNum); +int GetFileNum(const char* dirName); +int AccessImpl(const char* fileName); +int CreateDirImpl(const char* fileName, bool recursive); +int RemoveDirImpl(const char* fileName, bool recursive); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* JS_NATIVE_API_FS_IMPL_H */ \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp new file mode 100644 index 000000000..439832093 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs.cpp @@ -0,0 +1,595 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "nativeapi_fs.h" +#include +#include "ace_log.h" +#include +#include "ability_env.h" +#include "js_async_work.h" +#include "nativeapi_common.h" +#include "nativeapi_fs_impl.h" + +namespace OHOS { +namespace ACELite { +namespace { +char g_uriFullPath[FILE_NAME_MAX_LEN + 1] = {0}; +const unsigned int PREFIX_LEN = strlen(FILE_PREFIX); + +bool IsValidPath(const char* path) +{ + if (path == nullptr) { + return false; + } + + size_t pathLen = strnlen(path, URI_NAME_MAX_LEN + 1); + if (pathLen > URI_NAME_MAX_LEN) { + return false; + } + if ((pathLen < PREFIX_LEN) || (strncmp(path, FILE_PREFIX, PREFIX_LEN) != 0)) { + return false; + } + if ((strstr(path, "/./") != nullptr) || (strstr(path, "/../") != nullptr)) { + return false; + } + if (strpbrk(path + PREFIX_LEN, "\"*+,:;<=>\?[]|\x7F")) { + return false; + } + return true; +} + +int GetFullPath(const char* uri, char* fullPath, int len) +{ + if (!IsValidPath(uri) || (fullPath == nullptr)) { + return ERROR_CODE_PARAM; + } + const char* dataPath = GetDataPath(); + if (dataPath == nullptr) { + return ERROR_CODE_PARAM; + } + if (memset_s(fullPath, len, 0x0, len) != EOK) { + return ERROR_CODE_GENERAL; + } + if (sprintf_s(fullPath, len, "%s%s", dataPath, uri + PREFIX_LEN) < 0) { + return ERROR_CODE_GENERAL; + } + return NATIVE_SUCCESS; +} + +JSIValue ExecuteAsyncWork(const JSIValue thisVal, const JSIValue* args, + uint8_t argsNum, AsyncWorkHandler ExecuteFunc, bool flag = false) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if (!NativeapiCommon::IsValidJSIValue(args, argsNum)) { + return undefValue; + } + FuncParams* params = new(std::nothrow) FuncParams(); + if (params == nullptr) { + return undefValue; + } + params->thisVal = JSI::AcquireValue(thisVal); + params->args = JSI::AcquireValue(args[0]); + params->flag = flag; + JsAsyncWork::DispatchAsyncWork(ExecuteFunc, reinterpret_cast(params)); + return undefValue; +} + +void ExecuteCopyFile(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_SOURCE_URI); + char* dest = JSI::GetStringProperty(args, FILE_DESTINATION_URI); + char* destFullPath = nullptr; + JSIValue result = JSI::CreateUndefined(); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + destFullPath = reinterpret_cast(malloc(FILE_NAME_MAX_LEN + 1)); + if (destFullPath == nullptr) { + NativeapiCommon::FailCallBack(thisVal, args, ERROR_CODE_GENERAL); + goto EXIT; + } + ret = GetFullPath(dest, destFullPath, FILE_NAME_MAX_LEN + 1); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = CopyFileImpl(g_uriFullPath, destFullPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if (params->flag) { + ret = DeleteFileImpl(g_uriFullPath); + } + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + result = JSI::CreateString(dest); + NativeapiCommon::SuccessCallBack(thisVal, args, result); +EXIT: + JSI::ReleaseString(dest); + free(destFullPath); + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteDeleteAccess(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if (params->flag) { + ret = DeleteFileImpl(g_uriFullPath); + } else { + ret = AccessImpl(g_uriFullPath); + } + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); +EXIT: + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} + +int GetFileListInner(const char* path, const char* key, JSIValue& result) +{ + int fileNum = GetFileNum(g_uriFullPath); + if (fileNum <= 0) { + return fileNum; + } + FileMetaInfo* fileList = reinterpret_cast(malloc(fileNum * sizeof(FileMetaInfo))); + if (fileList == nullptr) { + return ERROR_CODE_GENERAL; + } + if (memset_s(fileList, fileNum * sizeof(FileMetaInfo), 0x0, fileNum * sizeof(FileMetaInfo)) != EOK) { + free(fileList); + return ERROR_CODE_GENERAL; + } + int ret = GetFileListImpl(g_uriFullPath, fileList, fileNum); + if (ret != NATIVE_SUCCESS) { + free(fileList); + return ret; + } + JSIValue arrayValue = JSI::CreateArray(fileNum); + for (int i = 0; i < fileNum; i++) { + JSIValue tmp = JSI::CreateObject(); + JSI::SetStringProperty(tmp, FILE_URI, fileList[i].fileName); + JSI::SetNumberProperty(tmp, FILE_LENGTH, fileList[i].fileSize); + JSI::SetNumberProperty(tmp, FILE_LAST_MODIFIED_TIME, fileList[i].fileMtime); + JSI::SetStringProperty(tmp, FILE_TYPE, TYPE_FILE); + if (S_ISDIR(fileList[i].fileMode)) { + JSI::SetStringProperty(tmp, FILE_TYPE, TYPE_DIR); + } + JSI::SetPropertyByIndex(arrayValue, i, tmp); + JSI::ReleaseValue(tmp); + } + free(fileList); + JSI::SetNamedProperty(result, key, arrayValue); + JSI::ReleaseValue(arrayValue); + return NATIVE_SUCCESS; +} + +void ExecuteGetFileList(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* uri = JSI::GetStringProperty(args, FILE_URI); + JSIValue result = JSI::CreateObject(); + int ret = GetFullPath(uri, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(uri); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if (params->flag) { + ret = GetFileListInner(g_uriFullPath, FILE_LIST, result); + } else { + ret = GetFileListInner(g_uriFullPath, SUB_FILES, result); + } + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, result); +EXIT: + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteGetFileInfo(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + bool recursive = JSI::GetBooleanProperty(args, RECURSIVE); + struct stat info = {0}; + JSIValue result = JSI::CreateObject(); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = StatImpl(g_uriFullPath, &info); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if (recursive && (S_ISDIR(info.st_mode))) { + JSI::ReleaseString(src); + ExecuteGetFileList(data); + return; + } + JSI::SetStringProperty(result, FILE_URI, src); + JSI::SetNumberProperty(result, FILE_LENGTH, info.st_size); + JSI::SetNumberProperty(result, FILE_LAST_MODIFIED_TIME, info.st_mtime); + JSI::SetStringProperty(result, FILE_TYPE, TYPE_FILE); + if (S_ISDIR(info.st_mode)) { + JSI::SetStringProperty(result, FILE_TYPE, TYPE_DIR); + } + NativeapiCommon::SuccessCallBack(thisVal, args, result); +EXIT: + JSI::ReleaseString(src); + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteWriteTextFile(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + char* text = JSI::GetStringProperty(args, TEXT); + bool append = JSI::GetBooleanProperty(args, FILE_APPEND); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + if ((text == nullptr) || (ret != NATIVE_SUCCESS)) { + NativeapiCommon::FailCallBack(thisVal, args, ERROR_CODE_PARAM); + goto EXIT; + } + ret = WriteTextFile(g_uriFullPath, text, strlen(text), append); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); +EXIT: + JSI::ReleaseString(text); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} + +int ReadTextInner(const char* src, int position, int length, JSIValue& result) +{ + if ((position < 0) || (length < 0)) { + return ERROR_CODE_PARAM; + } + if (length == 0) { + length = TEXT_MAX_READ_LEN; + } + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + if (ret != NATIVE_SUCCESS) { + return ret; + } + struct stat info = {0}; + ret = StatImpl(g_uriFullPath, &info); + if (ret != NATIVE_SUCCESS) { + return ret; + } + size_t readLen = (info.st_size > length) ? length : info.st_size; + if (readLen > TEXT_MAX_READ_LEN) { + return ERROR_CODE_READ_TOO_LONG; + } + char* text = reinterpret_cast(malloc(readLen + 1)); + if (text == nullptr) { + return ERROR_CODE_GENERAL; + } + size_t actualLen = 0; + ret = ReadFileImpl(g_uriFullPath, text, readLen, position, &actualLen); + if (ret != NATIVE_SUCCESS) { + free(text); + return ret; + } + text[actualLen] = '\0'; + JSI::SetStringProperty(result, TEXT, text); + free(text); + return NATIVE_SUCCESS; +} + +void ExecuteReadTextFile(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + double position = JSI::GetNumberProperty(args, FILE_POSITION); + double length = JSI::GetNumberProperty(args, FILE_LENGTH); + JSIValue result = JSI::CreateObject(); + int ret = ReadTextInner(src, static_cast(position), static_cast(length), result); + JSI::ReleaseString(src); + if (ret == NATIVE_SUCCESS) { + NativeapiCommon::SuccessCallBack(thisVal, args, result); + } else { + NativeapiCommon::FailCallBack(thisVal, args, ret); + } + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteDirFunc(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + bool recursive = JSI::GetBooleanProperty(args, RECURSIVE); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if (params->flag) { + ret = CreateDirImpl(g_uriFullPath, recursive); + } else { + ret = RemoveDirImpl(g_uriFullPath, recursive); + } + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); +EXIT: + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} +#if (JS_FWK_TYPEDARRAY == NATIVE_FEATURE_ON) +int ReadArrayFileInner(const char* path, size_t len, unsigned int position, JSIValue& result) +{ + struct stat info = {0}; + int ret = StatImpl(path, &info); + if (ret != NATIVE_SUCCESS) { + return ret; + } + void* text = malloc(info.st_size + 1); + if (text == nullptr) { + return ERROR_CODE_GENERAL; + } + size_t actualLen = 0; + ret = ReadFileImpl(path, text, len, static_cast(position), &actualLen); + if (ret != NATIVE_SUCCESS) { + free(text); + return ret; + } + uint8_t* ptr = nullptr; + JSIValue arrayBuffer = JSI::CreateArrayBuffer(actualLen, ptr); + if (ptr == nullptr) { + free(text); + JSI::ReleaseValue(arrayBuffer); + return ERROR_CODE_GENERAL; + } + ret = memcpy_s(ptr, actualLen, text, actualLen); + free(text); + if (ret != EOK) { + JSI::ReleaseValue(arrayBuffer); + return ERROR_CODE_GENERAL; + } + JSIValue typedArray = JSI::CreateTypedArray(TypedArrayType::JSI_UINT8_ARRAY, actualLen, arrayBuffer, 0); + JSI::SetNamedProperty(result, FILE_BUFFER, typedArray); + JSI::ReleaseValueList(typedArray, arrayBuffer, ARGS_END); + return NATIVE_SUCCESS; +} + +void ExecuteReadArrayFile(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + double position = JSI::GetNumberProperty(args, FILE_POSITION); + double length = JSI::GetNumberProperty(args, FILE_LENGTH); + JSIValue result = JSI::CreateObject(); + int ret = ERROR_CODE_PARAM; + if ((position < 0) || (length < 0)) { + JSI::ReleaseString(src); + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = ReadArrayFileInner(g_uriFullPath, static_cast(length), static_cast(position), result); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, result); +EXIT: + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteWriteArrayFile(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* src = JSI::GetStringProperty(args, FILE_URI); + int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); + JSI::ReleaseString(src); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; + return; + } + JSIValue buffer = JSI::GetNamedProperty(args, FILE_BUFFER); + double position = JSI::GetNumberProperty(args, FILE_POSITION); + bool append = JSI::GetBooleanProperty(args, FILE_APPEND); + TypedArrayType type = TypedArrayType::JSI_INVALID_ARRAY; + size_t length = 0; + JSIValue arrayBuffer = JSI::CreateUndefined(); + size_t byteOffset = 0; + uint8_t* arrayPtr = JSI::GetTypedArrayInfo(buffer, type, length, arrayBuffer, byteOffset); + ret = ERROR_CODE_PARAM; + if ((position < 0) || (arrayPtr == nullptr) || (type != TypedArrayType::JSI_UINT8_ARRAY)) { + JSI::ReleaseValueList(buffer, arrayBuffer, ARGS_END); + NativeapiCommon::FailCallBack(thisVal, args, ERROR_CODE_PARAM); + goto EXIT; + } + ret = WriteArrayFile(g_uriFullPath, arrayPtr, length, static_cast(position), append); + JSI::ReleaseValueList(buffer, arrayBuffer, ARGS_END); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); +EXIT: + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} +#endif +} + +void InitNativeApiFs(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "move", NativeapiFs::MoveFile); + JSI::SetModuleAPI(exports, "copy", NativeapiFs::CopyFile); + JSI::SetModuleAPI(exports, "delete", NativeapiFs::DeleteFile); + JSI::SetModuleAPI(exports, "list", NativeapiFs::GetFileList); + JSI::SetModuleAPI(exports, "get", NativeapiFs::GetFileInfo); + JSI::SetModuleAPI(exports, "readText", NativeapiFs::ReadTextFile); + JSI::SetModuleAPI(exports, "writeText", NativeapiFs::WriteTextFile); + JSI::SetModuleAPI(exports, "access", NativeapiFs::Access); + JSI::SetModuleAPI(exports, "mkdir", NativeapiFs::CreateDir); + JSI::SetModuleAPI(exports, "rmdir", NativeapiFs::RemoveDir); + +#if (JS_FWK_TYPEDARRAY == NATIVE_FEATURE_ON) + JSI::SetModuleAPI(exports, "readArrayBuffer", NativeapiFs::ReadArrayFile); + JSI::SetModuleAPI(exports, "writeArrayBuffer", NativeapiFs::WriteArrayFile); +#endif +} + +JSIValue NativeapiFs::MoveFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteCopyFile, true); +} + +JSIValue NativeapiFs::CopyFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteCopyFile); +} + +JSIValue NativeapiFs::DeleteFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteDeleteAccess, true); +} + +JSIValue NativeapiFs::GetFileList(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteGetFileList, true); +} + +JSIValue NativeapiFs::GetFileInfo(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteGetFileInfo); +} + +JSIValue NativeapiFs::WriteTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteWriteTextFile); +} + +JSIValue NativeapiFs::ReadTextFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteReadTextFile); +} + +JSIValue NativeapiFs::Access(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteDeleteAccess); +} + +JSIValue NativeapiFs::CreateDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteDirFunc, true); +} + +JSIValue NativeapiFs::RemoveDir(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteDirFunc); +} + +#if (JS_FWK_TYPEDARRAY == NATIVE_FEATURE_ON) +JSIValue NativeapiFs::ReadArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteReadArrayFile); +} + +JSIValue NativeapiFs::WriteArrayFile(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteWriteArrayFile); +} +#endif +} // ACELite +} // OHOS diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp new file mode 100644 index 000000000..ae7052fb3 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/filekit/src/nativeapi_fs_impl.cpp @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "nativeapi_fs_impl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "nativeapi_config.h" +#if (defined _WIN32 || defined _WIN64) +#include "shlwapi.h" +#endif + +#define BUFFER_SIZE 512 + +static bool IsValidPath(const char* path) +{ + if (path == NULL) { + return false; + } + size_t pathLen = strnlen(path, FILE_NAME_MAX_LEN + 1); + if ((pathLen == 0) || (pathLen > FILE_NAME_MAX_LEN)) { + return false; + } + return true; +} + +static int GetRealPath(const char* originPath, char* trustPath, size_t tPathLen) +{ +#if (defined _WIN32 || defined _WIN64) + if (PathCanonicalize(trustPath, originPath)) { + return NATIVE_SUCCESS; + } +#else + if (realpath(originPath, trustPath) != NULL) { + return NATIVE_SUCCESS; + } +#endif + + if (errno == ENOENT) { + if (strncpy_s(trustPath, tPathLen, originPath, strlen(originPath)) == EOK) { + return NATIVE_SUCCESS; + } + } + return ERROR_CODE_GENERAL; +} + +static int RmdirRecursive(const char* fileName) +{ + if (!IsValidPath(fileName)) { + return ERROR_CODE_PARAM; + } + int ret = ERROR_CODE_GENERAL; + DIR* fileDir = opendir(fileName); + if (fileDir == NULL) { + return ret; + } + struct dirent* dir = readdir(fileDir); + struct stat info = { 0 }; + char* fullPath = (char *)malloc(FILE_NAME_MAX_LEN + 1); + if (fullPath == NULL) { + goto MALLOC_ERROR; + } + while (dir != NULL) { + if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) { + dir = readdir(fileDir); + continue; + } + if (memset_s(fullPath, FILE_NAME_MAX_LEN + 1, 0x0, FILE_NAME_MAX_LEN + 1) != EOK) { + goto EXIT; + } + if (sprintf_s(fullPath, FILE_NAME_MAX_LEN + 1, "%s/%s", fileName, dir->d_name) < 0) { + goto EXIT; + } + if (stat(fullPath, &info) != 0) { + goto EXIT; + } + if (S_ISDIR(info.st_mode)) { + ret = RmdirRecursive(fullPath); + } else { + ret = unlink(fullPath); + } + if (ret != NATIVE_SUCCESS) { + goto EXIT; + } + dir = readdir(fileDir); + } + ret = rmdir(fileName); + +EXIT: + free(fullPath); +MALLOC_ERROR: + closedir(fileDir); + return ret; +} + +static int MakeParent(const char* path, char* firstPath, size_t fPathLen, int* dirNum) +{ + size_t pathLen = strlen(path) + 1; + char* fullPath = (char *)malloc(pathLen); + if (fullPath == NULL) { + return ERROR_CODE_GENERAL; + } + if (strcpy_s(fullPath, pathLen, path) != EOK) { + free(fullPath); + return ERROR_CODE_GENERAL; + } + int ret = NATIVE_SUCCESS; + if (AccessImpl(fullPath) != NATIVE_SUCCESS) { + char* sep = strrchr(fullPath, '/'); + if (sep != NULL) { + *sep = 0; + MakeParent(fullPath, firstPath, fPathLen, dirNum); + *sep = '/'; + } + (*dirNum)++; + if (*dirNum > DIR_LEVEL) { + free(fullPath); + return ERROR_CODE_PARAM; + } +#if (defined _WIN32 || defined _WIN64) + ret = mkdir(fullPath); +#else + ret = mkdir(fullPath, S_IRUSR | S_IWUSR | S_IXUSR); +#endif + if ((ret == NATIVE_SUCCESS) && (*dirNum == 1)) { + if ((strcpy_s(firstPath, fPathLen, fullPath) != EOK)) { + free(fullPath); + return ERROR_CODE_GENERAL; + } + } + } + free(fullPath); + return ret; +} + +static int MkdirRecursive(const char* path) +{ + char* firstPath = (char *)malloc(FILE_NAME_MAX_LEN + 1); + if (firstPath == NULL) { + return ERROR_CODE_GENERAL; + } + if (memset_s(firstPath, FILE_NAME_MAX_LEN + 1, 0x0, FILE_NAME_MAX_LEN + 1) != EOK) { + free(firstPath); + return ERROR_CODE_GENERAL; + } + int dirNum = 0; + int ret = MakeParent(path, firstPath, FILE_NAME_MAX_LEN + 1, &dirNum); + if (ret != NATIVE_SUCCESS) { + RmdirRecursive(firstPath); + } + free(firstPath); + return ret; +} + +static int DoCopyFile(int fdSrc, int fdDest) +{ + char* dataBuf = (char *)malloc(BUFFER_SIZE); + if (dataBuf == NULL) { + return ERROR_CODE_GENERAL; + } + int nLen = read(fdSrc, dataBuf, BUFFER_SIZE); + while (nLen > 0) { + if (write(fdDest, dataBuf, nLen) != nLen) { + free(dataBuf); + return ERROR_CODE_IO; + } + nLen = read(fdSrc, dataBuf, BUFFER_SIZE); + } + free(dataBuf); + return (nLen < 0) ? ERROR_CODE_IO : NATIVE_SUCCESS; +} + +int StatImpl(const char* path, struct stat* buf) +{ + if (!IsValidPath(path) || (buf == NULL)) { + return ERROR_CODE_PARAM; + } + + if (stat(path, buf) != NATIVE_SUCCESS) { + return (-errno); + } + return NATIVE_SUCCESS; +} + +int DeleteFileImpl(const char* src) +{ + if (!IsValidPath(src)) { + return ERROR_CODE_PARAM; + } + + if (unlink(src) != NATIVE_SUCCESS) { + return (-errno); + } + return NATIVE_SUCCESS; +} + +int CopyFileImpl(const char* src, const char* dest) +{ + if (!IsValidPath(src) || !IsValidPath(dest)) { + return ERROR_CODE_PARAM; + } + char* realSrc = (char *)malloc(PATH_MAX); + if (realSrc == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(src, realSrc, PATH_MAX) != NATIVE_SUCCESS) { + free(realSrc); + return ERROR_CODE_GENERAL; + } + int fdSrc = open(realSrc, O_RDONLY, S_IRUSR); + free(realSrc); + realSrc = NULL; + if (fdSrc < 0) { + return (-errno); + } + char* realDest = (char *)malloc(PATH_MAX); + if (realDest == NULL) { + close(fdSrc); + return ERROR_CODE_GENERAL; + } + if (GetRealPath(dest, realDest, PATH_MAX) != NATIVE_SUCCESS) { + close(fdSrc); + free(realDest); + return ERROR_CODE_GENERAL; + } + int fdDest = open(realDest, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + free(realDest); + realDest = NULL; + if (fdDest < 0) { + close(fdSrc); + return (-errno); + } + int ret = DoCopyFile(fdSrc, fdDest); + close(fdSrc); + close(fdDest); + if (ret != NATIVE_SUCCESS) { + unlink(dest); + } + return ret; +} + +int WriteTextFile(const char* fileName, const void* buf, size_t len, bool append) +{ + if (!IsValidPath(fileName) || (buf == NULL)) { + return ERROR_CODE_PARAM; + } + char* resolvePath = (char *)malloc(PATH_MAX); + if (resolvePath == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(fileName, resolvePath, PATH_MAX) != NATIVE_SUCCESS) { + free(resolvePath); + return ERROR_CODE_GENERAL; + } + int fileHandle = -1; + if (append) { + fileHandle = open(resolvePath, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); + } else { + fileHandle = open(resolvePath, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + } + free(resolvePath); + if (fileHandle < 0) { + return (-errno); + } + int writeLen = write(fileHandle, buf, len); + close(fileHandle); + return (writeLen != len) ? ERROR_CODE_IO : NATIVE_SUCCESS; +} + +int WriteArrayFile(const char* fileName, const void* buf, size_t len, unsigned int position, bool append) +{ + if (!IsValidPath(fileName) || (buf == NULL)) { + return ERROR_CODE_PARAM; + } + char* resolvePath = (char *)malloc(PATH_MAX); + if (resolvePath == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(fileName, resolvePath, PATH_MAX) != NATIVE_SUCCESS) { + free(resolvePath); + return ERROR_CODE_GENERAL; + } + int fileHandle = -1; + if (append) { + fileHandle = open(resolvePath, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); + free(resolvePath); + resolvePath = NULL; + if (fileHandle < 0) { + return (-errno); + } + } else { + fileHandle = open(resolvePath, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); + free(resolvePath); + resolvePath = NULL; + if (fileHandle < 0) { + return (-errno); + } + if (lseek(fileHandle, position, SEEK_SET) != position) { + close(fileHandle); + return ERROR_CODE_IO; + } + } + int writeLen = write(fileHandle, buf, len); + close(fileHandle); + return (writeLen != len) ? ERROR_CODE_IO : NATIVE_SUCCESS; +} + +int ReadFileImpl(const char* fileName, void* text, size_t len, unsigned int position, size_t* actualLen) +{ + if (!IsValidPath(fileName) || (text == NULL)) { + return ERROR_CODE_PARAM; + } + char* resolvePath = (char *)malloc(PATH_MAX); + if (resolvePath == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(fileName, resolvePath, PATH_MAX) != NATIVE_SUCCESS) { + free(resolvePath); + return ERROR_CODE_GENERAL; + } + int fileHandle = open(resolvePath, O_RDONLY, S_IRUSR); + free(resolvePath); + resolvePath = NULL; + if (fileHandle < 0) { + return (-errno); + } + struct stat info = { 0 }; + if (fstat(fileHandle, &info) != 0) { + close(fileHandle); + return ERROR_CODE_IO; + } + if (position >= info.st_size) { + close(fileHandle); + return ERROR_CODE_PARAM; + } + if (len == 0) { + len = info.st_size - position; + } + if (lseek(fileHandle, position, SEEK_SET) != position) { + close(fileHandle); + return ERROR_CODE_IO; + } + int readLen = read(fileHandle, text, len); + close(fileHandle); + *actualLen = readLen; + return (readLen < 0) ? ERROR_CODE_IO : NATIVE_SUCCESS; +} + +int GetFileListImpl(const char* dirName, FileMetaInfo* fileList, unsigned int listNum) +{ + if (!IsValidPath(dirName) || (fileList == NULL)) { + return ERROR_CODE_PARAM; + } + int ret = ERROR_CODE_GENERAL; + DIR* fileDir = opendir(dirName); + if (fileDir == NULL) { + return ret; + } + int fileIndex = 0; + struct dirent* dir = readdir(fileDir); + struct stat fileStat = { 0 }; + char* fullFileName = (char *)malloc(FILE_NAME_MAX_LEN + 1); + if (fullFileName == NULL) { + goto EXIT; + } + while ((dir != NULL) && (fileIndex < listNum)) { + if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) { + dir = readdir(fileDir); + continue; + } + if (memset_s(fullFileName, FILE_NAME_MAX_LEN + 1, 0x0, FILE_NAME_MAX_LEN + 1) != EOK) { + goto EXIT; + } + if (sprintf_s(fullFileName, FILE_NAME_MAX_LEN + 1, "%s/%s", dirName, dir->d_name) < 0) { + goto EXIT; + } + if (stat(fullFileName, &fileStat) != 0) { + goto EXIT; + } + if (strcpy_s(fileList[fileIndex].fileName, FILE_NAME_MAX_LEN + 1, fullFileName) != EOK) { + goto EXIT; + } + fileList[fileIndex].fileSize = fileStat.st_size; + fileList[fileIndex].fileMtime = fileStat.st_mtime; + fileList[fileIndex].fileMode = fileStat.st_mode; + fileIndex++; + dir = readdir(fileDir); + } + ret = NATIVE_SUCCESS; +EXIT: + free(fullFileName); + closedir(fileDir); + return ret; +} + +int GetFileNum(const char* dirName) +{ + int ret = AccessImpl(dirName); + if (ret != NATIVE_SUCCESS) { + return ret; + } + DIR* fileDir = opendir(dirName); + if (fileDir == NULL) { + return ERROR_CODE_PARAM; + } + struct dirent* dir = readdir(fileDir); + int sum = 0; + while (dir != NULL) { + if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) { + dir = readdir(fileDir); + continue; + } + sum++; + dir = readdir(fileDir); + } + closedir(fileDir); + return (sum == 0) ? ERROR_CODE_IO : sum; +} + +int AccessImpl(const char* fileName) +{ + if (!IsValidPath(fileName)) { + return ERROR_CODE_PARAM; + } + if (access(fileName, F_OK) == F_OK) { + return NATIVE_SUCCESS; + } + return (-errno); +} + +int CreateDirImpl(const char* fileName, bool recursive) +{ + if (!IsValidPath(fileName)) { + return ERROR_CODE_PARAM; + } + if (AccessImpl(fileName) == NATIVE_SUCCESS) { + return NATIVE_SUCCESS; + } + if (recursive) { + return MkdirRecursive(fileName); + } +#if (defined _WIN32 || defined _WIN64) + int ret = mkdir(fileName); +#else + int ret = mkdir(fileName, S_IRUSR | S_IWUSR | S_IXUSR); +#endif + if (ret != NATIVE_SUCCESS) { + return (-errno); + } + return NATIVE_SUCCESS; +} + +int RemoveDirImpl(const char* fileName, bool recursive) +{ + int ret = AccessImpl(fileName); + if (ret != NATIVE_SUCCESS) { + return ret; + } + if (recursive) { + return RmdirRecursive(fileName); + } + if (rmdir(fileName) != NATIVE_SUCCESS) { + return (-errno); + } + return NATIVE_SUCCESS; +} \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv.h new file mode 100644 index 000000000..78ec3067f --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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. + */ + +#ifndef JS_NATIVE_API_KV_H +#define JS_NATIVE_API_KV_H + +#include "jsi/jsi.h" + +namespace OHOS { +namespace ACELite { +class NativeapiKv { +public: + NativeapiKv() = default; + ~NativeapiKv() = default; + + static JSIValue Get(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue Set(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue Delete(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue Clear(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); +}; +} // ACELite +} // OHOS +#endif // JS_NATIVE_API_KV_H \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/debugger.h b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv_impl.h similarity index 53% rename from code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/debugger.h rename to code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv_impl.h index e229e25ec..3efa8891f 100644 --- a/code/sdk/open_source/openharmony/third_party/jerryscript/include/jerryext/jerryscript-ext/debugger.h +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/include/nativeapi_kv_impl.h @@ -1,5 +1,5 @@ -/* Copyright JS Foundation and other contributors, http://js.foundation - * +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. * 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 @@ -7,38 +7,34 @@ * 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 + * 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. */ -#ifndef JERRYX_DEBUGGER_H -#define JERRYX_DEBUGGER_H - -#include "jerryscript.h" -#include "jerryscript-debugger-transport.h" +#ifndef JS_FS_KV_API_H +#define JS_FS_KV_API_H #ifdef __cplusplus -extern "C" -{ +#if __cplusplus +extern "C" { +#endif #endif /* __cplusplus */ -void jerryx_debugger_after_connect (bool success); +#define KEY_MAX_LEN 32 +#define VALUE_MAX_LEN 128 -/* - * Message transmission interfaces. - */ -bool jerryx_debugger_tcp_create (uint16_t port); -bool jerryx_debugger_serial_create (const char *config); - -/* - * Message encoding interfaces. - */ -bool jerryx_debugger_ws_create (void); -bool jerryx_debugger_rp_create (void); +int InitKv(const char* dataPath); +int GetValue(const char* key, char* value); +int SetValue(const char* key, const char* value); +int DeleteValue(const char* key); +int ClearKVStore(const char* dataPath); #ifdef __cplusplus +#if __cplusplus } +#endif #endif /* __cplusplus */ -#endif /* !JERRYX_HANDLER_H */ + +#endif /* JS_FS_KV_API_H */ \ No newline at end of file diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv.cpp b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv.cpp new file mode 100644 index 000000000..b7c4676e6 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "nativeapi_kv.h" +#include +#include +#include "ace_log.h" +#include "ability_env.h" +#include "js_async_work.h" +#include "nativeapi_common.h" +#include "nativeapi_config.h" +#include "nativeapi_kv_impl.h" + +namespace OHOS { +namespace ACELite { +namespace { +char g_kvFullPath[FILE_NAME_MAX_LEN + 1] = {0}; + +bool IsValidKey(const char* key) +{ + if (key == nullptr) { + return false; + } + size_t keyLen = strnlen(key, KEY_MAX_LEN + 1); + if ((keyLen == 0) || (keyLen > KEY_MAX_LEN)) { + return false; + } + if (strpbrk(key, "/\\\"*+,:;<=>\?[]|\x7F")) { + return false; + } + return true; +} + +int GetFullPath(const char* dataPath, const char* key) +{ + if (!IsValidKey(key) || (dataPath == nullptr)) { + return ERROR_CODE_PARAM; + } + if (memset_s(g_kvFullPath, sizeof(g_kvFullPath), 0x0, sizeof(g_kvFullPath)) != EOK) { + return ERROR_CODE_GENERAL; + } + if (sprintf_s(g_kvFullPath, sizeof(g_kvFullPath), "%s/%s/%s", dataPath, DEFAULT_FOLDER_PATH, key) < 0) { + return ERROR_CODE_GENERAL; + } + return NATIVE_SUCCESS; +} + +void GetDefault(const JSIValue thisVal, const JSIValue args) +{ + char* defaultValue = JSI::GetStringProperty(args, DEFAULT); + JSIValue result; + if (defaultValue == nullptr) { + result = JSI::CreateString(""); + } else { + result = JSI::CreateString(defaultValue); + } + JSI::ReleaseString(defaultValue); + NativeapiCommon::SuccessCallBack(thisVal, args, result); + JSI::ReleaseValue(result); +} + +int GetValueInner(const char* dataPath, const char* key, char* value) +{ + int ret = GetFullPath(dataPath, key); + if (ret != NATIVE_SUCCESS) { + return ret; + } + return GetValue(g_kvFullPath, value); +} + +int SetValueInner(const char* dataPath, const char* key, const char* value) +{ + int ret = GetFullPath(dataPath, key); + if (ret != NATIVE_SUCCESS) { + return ret; + } + return SetValue(g_kvFullPath, value); +} + +int DeleteValueInner(const char* dataPath, const char* key) +{ + int ret = GetFullPath(dataPath, key); + if (ret != NATIVE_SUCCESS) { + return ret; + } + return DeleteValue(g_kvFullPath); +} + +JSIValue ExecuteAsyncWork(const JSIValue thisVal, const JSIValue* args, + uint8_t argsNum, AsyncWorkHandler ExecuteFunc, bool flag) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if (!NativeapiCommon::IsValidJSIValue(args, argsNum)) { + return undefValue; + } + FuncParams* params = new(std::nothrow) FuncParams(); + if (params == nullptr) { + return undefValue; + } + params->thisVal = JSI::AcquireValue(thisVal); + params->args = JSI::AcquireValue(args[0]); + params->flag = flag; + JsAsyncWork::DispatchAsyncWork(ExecuteFunc, reinterpret_cast(params)); + return undefValue; +} + +void ExecuteGet(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* key = JSI::GetStringProperty(args, KV_KEY); + const char* dataPath = GetDataPath(); + JSIValue result = JSI::CreateUndefined(); + int ret = ERROR_CODE_GENERAL; + char* value = reinterpret_cast(malloc(VALUE_MAX_LEN + 1)); + if (value == nullptr) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = InitKv(dataPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + ret = GetValueInner(dataPath, key, value); + if (ret == ERROR_FR_NO_FILE) { + GetDefault(thisVal, args); + goto EXIT; + } + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + result = JSI::CreateString(value); + NativeapiCommon::SuccessCallBack(thisVal, args, result); +EXIT: + free(value); + JSI::ReleaseString(key); + JSI::ReleaseValueList(args, thisVal, result, ARGS_END); + delete params; +} + +void ExecuteSet(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + char* key = JSI::GetStringProperty(args, KV_KEY); + char* value = JSI::GetStringProperty(args, KV_VALUE); + const char* dataPath = GetDataPath(); + int ret = InitKv(dataPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + if ((key == nullptr) || !strlen(key)) { + NativeapiCommon::FailCallBack(thisVal, args, ERROR_CODE_PARAM); + goto EXIT; + } + if ((value == nullptr) || !strlen(value)) { + DeleteValueInner(dataPath, key); + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); + goto EXIT; + } + ret = SetValueInner(dataPath, key, value); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + goto EXIT; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); +EXIT: + JSI::ReleaseString(key); + JSI::ReleaseString(value); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} + +void ExecuteDelete(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + const char* dataPath = GetDataPath(); + int ret = InitKv(dataPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; + return; + } + char* key = JSI::GetStringProperty(args, KV_KEY); + ret = DeleteValueInner(dataPath, key); + JSI::ReleaseString(key); + if ((ret < 0) && (ret != ERROR_FR_NO_FILE)) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; + return; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} + +void ExecuteClear(void* data) +{ + FuncParams* params = reinterpret_cast(data); + if (params == nullptr) { + return; + } + JSIValue args = params->args; + JSIValue thisVal = params->thisVal; + const char* dataPath = GetDataPath(); + int ret = InitKv(dataPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; + return; + } + ret = ClearKVStore(dataPath); + if (ret != NATIVE_SUCCESS) { + NativeapiCommon::FailCallBack(thisVal, args, ret); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; + return; + } + NativeapiCommon::SuccessCallBack(thisVal, args, JSI::CreateUndefined()); + JSI::ReleaseValueList(args, thisVal, ARGS_END); + delete params; +} +} + +void InitNativeApiKv(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "get", NativeapiKv::Get); + JSI::SetModuleAPI(exports, "set", NativeapiKv::Set); + JSI::SetModuleAPI(exports, "delete", NativeapiKv::Delete); + JSI::SetModuleAPI(exports, "clear", NativeapiKv::Clear); +} + +JSIValue NativeapiKv::Get(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteGet, false); +} + +JSIValue NativeapiKv::Set(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteSet, false); +} + +JSIValue NativeapiKv::Delete(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + return ExecuteAsyncWork(thisVal, args, argsNum, ExecuteDelete, false); +} + +JSIValue NativeapiKv::Clear(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + JSIValue undefValue = JSI::CreateUndefined(); + FuncParams* params = new(std::nothrow) FuncParams(); + if (params == nullptr) { + return undefValue; + } + params->thisVal = JSI::AcquireValue(thisVal); + if (NativeapiCommon::IsValidJSIValue(args, argsNum)) { + params->args = JSI::AcquireValue(args[0]); + } + JsAsyncWork::DispatchAsyncWork(reinterpret_cast(ExecuteClear), reinterpret_cast(params)); + return undefValue; +} +} // ACELite +} // OHOS diff --git a/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv_impl.cpp b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv_impl.cpp new file mode 100644 index 000000000..331c01ff7 --- /dev/null +++ b/code/sdk/open_source/openharmony/utils/native/lite/js/builtin/kvstorekit/src/nativeapi_kv_impl.cpp @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 "nativeapi_kv_impl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "nativeapi_config.h" +#if (defined _WIN32 || defined _WIN64) +#include "shlwapi.h" +#endif + +static char g_kvFolder[FILE_NAME_MAX_LEN + 1] = {0}; + +static bool IsValidValue(const char* value) +{ + if (value == NULL) { + return false; + } + size_t valueLen = strnlen(value, VALUE_MAX_LEN + 1); + if ((valueLen == 0) || (valueLen > VALUE_MAX_LEN)) { + return false; + } + return true; +} + +static int GetKvFolder(const char* dataPath) +{ + if (dataPath == NULL) { + return ERROR_CODE_PARAM; + } + if (memset_s(g_kvFolder, sizeof(g_kvFolder), 0x0, sizeof(g_kvFolder)) != EOK) { + return ERROR_CODE_GENERAL; + } + if (sprintf_s(g_kvFolder, sizeof(g_kvFolder), "%s/%s", dataPath, DEFAULT_FOLDER_PATH) < 0) { + return ERROR_CODE_GENERAL; + } + return NATIVE_SUCCESS; +} + +static int GetRealPath(const char* originPath, char* trustPath, size_t tPathLen) +{ +#if (defined _WIN32 || defined _WIN64) + if (PathCanonicalize(trustPath, originPath)) { + return NATIVE_SUCCESS; + } +#else + if (realpath(originPath, trustPath) != NULL) { + return NATIVE_SUCCESS; + } +#endif + + if (errno == ENOENT) { + if (strncpy_s(trustPath, tPathLen, originPath, strlen(originPath)) == EOK) { + return NATIVE_SUCCESS; + } + } + return ERROR_CODE_GENERAL; +} + +int InitKv(const char* dataPath) +{ + int ret = GetKvFolder(dataPath); + if (ret != NATIVE_SUCCESS) { + return ret; + } + if (access(g_kvFolder, F_OK) == F_OK) { + return NATIVE_SUCCESS; + } +#if (defined _WIN32 || defined _WIN64) + if (mkdir(g_kvFolder) != 0) { + return ERROR_CODE_GENERAL; + } +#else + if (mkdir(g_kvFolder, S_IRUSR | S_IWUSR | S_IXUSR) != 0) { + return ERROR_CODE_GENERAL; + } +#endif + return NATIVE_SUCCESS; +} + +int GetValue(const char* key, char* value) +{ + if ((key == NULL) || (value == NULL)) { + return ERROR_CODE_PARAM; + } + char* resolvePath = (char *)malloc(PATH_MAX); + if (resolvePath == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(key, resolvePath, PATH_MAX) != NATIVE_SUCCESS) { + free(resolvePath); + return ERROR_CODE_GENERAL; + } + int fileHandle = open(resolvePath, O_RDONLY, S_IRUSR); + free(resolvePath); + resolvePath = NULL; + if (fileHandle < 0) { + return (-errno); + } + int readLen = read(fileHandle, value, VALUE_MAX_LEN); + close(fileHandle); + fileHandle = -1; + if (readLen < 0) { + return ERROR_CODE_IO; + } + value[readLen] = '\0'; + return NATIVE_SUCCESS; +} + +int SetValue(const char* key, const char* value) +{ + if ((key == NULL) || (!IsValidValue(value))) { + return ERROR_CODE_PARAM; + } + char* resolvePath = (char *)malloc(PATH_MAX); + if (resolvePath == NULL) { + return ERROR_CODE_GENERAL; + } + if (GetRealPath(key, resolvePath, PATH_MAX) != NATIVE_SUCCESS) { + free(resolvePath); + return ERROR_CODE_GENERAL; + } + int fd = open(resolvePath, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + free(resolvePath); + resolvePath = NULL; + if (fd < 0) { + return (-errno); + } + int ret = write(fd, value, strlen(value)); + close(fd); + return (ret < 0) ? ERROR_CODE_IO : NATIVE_SUCCESS; +} + +int DeleteValue(const char* key) +{ + if (key == NULL) { + return ERROR_CODE_PARAM; + } + if (unlink(key) != NATIVE_SUCCESS) { + return (-errno); + } + return NATIVE_SUCCESS; +} + +int ClearKVStore(const char* dataPath) +{ + int ret = GetKvFolder(dataPath); + if (ret != NATIVE_SUCCESS) { + return ret; + } + ret = ERROR_CODE_GENERAL; + DIR* fileDir = opendir(g_kvFolder); + if (fileDir == NULL) { + return ret; + } + struct dirent* dir = readdir(fileDir); + char* fullPath = (char *)malloc(FILE_NAME_MAX_LEN + 1); + if (fullPath == NULL) { + goto EXIT; + } + while (dir != NULL) { + if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) { + dir = readdir(fileDir); + continue; + } + if (memset_s(fullPath, FILE_NAME_MAX_LEN + 1, 0x0, FILE_NAME_MAX_LEN + 1) != EOK) { + goto EXIT; + } + if (sprintf_s(fullPath, FILE_NAME_MAX_LEN + 1, "%s/%s", g_kvFolder, dir->d_name) < 0) { + goto EXIT; + } + if (unlink(fullPath) != 0) { + goto EXIT; + } + dir = readdir(fileDir); + } + ret = NATIVE_SUCCESS; +EXIT: + free(fullPath); + closedir(fileDir); + return ret; +} \ No newline at end of file diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin index 433f104af..0fa89884a 100644 Binary files a/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin and b/code/sdk/tools/pkg/bin/brandy/dsp/max/dsp_main.bin differ diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin index 09a9793d0..c66cf33b2 100644 Binary files a/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin and b/code/sdk/tools/pkg/bin/brandy/dsp/mini/dsp_main.bin differ diff --git a/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin b/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin index 3de0c7f6d..7c4ebc4f7 100644 Binary files a/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin and b/code/sdk/tools/pkg/bin/brandy/dsp/normal/dsp_main.bin differ diff --git a/code/sdk/tools/pkg/bin/brandy/ssb.bin b/code/sdk/tools/pkg/bin/brandy/ssb.bin index 965aeb3f0..c6a9dec43 100644 Binary files a/code/sdk/tools/pkg/bin/brandy/ssb.bin and b/code/sdk/tools/pkg/bin/brandy/ssb.bin differ diff --git a/code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg b/code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg index 6b9a1e1bb..0e9600024 100644 Binary files a/code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg and b/code/sdk/tools/pkg/fwpkg/brandy/upload_app.fwpkg differ diff --git a/tools/ace-loader/jerry-snapshot.exe b/tools/ace-loader/jerry-snapshot.exe new file mode 100644 index 000000000..895c74cb5 Binary files /dev/null and b/tools/ace-loader/jerry-snapshot.exe differ diff --git a/tools/ace-loader/jerry.exe b/tools/ace-loader/jerry.exe new file mode 100644 index 000000000..3bdadfba0 Binary files /dev/null and b/tools/ace-loader/jerry.exe differ diff --git a/tools/dial_converter_tool/README.txt b/tools/dial_converter_tool/README.txt new file mode 100644 index 000000000..58d2c0f96 --- /dev/null +++ b/tools/dial_converter_tool/README.txt @@ -0,0 +1,11 @@ +usage: main.py [-h] [-file FILE] [-dir DIR] [-output OUTPUT] + +options: + -h, --help show this help message and exit + -file FILE, -f FILE The svg file need to be converted. + -dir DIR, -d DIR The directory needs to be converted. + -output OUTPUT output dir + +example: +windows: python .\main.py -dir .\instance\analogue_dial +windows: python .\main.py -dir .\instance\kaleidoscope_dial \ No newline at end of file diff --git a/tools/dial_converter_tool/common_types.py b/tools/dial_converter_tool/common_types.py new file mode 100644 index 000000000..444fc6edc --- /dev/null +++ b/tools/dial_converter_tool/common_types.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from enum import Enum +from ctypes import * + +class Point(Structure): + _fields_ = [ + ('x', c_short), + ('y', c_short), + ] + +class Rect(Structure): + _fields_ = [ + ('x', c_short), + ('y', c_short), + ('w', c_ushort), + ('h', c_ushort) + ] + +class ColorStop(Structure): + _fields_ = [ + ('stop', c_float), + ('color', c_uint), + ] \ No newline at end of file diff --git a/tools/dial_converter_tool/converter.py b/tools/dial_converter_tool/converter.py new file mode 100644 index 000000000..502ed3561 --- /dev/null +++ b/tools/dial_converter_tool/converter.py @@ -0,0 +1,184 @@ +#!/usr/bin/python +# coding: utf-8 +import os +import re +import struct +import ctypes +from ctypes import * +import xml.sax +from enum import Enum +import img_convert +import video_convert +from dial_static_img import DialStaticImg +from dial_sequence_img import DialSequenceImg +from dial_rotate_img import DialRotateImg +from dial_option_img import DialOptionImg +from dial_digital_img import DialDigitalImg +from dial_label import DialLabel +from dial_arc_label import DialArcLabel +from dial_box_progress import DialBoxProgress +from dial_arc_progress import DialArcProgress +from dial_video import DialVideo +from dial_click import DialClick +from dial_kaleidoscope import DialKaleidoscope + +class DialHeader(Structure): + _fields_ = [ + ('dialName', c_char * 16), + ('width', c_short), + ('height', c_short), + ('version', c_char * 16), + ('previewImgId', c_ushort), + ('description', c_char * 128), + ('imgoffset', c_uint), + ('period', c_ubyte), + ('dialViewCount', c_ubyte), + ] + + def __init__(self): + self.imgoffset = 0 + self.dialViewCount = 0 + self.period = 0 + self.viewType = [] + self.viewPt = [] + + def parse_attributes(self, attributes): + title = attributes["title"] + self.dialName = bytes(title, encoding = "utf8") + + description = attributes["description"] + self.description = bytes(description, encoding = "utf8") + + size = attributes["size"] + width,height = size.split(' ') + self.width = int(width) + self.height = int(height) + + version = attributes["version"] + self.version = bytes(version, encoding = "utf8") + + previewStr = attributes["preview_img"] + self.previewImgId = img_convert.instance.convert_img(previewStr) + + for attr in attributes.getNames(): + if attr == "tile_width": + tile_width = int(attributes["tile_width"]) + img_conver.instance.set_tile_width(tile_width) + + def add_view(self, viewObj, viewType): + self.viewPt.append(viewObj) + self.viewType.append(viewType) + self.dialViewCount += 1 + + def get_bytes(self): + ret = bytes(self) + for index in range(self.dialViewCount): + ret += struct.pack('@b', self.viewType[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ubyte) * self.dialViewCount + +class DialConvertTool(xml.sax.ContentHandler): + parser = xml.sax.make_parser() + DIAL_STATIC_IMG_TYPE = 0 + DIAL_SEQUENCE_IMG_TYPE = 1 + DIAL_ROTATE_IMG_TYPE = 2 + DIAL_OPTION_IMG_TYPE = 3 + DIAL_DIGITAL_IMG_TYPE = 4 + DIAL_LABEL_TYPE = 5 + DIAL_ARC_LABEL_TYPE = 6 + DIAL_BOX_PROGRESS_TYPE = 7 + DIAL_ARC_PROGRESS_TYPE = 8 + DIAL_VIDEO_TYPE = 9 + DIAL_CLICK_TYPE = 10 + DIAL_KALEIDOSCCOPE_TYPE = 11 + + def __init__(self): + self.inFile = "" + self.outPath = "" + self.header = DialHeader() + self.parser.setFeature(xml.sax.handler.feature_namespaces, 0) + self.parser.setContentHandler(self) + + def startElement(self, tag, attributes): + viewTypeArray = [] + if tag == "dial": + self.header.parse_attributes(attributes) + elif tag == "static_img": + view = DialStaticImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_STATIC_IMG_TYPE) + elif tag == "sequence_img": + view = DialSequenceImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_SEQUENCE_IMG_TYPE) + elif tag == "rotate_img": + view = DialRotateImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ROTATE_IMG_TYPE) + elif tag == "option_img": + view = DialOptionImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_OPTION_IMG_TYPE) + elif tag == "digital_img": + view = DialDigitalImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_DIGITAL_IMG_TYPE) + elif tag == "label": + view = DialLabel() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_LABEL_TYPE) + elif tag == "arc_label": + view = DialArcLabel() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ARC_LABEL_TYPE) + elif tag == "box_progress": + view = DialBoxProgress() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_BOX_PROGRESS_TYPE) + elif tag == "arc_progress": + view = DialArcProgress() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ARC_PROGRESS_TYPE) + elif tag == "video": + view = DialVideo() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_VIDEO_TYPE) + elif tag == "click": + view = DialClick() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_CLICK_TYPE) + elif tag == "kaleidoscope": + view = DialKaleidoscope() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_KALEIDOSCCOPE_TYPE) + + def endElement(self, tag): + if tag == "dial": + # create & open dstfile + outputfile = self.outPath + "/" + os.path.basename(self.inFile)[:-3] + "bin" + fb = open(outputfile, 'wb') + os.chmod(outputfile, 0o0755) + self._write_data_to_bin(fb) + fb.close() + + def convert_xml_to_output(self, inFile, outPath): + self.inFile = inFile + self.outPath = outPath + self.parser.parse(inFile) + + def _write_data_to_bin(self, fb): + self.header.imgoffset += self.header.get_size() + for view in self.header.viewPt: + if self.header.period < view.period: + self.header.period = view.period + self.header.imgoffset += view.get_size() + + fb.write(self.header.get_bytes()) + for view in self.header.viewPt: + if isinstance(view, DialVideo): + view.offset += self.header.imgoffset + img_convert.instance.get_size() + fb.write(view.get_bytes()) + img_convert.instance.write_data_to_bin(fb) + video_convert.instance.write_data_to_bin(fb) diff --git a/tools/dial_converter_tool/dial_arc_label.py b/tools/dial_converter_tool/dial_arc_label.py new file mode 100644 index 000000000..5f493fab7 --- /dev/null +++ b/tools/dial_converter_tool/dial_arc_label.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point + +class DialArcLabel(Structure): + _fields_ = [ + ('align', c_ubyte), + ('fontSize', c_ubyte), + ('center', Point), + ('radius', c_ushort), + ('rotateStart', c_short), + ('rotaeteEnd', c_short), + ('color', c_uint), + ('fontName', c_char * 64), + ('text', c_char * 64), + ('bindData', c_short), + ('isPeriod', c_bool) + ] + def __init__(self): + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + alignStr = attributes["align"] + if alignStr == "bottom": + self.align = 4 + elif alignStr == "top": + self.align = 3 + elif alignStr == "center": + self.align = 2 + elif alignStr == "right": + self.align = 1 + else: + self.align = 0 + + self.fontSize = int(attributes["font_size"]) + + x,y = attributes["center"].split(" ") + self.center.x = int(x) + self.center.y = int(y) + + self.radius = int(attributes["radius"]) + self.rotateStart = int(attributes["start_angle"]) + self.rotaeteEnd = int(attributes["end_angle"]) + self.color = int(attributes["color"], 16) + self.fontName = bytes(attributes["font"], encoding = "utf8") + self.text = bytes(attributes["text"], encoding = "utf8") + for attr in attributes.getNames(): + if attr == "bind_data": + self.bindData = int(attributes["bind_data"]) + elif attr == "period": + self.period = int(attributes["period"]) + if self.period != 0: + self.isPeriod = True + if self.isPeriod != 0 and self.bindData == 0: + print("[ERROR]:[bind_data] is not set, [period] cannot be set") + sys.exit(1) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_arc_progress.py b/tools/dial_converter_tool/dial_arc_progress.py new file mode 100644 index 000000000..1ee9f56c2 --- /dev/null +++ b/tools/dial_converter_tool/dial_arc_progress.py @@ -0,0 +1,101 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +from common_types import ColorStop +import img_convert + +class ProgressUnion(Union): + _fields_ = [ + ('stopCount', c_ubyte), + ('imgId', c_ushort), + ('color', c_uint), + ] + +class DialArcProgress(Structure): + _fields_ = [ + ('cap', c_ubyte), + ('isPeriod', c_bool), + ('radius', c_ushort), + ('startAngle', c_ushort), + ('endAngle', c_ushort), + ('lineWidth', c_ushort), + ('bindData', c_short), + ('bgColor', c_uint), + ('type', c_ubyte), + ('rect', Rect), + ('unionValue', ProgressUnion) + ] + + def __init__(self): + self.stop = [] + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + self.rect.y = int(y) + self.rect.w = int(w) + self.rect.h = int(h) + + cap = attributes["cap_type"] + if cap == "round": + self.cap = 1 + else: + self.cap = 0 + + self.radius = int(attributes["radius"]) + self.startAngle = int(attributes["start_angle"]) + self.endAngle = int(attributes["end_angle"]) + self.lineWidth = int(attributes["line_width"]) + self.bindData = int(attributes["bind_data"]) + + attrList = attributes.getNames() + for attr in attrList: + if attr == "img_name": + self.unionValue.imgId = img_convert.instance.convert_img(attributes["img_name"]) + self.type = 0 + break + elif attr == "color": + self.unionValue.color = int(attributes["color"], 16) + self.type = 1 + break + elif attr == "gradient_colors": + self.type = 2 + stopList = attributes["gradient_stops"].split(" ") + colorList = attributes["gradient_colors"].split(" ") + if len(stopList) != len(colorList): + print("[ERROR]:[gradient_stops] attr not equal [colorList] attr") + self.unionValue.stopCount = min(len(colorList), len(stopList)) + for index in range(self.unionValue.stopCount): + colorStop = ColorStop() + colorStop.stop = float(stopList[index]) + colorStop.color = int(colorList[index], 16) + self.stop.append(colorStop) + break + + if "period" in attrList: + self.period = int(attributes["period"]) + if (self.period != 0): + self.isPeriod = True + + if "background_color" in attrList: + self.bgColor = int(attributes["background_color"], 16) + + def get_bytes(self): + ret = bytes(self) + if self.type == 2: + for stop in self.stop: + ret += bytes(stop) + return ret + + def get_size(self): + ret = sizeof(self) + if self.type == 2: + for stop in self.stop: + ret += sizeof(stop) + return ret \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_box_progress.py b/tools/dial_converter_tool/dial_box_progress.py new file mode 100644 index 000000000..b427fe6c0 --- /dev/null +++ b/tools/dial_converter_tool/dial_box_progress.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +from common_types import ColorStop +import img_convert + +class ProgressUnion(Union): + _fields_ = [ + ('stopCount', c_ubyte), + ('imgId', c_ushort), + ('color', c_uint), + ] + +class DialBoxProgress(Structure): + _fields_ = [ + ('cap', c_ubyte), + ('direction', c_ubyte), + ('isPeriod', c_bool), + ('bindData', c_short), + ('bgColor', c_uint), + ('type', c_ubyte), + ('rect', Rect), + ('unionValue', ProgressUnion) + ] + + def __init__(self): + self.stop = [] + self.isPeriod = False + self.period = 0 + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + self.rect.y = int(y) + self.rect.w = int(w) + self.rect.h = int(h) + + cap = attributes["cap_type"] + if cap == "round": + self.cap = 1 + else: + self.cap = 0 + + direction = attributes["direction"] + if direction == "left_to_right": + self.direction = 0 + elif direction == "right_to_left": + self.direction = 1 + elif direction == "top_to_bottom": + self.direction = 2 + elif direction == "bottom_to_top": + self.direction = 3 + + self.bindData = int(attributes["bind_data"]) + + attrList = attributes.getNames() + for attr in attrList: + if attr == "img_name": + self.unionValue.imgId = img_convert.instance.convert_img(attributes["img_name"]) + self.type = 0 + break + elif attr == "color": + self.unionValue.color = int(attributes["color"], 16) + self.type = 1 + break + elif attr == "gradient_colors": + stopList = attributes["gradient_stops"].split(" ") + colorList = attributes["gradient_colors"].split(" ") + if len(stopList) != len(colorList): + print("[ERROR]:[gradient_stops] attr not equal [colorList] attr") + self.unionValue.stopCount = min(len(colorList), len(stopList)) + for index in range(self.unionValue.stopCount): + colorStop = ColorStop() + colorStop.stop = float(stopList[index]) + colorStop.color = int(colorList[index], 16) + self.stop.append(colorStop) + self.type = 2 + break + + if "period" in attrList: + self.period = int(attributes["period"]) + if (self.period != 0) : + self.isPeriod = True + if "background_color" in attrList: + self.bgColor = int(attributes["background_color"], 16) + + def get_bytes(self): + ret = bytes(self) + if self.type == 2: + for stop in self.stop: + ret += bytes(stop) + return ret + + def get_size(self): + ret = sizeof(self) + if self.type == 2: + for stop in self.stop: + ret += sizeof(stop) + return ret \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_click.py b/tools/dial_converter_tool/dial_click.py new file mode 100644 index 000000000..957dd7d2a --- /dev/null +++ b/tools/dial_converter_tool/dial_click.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect + +class ClickTypeUnion(Union): + _fields_ = [ + ('sliceId', c_uint), + ('bundleName', c_char * 64) + ] + +class DialClick(Structure): + _fields_ = [ + ('type', c_ubyte), + ('rect', Rect), + ('unionType', ClickTypeUnion), + ] + + def __init__(self): + self.period = 0 + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + self.rect.y = int(y) + self.rect.w = int(w) + self.rect.h = int(h) + + for attr in attributes.getNames(): + if attr == "action_slice": + self.unionType.sliceId = int(attributes["action_slice"]) + self.type = 0 + break + elif attr == "action_bundle": + self.unionType.bundleName = bytes(attributes["action_bundle"], encoding = "utf8") + self.type = 1 + break + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_digital_img.py b/tools/dial_converter_tool/dial_digital_img.py new file mode 100644 index 000000000..a19c1b317 --- /dev/null +++ b/tools/dial_converter_tool/dial_digital_img.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialDigitalImg(Structure): + _fields_ = [ + ('alignType', c_ubyte, 4), + ('integerLength', c_ubyte, 4), + ('decimalPrecision', c_ubyte), + ('imgIds', c_ushort * 10), + ('signImgId', c_ushort), + ('decimalPointImgId', c_ushort), + ('space', c_ushort), + ('alignPosition', Point), + ('bindData', c_short), + ('isPeriod', c_bool) + ] + + def __init__(self): + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + imgNames = attributes["img_names"].split(",") + length = len(imgNames) + if length < 10: + print("[ERR]:tag:[digital_img] attr[img_names] less than 10!") + sys.exit(1) + else: + for index in range(10): + self.imgIds[index] = img_convert.instance.convert_img(imgNames[index]) + + self.space = int(attributes["space"]) + alignStr = attributes["align"] + if alignStr == "right": + self.alignType = 2 + elif alignStr == "center": + self.alignType = 1 + else: + self.alignType = 0 + x,y = attributes["align_pos"].split(" ") + self.alignPosition.x = int(x) + self.alignPosition.y = int(y) + self.bindData = int(attributes["bind_data"]) + + for attr in attributes.getNames(): + if attr == "sign_img_name": + signImgName = attributes["sign_img_name"] + self.signImgId = img_convert.instance.convert_img(signImgName) + elif attr == "integer_length": + self.integerLength = int(attributes["integer_length"]) + elif attr == "img_decimal_point": + decimalPointImgName = attributes["img_decimal_point"] + self.decimalPointImgId = img_convert.instance.convert_img(decimalPointImgName) + elif attr == "decimal_precision": + self.decimalPrecision = int(attributes["decimal_precision"]) + elif attr == "period": + self.period = int(attributes["period"]) + if self.period != 0: + self.isPeriod = True + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_kaleidoscope.py b/tools/dial_converter_tool/dial_kaleidoscope.py new file mode 100644 index 000000000..450a6dbfb --- /dev/null +++ b/tools/dial_converter_tool/dial_kaleidoscope.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +import img_convert + +class DialKaleidoscope(Structure): + _fields_ = [ + ('imgId', c_ushort), + ('rotateEventFactor', c_float), + ('rotateAnimatorValue', c_float) + ] + + def __init__(self): + self.imgId = 0 + self.rotateEventFactor = 1.0 + self.rotateAnimatorValue = 0.0 + self.period = 0 + + def parse_attributes(self, attributes): + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + for attr in attributes.getNames(): + if attr == "crown_rotate_step": + self.rotateEventFactor = float(attributes["crown_rotate_step"]) + elif attr == "animator_rotate_step": + self.rotateAnimatorValue = float(attributes["animator_rotate_step"]) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) diff --git a/tools/dial_converter_tool/dial_label.py b/tools/dial_converter_tool/dial_label.py new file mode 100644 index 000000000..a2549bf68 --- /dev/null +++ b/tools/dial_converter_tool/dial_label.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect + +class DialLabel(Structure): + _fields_ = [ + ('breakMode', c_ubyte), + ('align', c_ubyte), + ('fontSize', c_ubyte), + ('isPeriod', c_bool), + ('rect', Rect), + ('color', c_uint), + ('fontName', c_char * 64), + ('text', c_char * 64), + ('bindData', c_short) + ] + + def __init__(self): + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + self.rect.y = int(y) + self.rect.w = int(w) + self.rect.h = int(h) + + mode = attributes["break_mode"] + if mode == "adapt": + self.breakMode = 0 + elif mode == "stretch": + self.breakMode = 1 + elif mode == "wrap": + self.breakMode = 2 + elif mode == "ellipsis": + self.breakMode = 3 + elif mode == "marquee": + self.breakMode = 4 + elif mode == "clip": + self.breakMode = 5 + else: + self.breakMode = 3 + print("[WARING][label:break_mode]Incorrect input:", mode) + + alignStr = attributes["align"] + if alignStr == "bottom": + self.align = 4 + elif alignStr == "top": + self.align = 3 + elif alignStr == "center": + self.align = 2 + elif alignStr == "right": + self.align = 1 + elif alignStr == "left": + self.align = 0 + else: + self.align = 0 + print("[WARING][label:align]Incorrect input:", alignStr) + + self.fontSize = int(attributes["font_size"]) + self.color = int(attributes["color"], 16) + self.fontName = bytes(attributes["font"], encoding = "utf8") + self.text = bytes(attributes["text"], encoding = "utf8") + + for attr in attributes.getNames(): + if attr == "bind_data": + self.bindData = int(attributes["bind_data"]) + elif attr == "period": + self.period = int(attributes["period"]) + if self.period != 0: + self.isPeriod = True + if self.isPeriod != 0 and self.bindData == 0: + print("[ERROR]:[bind_data] is not set, [period] cannot be set") + sys.exit(1) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_option_img.py b/tools/dial_converter_tool/dial_option_img.py new file mode 100644 index 000000000..e5e318af4 --- /dev/null +++ b/tools/dial_converter_tool/dial_option_img.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialOptionImg(Structure): + _fields_ = [ + ('pos', Point), + ('bindData', c_short), + ('isPeriod', c_bool), + ('count', c_ubyte), + ] + + def __init__(self): + self.imgId = [] + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + x,y = attributes["position"].split(" ") + self.pos.x = int(x) + self.pos.y = int(y) + + self.bindData = int(attributes["bind_data"]) + + imgNames = attributes["img_names"].split(",") + self.count = len(imgNames) + for img in imgNames: + imgId = img_convert.instance.convert_img(img) + self.imgId.append(imgId) + + if "period" in attributes.getNames(): + self.period = int(attributes["period"]) + if self.period != 0: + self.isPeriod = True + + def get_bytes(self): + ret = bytes(self) + for index in range(self.count): + ret += struct.pack('@H', self.imgId[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ushort) * self.count \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_rotate_img.py b/tools/dial_converter_tool/dial_rotate_img.py new file mode 100644 index 000000000..a7d6e2e02 --- /dev/null +++ b/tools/dial_converter_tool/dial_rotate_img.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialRotateImg(Structure): + _fields_ = [ + ('pos', Point), + ('center', Point), + ('rotateStart', c_short), + ('rotaeteEnd', c_short), + ('imgId', c_ushort), + ('bindData', c_short), + ('isPeriod', c_bool) + ] + + def __init__(self): + self.period = 0 + self.isPeriod = False + + def parse_attributes(self, attributes): + x,y = attributes["position"].split(" ") + self.pos.x = int(x) + self.pos.y = int(y) + + x,y = attributes["rotate_center"].split(" ") + self.center.x = round(float(x)) + self.center.y = round(float(y)) + + self.rotateStart = int(attributes["rotate_start"]) + self.rotaeteEnd = int(attributes["rotate_end"]) + + self.bindData = int(attributes["bind_data"]) + + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + if "period" in attributes.getNames(): + self.period = int(attributes["period"]) + if self.period != 0: + self.isPeriod = True + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_sequence_img.py b/tools/dial_converter_tool/dial_sequence_img.py new file mode 100644 index 000000000..09781e851 --- /dev/null +++ b/tools/dial_converter_tool/dial_sequence_img.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialSequenceImg(Structure): + _fields_ = [ + ('pos', Point), + ('interval', c_ushort), + ('repeat', c_bool), + ('imgNum', c_ubyte), + ] + + def __init__(self): + self.imgId = [] + self.period = 0 + + def parse_attributes(self, attributes): + x,y = attributes["position"].split(" ") + self.pos.x = int(x) + self.pos.y = int(y) + + if attributes["repeat"].lower() == "true": + self.repeat = True + elif attributes["repeat"].lower() == "false": + self.repeat = False + + interval = int(attributes["interval"]) + if interval < 0: + print("[ERROR]: [interval] attr less than 0") + sys.exit(1) + else: + self.interval = interval + + imgNames = attributes["img_names"].split(",") + self.imgNum = len(imgNames) + for img in imgNames: + imgId = img_convert.instance.convert_img(img) + self.imgId.append(imgId) + + def get_bytes(self): + ret = bytes(self) + for index in range(self.imgNum): + ret += struct.pack('@H', self.imgId[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ushort) * self.imgNum \ No newline at end of file diff --git a/tools/dial_converter_tool/dial_static_img.py b/tools/dial_converter_tool/dial_static_img.py new file mode 100644 index 000000000..4e8302e97 --- /dev/null +++ b/tools/dial_converter_tool/dial_static_img.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialStaticImg(Structure): + _fields_ = [ + ('pos', Point), + ('center', Point), + ('rotate', c_float), + ('imgId', c_ushort) + ] + + def __init__(self): + self.imgId = 0 + self.pos.x = 0 + self.pos.y = 0 + self.center.x = 0 + self.center.y = 0 + self.rotate = 0.0 + self.period = 0 + + def parse_attributes(self, attributes): + x,y = attributes["position"].split(" ") + self.pos.x = int(x) + self.pos.y = int(y) + + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + + for attr in attributes.getNames(): + if attr == "center": + x,y = attributes["center"].split(" ") + self.center.x = int(x) + self.center.y = int(y) + elif attr == "rotate": + self.rotate = float(attributes["rotate"]) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) diff --git a/tools/dial_converter_tool/dial_video.py b/tools/dial_converter_tool/dial_video.py new file mode 100644 index 000000000..f83c85c15 --- /dev/null +++ b/tools/dial_converter_tool/dial_video.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +import video_convert +import img_convert + +class DialVideo(Structure): + _fields_ = [ + ('rect', Rect), + ('offset', c_uint), + ('colorKey', c_uint), + ('imgId', c_uint), + ] + + def __init__(self): + self.period = 0 + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + self.rect.y = int(y) + self.rect.w = int(w) + self.rect.h = int(h) + + self.colorKey = int(attributes["color_key"], 16) + + self.offset = video_convert.instance.convert_video(attributes["source"]) + + self.imgId = img_convert.instance.convert_img(attributes["preview_frame"]) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_converter_tool/dll/linux_cs/libcodec.so b/tools/dial_converter_tool/dll/linux_cs/libcodec.so new file mode 100644 index 000000000..1b99f0b52 Binary files /dev/null and b/tools/dial_converter_tool/dll/linux_cs/libcodec.so differ diff --git a/tools/dial_converter_tool/dll/linux_es/libcodec.so b/tools/dial_converter_tool/dll/linux_es/libcodec.so new file mode 100644 index 000000000..ddb8838c4 Binary files /dev/null and b/tools/dial_converter_tool/dll/linux_es/libcodec.so differ diff --git a/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll b/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll new file mode 100644 index 000000000..21b76ed24 Binary files /dev/null and b/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll differ diff --git a/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib b/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib new file mode 100644 index 000000000..fcdc59feb Binary files /dev/null and b/tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib differ diff --git a/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll b/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll new file mode 100644 index 000000000..4b74cd681 Binary files /dev/null and b/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll differ diff --git a/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib b/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib new file mode 100644 index 000000000..811632bbd Binary files /dev/null and b/tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib differ diff --git a/tools/dial_converter_tool/img_convert.py b/tools/dial_converter_tool/img_convert.py new file mode 100644 index 000000000..50abf979a --- /dev/null +++ b/tools/dial_converter_tool/img_convert.py @@ -0,0 +1,300 @@ +import base64 +from PIL import Image +from io import BytesIO +import cv2 +import ctypes +from ctypes import * +from PIL import Image + +import os +import sys +import struct +import time +import platform +import numpy as np +import pickle as p +import requests +import matplotlib.pyplot as pyplot + +global dll +if platform.system().lower() == 'windows': + dll = ctypes.CDLL(r".\dll\x64\release_cs\ICE_V5R1_BLOCK_HTC.dll") +elif platform.system().lower() == 'linux': + dll = ctypes.CDLL(sys.path[0] + r"/dll/linux_cs/libcodec.so") + +class Header(ctypes.Structure): + _fields_ = [ + ("width", c_uint), + ("height", c_uint), + ("stride", c_uint), + ("pixel_format", c_uint), + ("tile_width", c_uint), + ("mode_alpha", c_uint), + ("mode_rgb", c_uint) + ] + +class BsData(ctypes.Structure): + _fields_ = [ + ("bs_data", POINTER(c_ubyte)), + ("data_size", c_uint), + ("cmp_ratio", c_uint), + ("is_valid", c_uint), + ("subjective_review", c_uint), + ("para", Header) + ] + +class AutoCmpOutput(ctypes.Structure): + _fields_ = [ + ("cmp_bs0", POINTER(BsData)), + ("cmp_bs1", POINTER(BsData)), + ("cmp_bs2", POINTER(BsData)), + ("cmp_bs3", POINTER(BsData)), + ("auto_cmp_mode", c_uint), + ("valid_bs_num", c_uint) + ] + +class CmpInput(ctypes.Structure): + _fields_ = [ + ("width", c_uint), + ("height", c_uint), + ("stride", c_uint), + ("pixel_format", c_uint), + ("tile_width", c_uint), + ("mode_alpha", c_uint), + ("mode_rgb", c_uint), + ("red_channel", POINTER(c_ubyte)), + ("green_channel", POINTER(c_ubyte)), + ("blue_channel", POINTER(c_ubyte)), + ("alpha_channel", POINTER(c_ubyte)) + ] + +class AutoCmpInput(ctypes.Structure): + _fields_ =[ + ("auto_cmp_mode", c_uint), + ("high_quality_mode", c_uint), + ("high_cmp_ratio_mode", c_uint), + ("cmp_in", POINTER(CmpInput)) + ] + +class BinHeader(ctypes.Structure): + _fields_ = [ + ("dirId", c_uint), + ("count", c_uint) + ] + +class SeekInfo(ctypes.Structure): + _fields_ = [ + ("offset", c_uint), + ("size", c_uint) + ] + +class ImageHeader(ctypes.Structure): + _fields_ = [ + ("colorMode", c_uint, 8), + ("version", c_uint, 4), + ("compressMode", c_uint, 4), + ("reserved", c_uint, 16), + ("width", c_ushort), + ("height", c_ushort) + ] + +class ImageConverTool(): + binHeader = BinHeader() + binHeader.dirId = 0xfef + seekInfo = [] + imageHeader = [] + imageData = [] + imageNum = 0 + isConvertedFile = [] + + def __init__(self): + self.markCurOffset = 0 + self.width = 0 + self.height = 0 + self.file_alpha = False + self.cmp_mode = "HFBC" + self.color_fmt = ' ' + self.align = 1 + self.tile_width = 6 + self.mode_alpha = 1 + self.mode_rgb = 1 + self.auto_cmp_mode = 0 + self.high_quality_mode = 0 + self.high_cmp_ratio_mode = 0 + self.version = 1 + + def set_tile_width(self, tile_width): + if tile_width not in self.tile_width_support: + print("[ERROR]:The tile_width value is not supported.") + sys.exit(1) + + self.tile_width = tile_width + + def _convert(self): + width, height = self.image.size + self.width = width + self.height = height + self.stride_pixel = (self.width + self.align - 1) // self.align * self.align + if len(self.image.split()) > 3: + self.file_alpha = True + else: + self.file_alpha = False + + # initialize CmpInput + cmp_input = CmpInput() + self._get_cmp_input(cmp_input) + auto_cmp_input = AutoCmpInput() + self._get_auto_cmp_input(auto_cmp_input, cmp_input) + + # call GetBufferSize to get buffer size + # initialize CmpOutput + auto_cmp_output = AutoCmpOutput() + + cmp_bs0 = BsData() + buf_size0 = dll.ice_v5r1_block_get_buffer_size(byref(cmp_input)) # 压缩后输出数据的大小 + cmp_bs0.bs_data = (c_ubyte * buf_size0)() + auto_cmp_output.cmp_bs0 = ctypes.cast(pointer(cmp_bs0), POINTER(BsData)) + ret = dll.ice_v5r1_block_htc_auto_cmp(byref(auto_cmp_input), byref(auto_cmp_output)) # 对输入数据进行压缩返回值是函数正常运行标志位 + + # add imageinfo to list + self.binHeader.count += 1 + + imageInfo = ImageHeader() + imageInfo.width = self.width + imageInfo.height = self.height + imageInfo.colorMode = self._get_color_mode() + imageInfo.version = 1 + imageInfo.compressMode = 4 + imageInfo.reserved = 0 + seekInfo = SeekInfo() + seekInfo.offset = self.markCurOffset + seekInfo.size = sizeof(imageInfo) + cmp_bs0.data_size + self.markCurOffset += seekInfo.size + self.seekInfo.append(seekInfo) + self.imageHeader.append(imageInfo) + self.imageData.append(cmp_bs0) + self.imageNum += 1 + return self.imageNum + + def _check_path(self, path): + if not os.path.exists(path): + print("[ERROR]:", path, "is not exist") + return False + else: + if (not path[-3:].lower() == "png") and (not path[-3:].lower() == "jpg"): + print("[ERROR]:", path, "is not jpg or png format image") + return False + return True + + def convert_img(self, path): + if path in self.isConvertedFile: + return self.isConvertedFile.index(path) + 1 + + if not self._check_path(path): + sys.exit(1) + + self.image = Image.open(path) + if self.image.mode == 'RGBA': + self.color_fmt = 'ARGB8888' + elif self.image.mode == 'RGB': + self.color_fmt = 'RGB888' + self.isConvertedFile.append(path) + return self._convert() + + def _get_cmp_px_format(self): + if self.color_fmt == 'RGB565': + return 2 + elif self.color_fmt == 'RGB888': + return 0 + elif self.color_fmt == 'ARGB8888': + return 1 + + def _get_color_mode(self): + if self.color_fmt == 'RGB565': + return 2 + elif self.color_fmt == 'RGB888': + return 1 + elif self.color_fmt == 'ARGB8888': + return 0 + + def _get_auto_cmp_input(self, auto_cmp_input, cmp_input): + auto_cmp_input.auto_cmp_mode = self.auto_cmp_mode + auto_cmp_input.high_quality_mode = self.high_quality_mode + auto_cmp_input.high_cmp_ratio_mode = self.high_cmp_ratio_mode + auto_cmp_input.cmp_in = ctypes.cast(pointer(cmp_input), POINTER(CmpInput)) + + def _get_cmp_input(self, cmp_input): + cmp_input.width = self.width + cmp_input.height = self.height + cmp_input.stride = self.width + cmp_input.tile_width = self.tile_width + cmp_input.mode_alpha = self.mode_alpha + cmp_input.mode_rgb = self.mode_rgb + cmp_input.pixel_format = self._get_cmp_px_format() + size = self.width * self.height + red = (c_ubyte * size)() + green = (c_ubyte * size)() + blue = (c_ubyte * size)() + alpha = (c_ubyte * size)() + + for row in range(self.height): + for col in range(self.width): + position = row * self.width + col + red[position] = self.image.getdata()[position][0] + green[position] = self.image.getdata()[position][1] + blue[position] = self.image.getdata()[position][2] + if self.file_alpha == False: + alpha[position] = 0xFF + else: + alpha[position] = self.image.getdata()[position][3] + cmp_input.red_channel = red + cmp_input.green_channel = green + cmp_input.blue_channel = blue + cmp_input.alpha_channel = alpha + + def write_data_to_bin(self, fb): + fb.write(bytes(self.binHeader)) + for seek in self.seekInfo: + fb.write(bytes(seek)) + + for index in range(0, self.imageNum): + bt = bytearray() + color_fmt = self.imageHeader[index].colorMode + header = color_fmt + (self.imageHeader[index].width << 32) + \ + (self.imageHeader[index].height << 48) + (self.imageHeader[index].version << 8) + header_bin = struct.pack(" + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG b/tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG new file mode 100644 index 000000000..2b1ee8358 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png new file mode 100644 index 000000000..9c3993262 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png new file mode 100644 index 000000000..58d2cdd29 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png new file mode 100644 index 000000000..861ad16a8 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png new file mode 100644 index 000000000..1a0947185 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png new file mode 100644 index 000000000..a2e27c6d8 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png new file mode 100644 index 000000000..c5b292dcb Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png b/tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png new file mode 100644 index 000000000..e099b5661 Binary files /dev/null and b/tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..e6e382277 Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png new file mode 100644 index 000000000..77cf955da Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..7a47b8f21 Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png new file mode 100644 index 000000000..f4b1dbe0f Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png new file mode 100644 index 000000000..147de5f68 Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..54d990129 Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml b/tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml new file mode 100644 index 000000000..4c1511eb4 --- /dev/null +++ b/tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG b/tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG new file mode 100644 index 000000000..9d7239d5c Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG differ diff --git a/tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png b/tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png new file mode 100644 index 000000000..d937bf2d3 Binary files /dev/null and b/tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png differ diff --git a/tools/dial_converter_tool/main.py b/tools/dial_converter_tool/main.py new file mode 100644 index 000000000..cc57403c5 --- /dev/null +++ b/tools/dial_converter_tool/main.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# coding: utf-8 +# 1\ 解析命令 python main.py -d [DIR] -o [OUT_DIR] +# 2\ 循环执行svg解析写入 +import sys +import os +import argparse +from converter import DialConvertTool + +def GetParameters(): + parser = argparse.ArgumentParser() + + parser.add_argument('-file', '-f', type=str, default='', required=False, + help='The svg file need to be converted.') + + parser.add_argument('-dir', '-d', type=str, default='', required=False, + help='The directory needs to be converted.') + + parser.add_argument('-output', type=str, default=os.getcwd() + "/out", required=False, + help='output dir') + + config = parser.parse_args() + return config + +if __name__ == "__main__": + userInput = GetParameters() + outputPath = userInput.output + inputFile = userInput.file + inputDir = userInput.dir + # Create an output folder. + print("output dir : " + outputPath) + if not os.path.exists(outputPath): + os.mkdir(outputPath) + + if not os.path.isdir(inputFile) and inputFile[-3:].lower() == "xml": + print("input file : " + inputFile) + converter = DialConvertTool() + converter.convert_xml_to_output(inputFile, outputPath) + + files = os.listdir(inputDir) + print("input dir : " + inputDir) + for file in files: + if not os.path.isdir(file) and file[-3:].lower() == "xml": + converter = DialConvertTool() + converter.convert_xml_to_output(inputDir + "/" + file, outputPath) \ No newline at end of file diff --git a/tools/dial_converter_tool/video_convert.py b/tools/dial_converter_tool/video_convert.py new file mode 100644 index 000000000..d447a166b --- /dev/null +++ b/tools/dial_converter_tool/video_convert.py @@ -0,0 +1,32 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import ctypes +from ctypes import * + +class VideoConvertTool: + def __init__(self): + self.videoNum = 0 + self.videoName = [] + self.videoIndex = [] + self.videoData = bytearray() + + def convert_video(self, path): + if path in self.videoName: + index = self.videoName.index(path) + return self.videoIndex[index] + fp = open(path, 'rb') + data = fp.read() + fp.close() + self.videoName.append(path) + self.videoNum += 1 + ret = len(self.videoData) + self.videoIndex.append(ret) + self.videoData += data + return ret + + def write_data_to_bin(self, fb): + fb.write(self.videoData) + +instance = VideoConvertTool() diff --git "a/tools/dial_converter_tool/\350\247\206\351\242\221\350\241\250\347\233\230\345\210\266\344\275\234\345\217\230\346\233\264.txt" "b/tools/dial_converter_tool/\350\247\206\351\242\221\350\241\250\347\233\230\345\210\266\344\275\234\345\217\230\346\233\264.txt" new file mode 100644 index 000000000..8a9184b60 --- /dev/null +++ "b/tools/dial_converter_tool/\350\247\206\351\242\221\350\241\250\347\233\230\345\210\266\344\275\234\345\217\230\346\233\264.txt" @@ -0,0 +1,4 @@ +新增video的预览帧功能。video标签新增属性 preview_frame。 +1、历史表盘有视频表盘需要重新用新工具生成。 +2、使用video标签实例如下 + \ No newline at end of file