#endif
#include "drawing_canvas.h"
+#include "drawing_error_code.h"
#include "drawing_color.h"
#include "drawing_font.h"
#include "drawing_text_declaration.h"
@@ -582,6 +583,180 @@ typedef enum OH_Drawing_FontWidth {
FONT_WIDTH_ULTRA_EXPANDED = 9,
} OH_Drawing_FontWidth;
+/**
+ * @brief Enumerates text style attribute.
+ *
+ * @since 21
+ */
+typedef enum OH_Drawing_TextStyleAttributeId {
+ /** Line height maximum */
+ TEXT_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM = 0,
+ /** Line height minimum */
+ TEXT_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM = 1,
+ /** Line height style */
+ TEXT_STYLE_ATTR_I_LINE_HEIGHT_STYLE = 2,
+ /** Font width */
+ TEXT_STYLE_ATTR_I_FONT_WIDTH = 3,
+} OH_Drawing_TextStyleAttributeId;
+
+/**
+ * @brief Enumerates line height's scaling type.
+ *
+ * @since 21
+ */
+typedef enum OH_Drawing_LineHeightStyle {
+ /** Use the font size as the scale factor for line height scaling */
+ TEXT_LINE_HEIGHT_BY_FONT_SIZE = 0,
+ /** Use the text height after shaping as the scale factor for line height scaling */
+ TEXT_LINE_HEIGHT_BY_FONT_HEIGHT = 1,
+} OH_Drawing_LineHeightStyle;
+
+/**
+ * @brief Enumerates typography style attribute.
+ *
+ * @since 21
+ */
+typedef enum OH_Drawing_TypographyStyleAttributeId {
+ /** Line height maximum */
+ TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM = 0,
+ /** Line height minimum */
+ TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM = 1,
+ /** Line spacing */
+ TYPOGRAPHY_STYLE_ATTR_D_LINE_SPACING = 2,
+ /** Line height style */
+ TYPOGRAPHY_STYLE_ATTR_I_LINE_HEIGHT_STYLE = 3,
+ /** Font width */
+ TYPOGRAPHY_STYLE_ATTR_I_FONT_WIDTH = 4,
+} OH_Drawing_TypographyStyleAttributeId;
+
+/**
+ * @brief Sets double value to the text style attribute.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TextStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the value to set.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id
+ * exceeds the allowable range.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_SetTextStyleAttributeDouble(OH_Drawing_TextStyle* style,
+ OH_Drawing_TextStyleAttributeId id, double value);
+
+/**
+ * @brief Gets the double type property's value from the text style.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TextStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the return value of the interface.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_GetTextStyleAttributeDouble(OH_Drawing_TextStyle* style,
+ OH_Drawing_TextStyleAttributeId id, double* value);
+
+/**
+ * @brief Sets int value to the text style attribute.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TextStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the value to set.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id
+ * exceeds the allowable range.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_SetTextStyleAttributeInt(OH_Drawing_TextStyle* style,
+ OH_Drawing_TextStyleAttributeId id, int value);
+
+/**
+ * @brief Gets the int type property's value from the text style.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TextStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the return value of the interface.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_GetTextStyleAttributeInt(OH_Drawing_TextStyle* style,
+ OH_Drawing_TextStyleAttributeId id, int* value);
+
+/**
+ * @brief Sets double value to the typography style attribute.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the value to set.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id
+ * exceeds the allowable range.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_SetTypographyStyleAttributeDouble(OH_Drawing_TypographyStyle* style,
+ OH_Drawing_TypographyStyleAttributeId id, double value);
+
+/**
+ * @brief Gets the double type property's value from the typography style.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the return value of the interface.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_GetTypographyStyleAttributeDouble(OH_Drawing_TypographyStyle* style,
+ OH_Drawing_TypographyStyleAttributeId id, double* value);
+
+/**
+ * @brief Sets int value to the typography style attribute.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the value to set.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if the value corresponding to the attribute id
+ * exceeds the allowable range.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_SetTypographyStyleAttributeInt(OH_Drawing_TypographyStyle* style,
+ OH_Drawing_TypographyStyleAttributeId id, int value);
+
+/**
+ * @brief Gets the int type property's value from the typography style.
+ *
+ * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object.
+ * @param id Indicates the attribute id.
+ * @param value Indicates the return value of the interface.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if the style is nullptr.
+ * Returns {@link OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH} if the attribute id is not recognized or supported.
+ * @since 21
+ */
+OH_Drawing_ErrorCode OH_Drawing_GetTypographyStyleAttributeInt(OH_Drawing_TypographyStyle* style,
+ OH_Drawing_TypographyStyleAttributeId id, int* value);
+
/**
* @brief Type of badge.
*
diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
index 7472ebb07985bc1347f7f672324792cae5f576ec..dd7a437602384c555040754aab51efeed2b8a736 100644
--- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
+++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
@@ -2037,5 +2037,37 @@
{
"first_introduced": "20",
"name": "OH_Drawing_FontFeaturesDestroy"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_SetTextStyleAttributeDouble"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_GetTextStyleAttributeDouble"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_SetTextStyleAttributeInt"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_GetTextStyleAttributeInt"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_SetTypographyStyleAttributeDouble"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_GetTypographyStyleAttributeDouble"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_SetTypographyStyleAttributeInt"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Drawing_GetTypographyStyleAttributeInt"
}
]
\ No newline at end of file
diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug.h b/hiviewdfx/hidebug/include/hidebug/hidebug.h
index 287cf4433ecb57135baac30af4337b5e5e16ab09..242377c99bee37f2a6ca60dfde3942142c03ac14 100644
--- a/hiviewdfx/hidebug/include/hidebug/hidebug.h
+++ b/hiviewdfx/hidebug/include/hidebug/hidebug.h
@@ -246,6 +246,21 @@ HiDebug_Backtrace_Object OH_HiDebug_CreateBacktraceObject(void);
*/
void OH_HiDebug_DestroyBacktraceObject(HiDebug_Backtrace_Object object);
+/**
+ * @brief Obtain the graphics memory summary of application.
+ *
+ * @param interval If the cache of graphics memory is longer than interval (unit: second), the latest
+ * graphics memory data will be obtained. The interval value range is 2 seconds to
+ * 3600 seconds, If interval is an invalid value, the default value is 300 seconds.
+ * @param summary Indicates value of graphics memory summary, in kibibytes.
+ * @return Result code
+ * {@link HIDEBUG_SUCCESS} Get graphics memory success.
+ * {@link HIDEBUG_INVALID_ARGUMENT} Invalid argument, value is null.
+ * {@link HIDEBUG_TRACE_ABNORMAL} Failed to get the application memory due to a remote exception.
+ * @since 21
+ */
+HiDebug_ErrorCode OH_HiDebug_GetGraphicsMemorySummary(uint32_t interval, HiDebug_GraphicsMemorySummary *summary);
+
#ifdef __cplusplus
}
#endif // __cplusplus
diff --git a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h
index 9ff70423aea0c8e2d928491eb5240f253dd0f1bb..ce767a08e1416ccb1a5b40bca21d2a227028556c 100644
--- a/hiviewdfx/hidebug/include/hidebug/hidebug_type.h
+++ b/hiviewdfx/hidebug/include/hidebug/hidebug_type.h
@@ -313,6 +313,23 @@ typedef struct HiDebug_StackFrame {
*/
typedef struct HiDebug_Backtrace_Object__* HiDebug_Backtrace_Object;
+/**
+ * @brief Defines the graphics memory summary structure type.
+ *
+ * @since 21
+ */
+typedef struct HiDebug_GraphicsMemorySummary {
+ /**
+ * GL memory
+ */
+ uint32_t gl;
+
+ /**
+ * graph memory
+ */
+ uint32_t graph;
+} HiDebug_GraphicsMemorySummary;
+
#ifdef __cplusplus
}
#endif // __cplusplus
diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json
index ec903bef43d1816bcbdb4de6e13b97b4f3172e82..ac8921126918a48846216aac0ac941a056632422 100644
--- a/hiviewdfx/hidebug/libhidebug.ndk.json
+++ b/hiviewdfx/hidebug/libhidebug.ndk.json
@@ -43,6 +43,10 @@
"first_introduced": "14",
"name": "OH_HiDebug_GetGraphicsMemory"
},
+ {
+ "first_introduced": "21",
+ "name": "OH_HiDebug_GetGraphicsMemorySummary"
+ },
{
"first_introduced": "20",
"name": "OH_HiDebug_SetMallocDispatchTable"
diff --git a/hiviewdfx/hilog/include/hilog/log.h b/hiviewdfx/hilog/include/hilog/log.h
index 1c4cda70470867aa3a89f12d025251f6c9742567..0aa747734a09aae4cdb54d2607e8674d49aff9ad 100644
--- a/hiviewdfx/hilog/include/hilog/log.h
+++ b/hiviewdfx/hilog/include/hilog/log.h
@@ -133,6 +133,30 @@ typedef enum {
LOG_FATAL = 7,
} LogLevel;
+/**
+ * @brief Enumerates preference strategy to be used in {@link OH_LOG_SetLogLevel}.
+ *
+ * You are advised to select preference strategy based on their respective usage scenarios.
+ *
+ * @since 21
+ */
+typedef enum {
+ /** Used to unset SetLogLevel, then none is set
+ */
+ UNSET_LOGLEVEL = 0,
+ /**
+ * The actual lowest log level is determined by
+ * the maximum level between the new level and the system-controlled level.
+ * This is equivalent to calling OH_LOG_SetMinLogLevel.
+ */
+ PREFER_CLOSE_LOG = 1,
+ /**
+ * The actual lowest log level is determined by
+ * the minimum level between the new level and the system-controlled level.
+ */
+ PREFER_OPEN_LOG = 2,
+} PreferStrategy;
+
/**
* @brief Outputs logs.
*
@@ -351,6 +375,15 @@ void OH_LOG_SetCallback(LogCallback callback);
*/
void OH_LOG_SetMinLogLevel(LogLevel level);
+/**
+ * @brief Sets the lowest log level of the current application process. Different preference strategy can be set.
+ *
+ * @param level log level.
+ * @param prefer preference strategy. See {@link PreferStrategy}.
+ * @since 21
+ */
+void OH_LOG_SetLogLevel(LogLevel level, PreferStrategy prefer);
+
#ifdef __cplusplus
}
#endif
diff --git a/hiviewdfx/hilog/libhilog.ndk.json b/hiviewdfx/hilog/libhilog.ndk.json
index 0d14010e04c1ea7dffaef8c2a1e89a2dc7a6e037..2f06e93a984744041fa91f00fe9b0f2ec28afb60 100644
--- a/hiviewdfx/hilog/libhilog.ndk.json
+++ b/hiviewdfx/hilog/libhilog.ndk.json
@@ -19,5 +19,9 @@
},
{
"name": "OH_LOG_SetMinLogLevel"
+ },
+ {
+ "first_instroduced":"21",
+ "name": "OH_LOG_SetLogLevel"
}
]
diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json
index 858a405ccc3ce5403e73550e770a5889ef7e7db3..327f7573d81a14ed3e264534400c4d95aeb580c9 100644
--- a/multimedia/audio_framework/ohaudio.ndk.json
+++ b/multimedia/audio_framework/ohaudio.ndk.json
@@ -348,35 +348,35 @@
"name":"OH_AudioSessionManager_UnregisterSessionDeactivatedCallback"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_SetScene"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_RegisterStateChangeCallback"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_UnregisterStateChangeCallback"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_SetDefaultOutputDevice"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_GetDefaultOutputDevice"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_ReleaseDevices"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback"
},
{
- "first_introduced": "12",
+ "first_introduced": "20",
"name":"OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback"
},
{
diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h
index 1d0af06b2b47a70e57f70e5f8440b67e56dd7d56..3c8649510a60c693bee868cff1098b08c40814e9 100644
--- a/multimedia/av_codec/native_avcapability.h
+++ b/multimedia/av_codec/native_avcapability.h
@@ -84,7 +84,7 @@ typedef enum OH_AVCapabilityFeature {
VIDEO_ENCODER_TEMPORAL_SCALABILITY = 0,
/** Feature for codec supports long-term reference. It is only used in video encoder. */
VIDEO_ENCODER_LONG_TERM_REFERENCE = 1,
- /** Feature for codec supports low latency. It is used in video encoder and video decoder. */
+ /** Feature for codec supports low latency. It is only used in video decoder. */
VIDEO_LOW_LATENCY = 2,
/** Feature for codec supports B-frame encoding. It is only used in video encoder.
* @since 20
diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h
index 7745ac2101f9066330942d3bd141a608a2ec70e2..0042b76b4a2da27c3f8f01b44f2254bfe09f2a95 100644
--- a/multimedia/av_codec/native_avcodec_base.h
+++ b/multimedia/av_codec/native_avcodec_base.h
@@ -944,8 +944,8 @@ extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH;
extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT;
/**
* @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise.
- * If enabled, the video encoder or video decoder doesn't hold input and output data more than required by
- * the codec standards. This is an optional key that applies only to video encoder or video decoder.
+ * If enabled, the video decoder doesn't hold input and output data more than required by
+ * the codec standards. This is an optional key that applies only to video decoder.
* It is used in configure.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h
index c158c5ebe6bfb3f58347fe7147d8713ad33b2e3b..5d2967e91f4a15c71ac9e626a6da14e0df900b26 100644
--- a/multimedia/camera_framework/camera.h
+++ b/multimedia/camera_framework/camera.h
@@ -1265,6 +1265,24 @@ typedef struct Camera_ControlCenterStatusInfo {
bool isActive;
} Camera_ControlCenterStatusInfo;
+/**
+ * @brief Enum for photo quality prioritization.
+ *
+ * @since 21
+ * @version 1.0
+ */
+typedef enum Camera_PhotoQualityPrioritization {
+ /**
+ * High quality photos are the top preference, even at the expense of shot-to-shot time.
+ */
+ CAMERA_PHOTO_QUALITY_PRIORITIZATION_HIGH_QUALITY = 0,
+
+ /**
+ * Prefering speed over quality, even at the expense of quality.
+ */
+ CAMERA_PHOTO_QUALITY_PRIORITIZATION_SPEED = 1,
+} Camera_PhotoQualityPrioritization;
+
#ifdef __cplusplus
}
#endif
diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json
index ff95d61ee10ccdf7ce6e97dad268cb9889d902b4..cd755635d3232f7df5c49e9ce3245adcf4089080 100644
--- a/multimedia/camera_framework/camera.ndk.json
+++ b/multimedia/camera_framework/camera.ndk.json
@@ -23,6 +23,18 @@
"first_introduced": "11",
"name": "OH_CameraInput_Release"
},
+ {
+ "first_introduced": "21",
+ "name": "OH_CameraInput_IsPhysicalCameraOrientationVariable"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_CameraInput_GetPhysicalCameraOrientation"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_CameraInput_UsePhysicalCameraOrientation"
+ },
{
"first_introduced": "11",
"name": "OH_CameraManager_RegisterCallback"
@@ -734,5 +746,13 @@
{
"first_introduced": "20",
"name": "OH_CaptureSession_UnregisterMacroStatusChangeCallback"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_PhotoOutput_IsPhotoQualityPrioritizationSupported"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_PhotoOutput_SetPhotoQualityPrioritization"
}
]
diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h
index a91452d9d46cdef6d27a3e7e68095be23b48bb5e..72a974c9a69da737a5992085e43e91839e5849a5 100644
--- a/multimedia/camera_framework/camera_input.h
+++ b/multimedia/camera_framework/camera_input.h
@@ -171,6 +171,41 @@ Camera_ErrorCode OH_CameraInput_Close(Camera_Input* cameraInput);
*/
Camera_ErrorCode OH_CameraInput_Release(Camera_Input* cameraInput);
+/**
+ * @brief Query whether physical camera orientation is variable under different fold status.
+ *
+ * @param {CameraInput} cameraInput the {@link Camera_Input} instance.
+ * @param {bool} isVariable the result of whether physical camera orientation is variable.
+ * @return {@link #CAMERA_OK} if the method call succeeds.
+ * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect.
+ * @since 21
+ */
+Camera_ErrorCode OH_CameraInput_IsPhysicalCameraOrientationVariable(Camera_Input* cameraInput, bool* isVariable);
+
+/**
+ * @brief Get physical camera orientation under current fold status.
+ *
+ * @param cameraInput the {@link Camera_Input} instance.
+ * @param orientation the physical camera orientation of current fold status.
+ * @return {@link #CAMERA_OK} if the method call succeeds.
+ * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect.
+ * @since 21
+ */
+Camera_ErrorCode OH_CameraInput_GetPhysicalCameraOrientation(Camera_Input* cameraInput, uint32_t* orientation);
+
+/**
+ * @brief Choose whether to use the physical camera orientation.
+ *
+ * @param cameraInput the {@link Camera_Input} instance.
+ * @param isUsed the flag of whether to use physical camera orientation.
+ * @return {@link #CAMERA_OK} if the method call succeeds.
+ * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect.
+ * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed.
+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error.
+ * @since 21
+ */
+Camera_ErrorCode OH_CameraInput_UsePhysicalCameraOrientation(Camera_Input* cameraInput, bool isUsed);
+
#ifdef __cplusplus
}
#endif
diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h
index 27e502b695a667c5e6ad112c8035bb6081bf4919..90b5161d62443ca8606a3a3fd1c97d8c0d160cf8 100644
--- a/multimedia/camera_framework/photo_output.h
+++ b/multimedia/camera_framework/photo_output.h
@@ -499,6 +499,35 @@ Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photo
*/
Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled);
+/**
+ * @brief Check whether to support photo quality prioritization.
+ *
+ * @param photoOutput the {@link Camera_PhotoOutput} instance which used to check whether photo quality prioritization supported.
+ * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating quality preference.
+ * @param isSupported the result of whether quality prioritization is supported.
+ * @return {@link #CAMERA_OK} if the method call succeeds.
+ * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect.
+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error.
+ * @since 21
+ */
+
+Camera_ErrorCode OH_PhotoOutput_IsPhotoQualityPrioritizationSupported(Camera_PhotoOutput* photoOutput,
+ Camera_PhotoQualityPrioritization qualityPrioritization, bool* isSupported);
+
+/**
+ * @brief Set photo quality prioritization.
+ *
+ * @param photoOutput the {@link Camera_PhotoOutput} instance which used to configure photo quality prioritization.
+ * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating the choice of quality or speed.
+ * @return {@link #CAMERA_OK} if the method call succeeds.
+ * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect.
+ * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed.
+ * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error.
+ * @since 21
+ */
+Camera_ErrorCode OH_PhotoOutput_SetPhotoQualityPrioritization(Camera_PhotoOutput* photoOutput,
+ Camera_PhotoQualityPrioritization qualityPrioritization);
+
#ifdef __cplusplus
}
#endif
diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h
index 1261bdd3b10c18efbed98887ede2416eefb081f2..d206b6d46ed601f526a80ed178c9e76b0be7fcca 100644
--- a/multimedia/player_framework/avplayer.h
+++ b/multimedia/player_framework/avplayer.h
@@ -47,6 +47,7 @@
#include "avplayer_base.h"
#include "native_window/external_window.h"
#include "ohaudio/native_audiostream_base.h"
+#include "native_avcodec_base.h"
#ifdef __cplusplus
extern "C" {
@@ -621,6 +622,41 @@ OH_AVErrCode OH_AVPlayer_SetOnErrorCallback(OH_AVPlayer *player, OH_AVPlayerOnEr
*/
OH_AVErrCode OH_AVPlayer_SetVolumeMode(OH_AVPlayer *player, OH_AudioStream_VolumeMode volumeMode);
+/**
+ * @brief Sets the loudness gain of current media. The default gain is 0.0 dB.
+ * This API can be called only when the AVPlayer is in the prepared, playing, paused completed or stopped state.
+ * The default loudness gain is 0.0dB. The stream usage of the player must be
+ * {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MUSIC}, {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MOVIE}
+ * or {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_AUDIOBOOK}.
+ * The latency mode of the audio renderer must be {@link OH_AudioStream_LatencyMode#AUDIOSTREAM_LATENCY_MODE_NORMAL}.
+ * If AudioRenderer is played through the high-resolution pipe, this operation is not supported.
+ *
+ * @param player Pointer to an OH_AVPlayer instance.
+ * @param loudnessGain Loudness gain to set which changes from -90.0 to 24.0, expressing in dB.
+ * @return Function result code:
+ * {@link AV_ERR_OK} If the execution is successful.
+ * {@link AV_ERR_INVALID_VAL}:The value of player is a null pointer or
+ * the value of loudnessGain is invalid.
+ * {@link AV_ERR_INVALID_STATE}: The function is called in an incorrect state. or the stream usage of
+ * audioRendererInfo is not one of {@link StreamUsage#STREAM_USAGE_MUSIC},
+ * {@link StreamUsage#STREAM_USAGE_MOVIE} or {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}.
+ * {@link AV_ERR_SERVICE_DIED}: System errors such as media service breakdown.
+ * @since 21
+ */
+OH_AVErrCode OH_AVPlayer_SetLoudnessGain(OH_AVPlayer *player, float loudnessGain);
+
+/**
+ * @brief Set the media source of the player. The data of this media source is provided by the application.
+ * @param {OH_AVPlayer*} player Pointer to an OH_AVPlayer instance
+ * @param {OH_AVDataSourceExt*} datasrc Pointer to an OH_AVDataSourceExt instance
+ * @param {void*} userData The handle passed in by the user is used to pass in the callback
+ * @return Function result code.
+ * {@link AV_ERR_OK} if the execution is successful.
+ * {@link AV_ERR_INVALID_VAL} if input player is nullptr or datasrc is nullptr.
+ * @since 21
+ */
+OH_AVErrCode OH_AVPlayer_SetDataSource(OH_AVPlayer *player, OH_AVDataSourceExt* datasrc, void* userData);
+
#ifdef __cplusplus
}
#endif
diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json
index 7f6d8b5bb7e8c1661a0550e673f96fb15a090a46..2b372fe8fa02338d7c592711421201db13b19a9c 100644
--- a/multimedia/player_framework/avplayer/libavplayer.ndk.json
+++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json
@@ -146,5 +146,13 @@
{
"first_introduced": "20",
"name": "OH_AVPlayer_SetPlaybackRate"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_AVPlayer_SetLoudnessGain"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_AVPlayer_SetDataSource"
}
]
\ No newline at end of file
diff --git a/multimedia/player_framework/lowpower_audio_sink.h b/multimedia/player_framework/lowpower_audio_sink.h
index 07f24a2999867ed323462567a676035cdcf3d874..3ed0476042c8e2b5014e2eedf29d010e11373abc 100644
--- a/multimedia/player_framework/lowpower_audio_sink.h
+++ b/multimedia/player_framework/lowpower_audio_sink.h
@@ -268,7 +268,7 @@ OH_AVErrCode OH_LowPowerAudioSink_ReturnSamples(OH_LowPowerAudioSink* sink, OH_A
* otherwise, returns a specific error code as defined in {@link OH_AVErrCode}
* {@link AV_ERR_INVALID_VAL} the sink is nullptr or loudnessGain is out of valid range.
* {@link AV_ERR_SERVICE_DIED} media service is died.
- * @since 20
+ * @since 21
*/
OH_AVErrCode OH_LowPowerAudioSink_SetLoudnessGain(OH_LowPowerAudioSink* sink, float loudnessGain);
diff --git a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json
index 7e53713e491574d739dd5d83c218d7ebb6cf50de..8a200fc18de328596d4d55d6b9770a023491de05 100644
--- a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json
+++ b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json
@@ -9,6 +9,10 @@
},
{
"first_introduced": "20",
+ "name": "OH_LowPowerAVSink_GetCapability"
+ },
+ {
+ "first_introduced": "21",
"name": "OH_LowPowerAudioSink_CreateByMime"
},
{
@@ -68,7 +72,7 @@
"name": "OH_LowPowerAudioSink_ReturnSamples"
},
{
- "first_introduced": "20",
+ "first_introduced": "21",
"name": "OH_LowPowerAudioSink_SetLoudnessGain"
},
{
@@ -185,6 +189,10 @@
},
{
"first_introduced": "20",
+ "name": "OH_LowPowerVideoSink_GetLatestPts"
+ },
+ {
+ "first_introduced": "21",
"name": "OH_LowPowerVideoSink_RegisterCallback"
},
{
diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h
index fbb65514be1bc0084a98b97e3e490048d9582549..5b8e4e1ad23d71cfe9765d52f95f9f8fc56ccecd 100644
--- a/multimedia/player_framework/lowpower_avsink_base.h
+++ b/multimedia/player_framework/lowpower_avsink_base.h
@@ -53,6 +53,13 @@ extern "C" {
*/
typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer;
+/**
+ * @brief Forward declaration of OH_LowPowerAVSink_Capability.
+ *
+ * @since 20
+ */
+typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability;
+
/**
* @brief Append one OH_AVBuffer data to framePacketBuffer instance.
*
@@ -77,9 +84,22 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe
*/
int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer);
+/**
+ * @brief Query the supported capabilities of a lowpower audio/video sink.
+ *
+ * This function queries and returns the capability set supported by the current
+ * lowpower audio/video sink, including but not limited to supported media formats, etc.
+ *
+ * @return {OH_LowPowerAVSink_Capability*}
+ * - A pointer to the capability structure if the sink supports capability queries and the query is successful.
+ * - nullptr if the sink does not support capability queries or the query fails.
+ *
+ * @since 21
+ */
+OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability();
#ifdef __cplusplus
}
#endif
#endif // NATIVE_LOWPOWER_AVSINK_BASE_H
-/** @} */
\ No newline at end of file
+/** @} */
diff --git a/multimedia/player_framework/lowpower_video_sink.h b/multimedia/player_framework/lowpower_video_sink.h
index 52c77f14c4a3e9056c69c96720b405f143ecd6fc..3f91faa145973b9e0684db6173170d93121f5a2f 100644
--- a/multimedia/player_framework/lowpower_video_sink.h
+++ b/multimedia/player_framework/lowpower_video_sink.h
@@ -341,6 +341,20 @@ OH_AVErrCode OH_LowPowerVideoSink_ReturnSamples(OH_LowPowerVideoSink* sink, OH_A
*/
OH_AVErrCode OH_LowPowerVideoSink_RegisterCallback(OH_LowPowerVideoSink* sink, OH_LowPowerVideoSinkCallback* callback);
+/**
+ * @brief Get the latest presentation timestamp (PTS) from lowpower video sink.
+ *
+ * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance.
+ * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds).
+ * @return Returns AV_ERR_OK if the timestamp is obtained successfully;
+ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}:
+ * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid.
+ * {@link AV_ERR_SERVICE_DIED} media service is died.
+ * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted.
+ * @since 21
+ */
+OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *sink, int64_t *pts);
+
/**
* @brief Creates a lowpower video sink callback instance.
*
diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h
index 7ff7bb1511574ab7bb2c8660dddbef2d7de3161a..53204cd86638c2b2ba410dfadf53476d0956f8d2 100644
--- a/multimodalinput/kits/c/input/oh_input_manager.h
+++ b/multimodalinput/kits/c/input/oh_input_manager.h
@@ -640,6 +640,75 @@ void OH_Input_SetKeyEventDisplayId(struct Input_KeyEvent* keyEvent, int32_t disp
*/
int32_t OH_Input_GetKeyEventDisplayId(const struct Input_KeyEvent* keyEvent);
+/**
+ * @brief Get the eventId of the keyEvent.
+ *
+ * @param keyEvent - Key event object.
+ * @param eventId - Get the keyEvent eventId.
+ * @return OH_Input_GetKeyEventId function result code.
+ * {@link INPUT_SUCCESS} Get the eventId of the keyEvent success.\n
+ * {@link INPUT_PARAMETER_ERROR} Parameter check failed.\n
+ * @since 21
+ */
+
+Input_Result OH_Input_GetKeyEventId(const struct Input_KeyEvent* keyEvent, int32_t* eventId);
+
+/**
+ * @brief Add a keyEvent interception hook function. Before using this interface,
+ * the user needs to authorize it in the settings.
+ *
+ * @permission ohos.permission.HOOK_KEY_EVENT
+ * @param callback - Hook function, keyEvent will be sent to the hook function for priority processing.
+ * @return OH_Input_AddKeyEventHook function result code.
+ * {@link INPUT_SUCCESS} Added hook function successfully.\n
+ * {@link INPUT_PARAMETER_ERROR} Failed to add the hook function. Reason: Parameter check failed.\n
+ * {@link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n
+ * {@link INPUT_PERMISSION_DENIED} Failed to add the hook function. Reason: Permission check failed.\n
+ * {@link INPUT_REPEAT_INTERCEPTOR} Failed to add the hook function.\n
+ * Reason: Repeatedly set the hook function. A process can only have one key hook function.\n
+ * {@link INPUT_SERVICE_EXCEPTION} Failed to add the hook function.\n
+ * Reason: Input service exception, please try again.\n
+ * @since 21
+ */
+Input_Result OH_Input_AddKeyEventHook(Input_KeyEventCallback callback);
+
+/**
+ * @brief Remove keyEvent interception hook function.
+ *
+ * @param callback - Hook function, Same as the parameters when calling OH_Input_AddKeyEventHook.
+ * @return OH_Input_RemoveKeyEventHook function result code.
+ * {@link INPUT_SUCCESS} Hook function removed successfully.\n
+ * Even if the hook function has not been added before, it will return success when removed.\n
+ * {@link INPUT_PARAMETER_ERROR} Failed to remove the hook function. Reason: Parameter check failed.\n
+ * {@link INPUT_SERVICE_EXCEPTION} Failed to remove the hook function.\n
+ * Reason: Input service exception, please try again.\n
+ * @since 21
+ */
+Input_Result OH_Input_RemoveKeyEventHook(Input_KeyEventCallback callback);
+
+/**
+ * @brief Redispatches keyEvent.
+ * Only keyEvent intercepted by hook functions can be redispatched,
+ * and the event order must be maintained during redispatching.
+ * The hook function intercepts the input event and then redistributes it for 3 seconds.
+ * If this time is exceeded, calling this function will return INPUT_PARAMETER_ERROR.
+ * Re-dispatching requires event pairing, usually starting with one or more KEY_ACTION_DOWN and
+ * ending with KEY_ACTION_UP or KEY_ACTION_CANCEL.
+ * Only KEY_ACTION_UP or KEY_ACTION_CANCEL is redispatched, the function call succeeds,
+ * but no actual dispatch is made.
+ * If an event is dispatched that is not intercepted by the hook function,
+ * the function call succeeds, but no actual dispatch action is taken.
+ *
+ * @param eventId - keyEvent eventId.
+ * @return OH_Input_DispatchToNextHandler function result code.
+ * {@link INPUT_SUCCESS} Redistribution successful.\n
+ * {@link INPUT_PARAMETER_ERROR} Redistribution failed. Reason: KeyEvent does not exist.\n
+ * {@link INPUT_SERVICE_EXCEPTION} Redistribution failed.\n
+ * Reason: Input service exception, it's recommended to reset the pending distribution status.\n
+ * @since 21
+ */
+Input_Result OH_Input_DispatchToNextHandler(int32_t eventId);
+
/**
* @brief Inject mouse event.
* since API 20, it is recommended to use OH_Input_RequestInjection
@@ -1389,7 +1458,7 @@ Input_Result OH_Input_GetAxisEventSourceType(const Input_AxisEvent* axisEvent, I
*
* @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}.
* @param windowId The windowId for the axis event.
- * @return OH_Input_SetAxisEventDisplayY function result code.
+ * @return OH_Input_SetAxisEventWindowId function result code.
* {@link INPUT_SUCCESS} Sets the Y coordinate of the axis event success.\n
* {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n
* @syscap SystemCapability.MultimodalInput.Input.Core
@@ -1402,7 +1471,7 @@ Input_Result OH_Input_SetAxisEventWindowId(Input_AxisEvent* axisEvent, int32_t w
*
* @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}.
* @param windowId The windowId for the axis event.
- * @return OH_Input_GetAxisEventDisplayY function result code.
+ * @return OH_Input_GetAxisEventWindowId function result code.
* {@link INPUT_SUCCESS} Obtains the Y coordinate of the axis event success.\n
* {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayY is NULL.\n
* @syscap SystemCapability.MultimodalInput.Input.Core
@@ -1415,7 +1484,7 @@ Input_Result OH_Input_GetAxisEventWindowId(const Input_AxisEvent* axisEvent, int
*
* @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}.
* @param displayId The displayId for the axis event.
- * @return OH_Input_SetAxisEventDisplayY function result code.
+ * @return OH_Input_SetAxisEventDisplayId function result code.
* {@link INPUT_SUCCESS} Sets the Y coordinate of the axis event success.\n
* {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n
* @syscap SystemCapability.MultimodalInput.Input.Core
@@ -1428,7 +1497,7 @@ Input_Result OH_Input_SetAxisEventDisplayId(Input_AxisEvent* axisEvent, int32_t
*
* @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}.
* @param displayId The displayId for the axis event.
- * @return OH_Input_GetAxisEventDisplayY function result code.
+ * @return OH_Input_GetAxisEventDisplayId function result code.
* {@link INPUT_SUCCESS} Obtains the Y coordinate of the axis event success.\n
* {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayY is NULL.\n
* @syscap SystemCapability.MultimodalInput.Input.Core
@@ -1775,7 +1844,7 @@ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey);
*
* @param hotkey Hotkey key object.
* @param finalKeyCode Returns the key value of the decorated key.
- * @return OH_Input_GetfinalKey status code, specifically,
+ * @return OH_Input_GetFinalKey status code, specifically,
* {@link INPUT_SUCCESS} if the operation is successful;\n
* {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL;\n
* {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n
@@ -1840,7 +1909,7 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat);
*
* @param hotkey Shortcut key object.
* @param isRepeat Whether a key event is repeated.
- * @return OH_Input_GetIsRepeat status code, specifically,
+ * @return OH_Input_GetRepeat status code, specifically,
* {@link INPUT_SUCCESS} if the operation is successful;\n
* {@link INPUT_PARAMETER_ERROR} otherwise;\n
* {@Link INPUT_DEVICE_NOT_SUPPORTED} Capability not supported.\n
@@ -2061,7 +2130,7 @@ Input_Result OH_Input_UnregisterDeviceListener(Input_DeviceListener* listener);
/**
* @brief Unregisters the listener for all device hot swap events.
*
- * @return OH_Input_UnregisterDeviceListener status code, specifically,
+ * @return OH_Input_UnregisterDeviceListeners status code, specifically,
* {@link INPUT_SUCCESS} if the operation is successful;\n
* {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal.
* @syscap SystemCapability.MultimodalInput.Input.Core
@@ -2093,7 +2162,7 @@ Input_Result OH_Input_GetFunctionKeyState(int32_t keyCode, int32_t *state);
* {@link INPUT_SUCCESS} if the operation is successful;
* {@link INPUT_PARAMETER_ERROR} if count is a null pointer.
* @since 20
-*/
+ */
Input_Result OH_Input_QueryMaxTouchPoints(int32_t *count);
/**
diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json
index 2747b8fa116a9a466fdf8ea14418d3bb98e44bde..83ce83a89e1f7616f1a2209909699df32b1c7d9c 100644
--- a/multimodalinput/kits/c/ohinput.ndk.json
+++ b/multimodalinput/kits/c/ohinput.ndk.json
@@ -569,5 +569,21 @@
{
"first_introduced": "20",
"name": "OH_Input_InjectTouchEventGlobal"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Input_GetKeyEventId"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Input_AddKeyEventHook"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Input_RemoveKeyEventHook"
+ },
+ {
+ "first_introduced": "21",
+ "name": "OH_Input_DispatchToNextHandler"
}
]
\ No newline at end of file
diff --git a/third_party/musl/ndk_script/toolchain.sh b/third_party/musl/ndk_script/toolchain.sh
index db0cf489e508e0aa596db564b527679d41069a8f..4c87b345f9c93d4f5f7ac2b6134bed6a4379f587 100755
--- a/third_party/musl/ndk_script/toolchain.sh
+++ b/third_party/musl/ndk_script/toolchain.sh
@@ -74,3 +74,9 @@ function remove_unnecessary_file() {
}
remove_unnecessary_file
strip_dir ${OUT_DIR}/lib
+if [ -f "${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so" ]; then
+ ${TOOL_DIR}/llvm-strip ${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so
+fi
+if [ -f "${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so" ]; then
+ ${TOOL_DIR}/llvm-strip ${OUT_DIR}/bin/python/lib/python3.11/lldb/_lldb.so
+fi
diff --git a/web/webview/interfaces/native/arkweb_scheme_handler.h b/web/webview/interfaces/native/arkweb_scheme_handler.h
index ead91cb02d62dd45e942a3335f06e5c15e53f1ab..d0232f3c3499a6c5e438f57a4cf8251d0d9531a3 100644
--- a/web/webview/interfaces/native/arkweb_scheme_handler.h
+++ b/web/webview/interfaces/native/arkweb_scheme_handler.h
@@ -1024,8 +1024,7 @@ int32_t OH_ArkWebResourceHandler_DidFailWithError(const ArkWeb_ResourceHandler*
* if DidReceiveResponse has not been called,
* a response is automatically constructed and the current request is terminated.
* @return {@link ARKWEB_NET_OK} 0 - Success.
- * {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param, the errorCode is either ARKWEB_NET_OK
- * or outside the range of error codes in ArkWeb_NetError.
+ * {@link ARKWEB_INVALID_PARAM} 17100101 - Invalid param, the resourceHandler is nullptr.
* @since 20
*/
int32_t OH_ArkWebResourceHandler_DidFailWithErrorV2(const ArkWeb_ResourceHandler* resourceHandler,
diff --git a/web/webview/interfaces/native/libohweb.ndk.json b/web/webview/interfaces/native/libohweb.ndk.json
index c86a02925aa59078751e1186c6315c1a960ed980..1cdb08fd6a841b158b8b48b1388fde3371b32d21 100644
--- a/web/webview/interfaces/native/libohweb.ndk.json
+++ b/web/webview/interfaces/native/libohweb.ndk.json
@@ -366,5 +366,13 @@
{
"first_introduced": "20",
"name": "OH_ArkWebResourceHandler_DidFailWithErrorV2"
+ },
+ {
+ "first_introduced": "20",
+ "name": "OH_NativeArkWeb_SetActiveWebEngineVersion"
+ },
+ {
+ "first_introduced": "20",
+ "name": "OH_NativeArkWeb_GetActiveWebEngineVersion"
}
]
diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h
index 10332371c25cfc6edba29c677bbef88757d8712b..122d0c50bb4363bbcec2ba7b86b7f04fb4b1a7d3 100644
--- a/web/webview/interfaces/native/native_interface_arkweb.h
+++ b/web/webview/interfaces/native/native_interface_arkweb.h
@@ -93,6 +93,34 @@ typedef struct {
int32_t loadingTime;
} ArkWeb_BlanklessInfo;
+/**
+ * @brief ArkWeb Engine Version.
+ *
+ * ArkWeb Dual Web Engine Versioning Convention:
+ * See [ArkWeb Dual Web Engine Versioning Convention] for switching between Legacy and Evergreen Web Engine.
+ *
+ * @since 20
+ */
+typedef enum {
+ /**
+ * the system default ArkWeb engine.
+ * @since 20
+ */
+ SYSTEM_DEFAULT = 0,
+
+ /**
+ * ArkWeb M114 version.
+ * @since 20
+ */
+ ARKWEB_M114 = 1,
+
+ /**
+ * ArkWeb M132 version.
+ * @since 20
+ */
+ ARKWEB_M132 = 2,
+} ArkWebEngineVersion;
+
/**
* @brief Loads a piece of code and execute JS code in the context of the currently displayed page.
*
@@ -315,6 +343,30 @@ ArkWeb_ErrorCode OH_ArkWebCookieManager_SaveCookieSync();
*/
void OH_ArkWebCookieManager_SaveCookieAsync(OH_ArkWeb_OnCookieSaveCallback callback);
+/**
+ * Set active ArkWeb engine version.
+ * If the system does not support the specified version, it will not take effect.
+ *
+ * This is a global static API that must be called before initializeWebEngine, and it will have no effect if any
+ * Web components are loaded.
+ *
+ * Legacy Web Engine Compatibility Note:
+ *
When using legacy ArkWeb Engine, some ArkWeb newly created API will not take effect,
+ * see [Compatible with Legacy Web Engine in release note] for compatibility guidelines.
+ *
+ *
+ * @param { ArkWebEngineVersion } webEngineVersion - the ArkWebEngineVersion
+ * @since 20
+ */
+void OH_NativeArkWeb_SetActiveWebEngineVersion(ArkWebEngineVersion webEngineVersion);
+
+/**
+ * Get currently active ArkWeb engine version.
+ * @return { ArkWebEngineVersion } Active ArkWeb Engine version as defined by ArkWebEngineVersion
+ * @since 20
+ */
+ArkWebEngineVersion OH_NativeArkWeb_GetActiveWebEngineVersion();
+
#ifdef __cplusplus
};
#endif