diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 6dc429c950a5b0585cf8a3b7b7261cdb4a5f0115..d8a6495b8f3d2bc63dda4384e81d9290723fcb25 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -10942,6 +10942,37 @@ declare namespace window { */ getSubWindowZLevel(): number; + /** + * Set whether this window limits screen rotation when this window is shown. + * + * @param { boolean } locked - Screen rotation lock status to set. + * @returns { Promise } - Promise that returns no value. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 801 - Capability not supported. Function setRotationLocked can not work correctly due + * to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300029 - This window type is invalid. + * @syscap SystemCapability.Window.SessionManager + * @since 22 + */ + setRotationLocked(locked: boolean): Promise; + + /** + * Get whether this window limits screen rotation when this window is shown. + * + * @returns { boolean } - Screen rotation lock status of this window. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 801 - Capability not supported. Function setRotationLocked can not work correctly due + * to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300029 - This window type is invalid. + * @syscap SystemCapability.Window.SessionManager + * @since 22 + */ + getRotationLocked(): boolean; + /** * Set the keyframe policy when dragging to resize. *