diff --git a/include/info/linux/device_api_version.h b/include/info/linux/device_api_version.h index 5fc4bfeb10c66fe98418729045dfcf7ca343136e..80e285197aa87e1981ebb76504aceb454501dd38 100644 --- a/include/info/linux/device_api_version.h +++ b/include/info/linux/device_api_version.h @@ -26,12 +26,18 @@ extern "C" { */ void InitDeviceApiVersion(void); +/** + * @brief Get the api version number of the device. + * @return The api version number of the device. + */ +int get_device_api_version(void); + /** * @brief Get the api version number of the device, the value is equal to const.ohos.apiversion value. * If get api version value not equal API_VERSION_DEFAULT, the cached value will be used and not be updated. * @return The api version number of the device, or 0 on default/failure. */ -int get_device_api_version(void); +int get_device_api_version_inner(void); #ifdef __cplusplus } diff --git a/libc-test/src/functionalext/info/device_api_version.c b/libc-test/src/functionalext/info/device_api_version.c index c6668518afa6b447afb781a5228cd3d5a7e7a3e4..c407824eb669bc3fe9139b497f80f88fefc32924 100644 --- a/libc-test/src/functionalext/info/device_api_version.c +++ b/libc-test/src/functionalext/info/device_api_version.c @@ -33,7 +33,7 @@ static void get_device_api_version_0010(void) { int APIVersion = get_device_api_version(); - EXPECT_EQ(API_VERSION_DEFAULT, APIVersion < 0); + EXPECT_EQ(APIVersion, API_VERSION_DEFAULT); } int main(void) diff --git a/src/info/linux/device_api_version.c b/src/info/linux/device_api_version.c index ead4e1f6572495e7af435d9e70fc51f4d2cad215..8da4e47f9689d3d7a64143677cd8518c4e9d0186 100644 --- a/src/info/linux/device_api_version.c +++ b/src/info/linux/device_api_version.c @@ -47,6 +47,12 @@ void InitDeviceApiVersion(void) } int get_device_api_version(void) +{ + // depend subsystem of syspara support the interface of get system property + return API_VERSION_DEFAULT; +} + +int get_device_api_version_inner(void) { #ifdef OHOS_ENABLE_PARAMETER if (device_api_level == API_VERSION_DEFAULT) {