diff --git a/startup/init/syscap/include/deviceinfo.h b/startup/init/syscap/include/deviceinfo.h index 30cf046656d5afa48d14187a951502d2f623af26..9e7dc927b7c9b373ecfff3f8cc581ec12d31c418 100644 --- a/startup/init/syscap/include/deviceinfo.h +++ b/startup/init/syscap/include/deviceinfo.h @@ -158,15 +158,19 @@ const char *OH_GetOSFullName(void); int OH_GetSdkApiVersion(void); /** - * Obtains the SDK Minor API version number. + * Obtains the sdk minor api version number. * @syscap SystemCapability.Startup.SystemInfo + * @return 0 ~ 999 - the sdk minor api version + * -1 - not found the sdk minor api version number, or failed to invoke the internal interface. * @since 19 */ int OH_GetSdkMinorApiVersion(void); /** - * Obtains the SDK Patch API version number. + * Obtains the sdk patch api version number. * @syscap SystemCapability.Startup.SystemInfo + * @return 0 ~ 999 - the sdk patch api version + * -1 - not found the sdk patch api version number, or failed to invoke the internal interface. * @since 19 */ int OH_GetSdkPatchApiVersion(void); diff --git a/startup/init/syscap/include/syscap_ndk.h b/startup/init/syscap/include/syscap_ndk.h index cc1ff3a964ee024001bae5d9bae3ddc24f047b31..023107e51debc4806ad0d94cc62eea8ee98fec1f 100644 --- a/startup/init/syscap/include/syscap_ndk.h +++ b/startup/init/syscap/include/syscap_ndk.h @@ -45,14 +45,20 @@ extern "C" { bool canIUse(const char *cap); /** - * @brief api version is greater or same than the given version. + * @brief determine whether the current operating system version is greater than or equal to the given value. * - * @param majorVersion The major version number - * @param minorVersion The minor version number - * @param patchVersion The patch version number - * @return true if api version is greater or same than the given version; - * otherwise false. + * @param majorVersion The major version number which betwen 1 and 999, such as 19 in api version 19.1.2 + * @param minorVersion The minor version number which betwen 0 and 999, such as 1 in api version 19.1.2 + * @param patchVersion The patch version number which betwen 0 and 999, such as 2 in api version 19.1.2 + * @return true - operating system version is greater than or equal to the given value + * false - operating system version is less than the given value or invalid api version * @since 19 + * @example given version is "19.1" + * if (OH_IsApiVersionGreaterOrEqual(19, 1, 0)) { + * // Use 19.1 APIs. + * } else { + * // Alternative code for earlier versions. + * } */ bool OH_IsApiVersionGreaterOrEqual(int majorVersion, int minorVersion, int patchVersion);