Closed
GetAppUid回退分支平台宏精确化:default实现中CROSS_PLATFORM收窄为ANDROID_PLATFORM #2571
jizaiyiAdd on 1 day agoClosed at 9 hours ago
openharmony_ci
1 day ago Comments:
1 day ago Comments:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@weng-changcheng](https://gitcode.com/weng-changcheng) [@xliu-huanwei](https://gitcode.com/xliu-huanwei) [@gong_19901](https://gitcode.com/gong_19901) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


1 day ago Added label: waiting_for_assign
1 day ago Associated pull request
9 hours ago Close issue
9 hours ago changed custom state from 待办的 to 已完成
问题描述
platform/default/process_helper.cpp中GetAppUid()的回退分支以#if defined(CROSS_PLATFORM) || defined(ETS_UTILS_HOST_UT)守卫,注释称 AppUid 在 ArkUI-X 跨平台不存在。但对照js_sys_module/process/BUILD.gn的平台源选择逻辑:platform/ios/process_helper.cpp(target_os == "ios"分支),不经过 default 版本文件;ANDROID_PLATFORM与CROSS_PLATFORM);ETS_UTILS_HOST_UT覆盖。因此 default 实现中的
CROSS_PLATFORM守卫宽于实际需要,且暗示 iOS 会经本文件走回退(实际不会),语义不精确。修改方案
将该
#if守卫中的CROSS_PLATFORM收窄为ANDROID_PLATFORM,使守卫宏与真正编译本文件的平台精确对齐。行为影响分析(对现有构建矩阵):
现有构建矩阵内行为完全保持,属守卫宏精确化。