From 25a9874d7591057c06f6e6b0c614a941fba4963a Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Fri, 22 Aug 2025 11:05:59 +0000 Subject: [PATCH 1/5] =?UTF-8?q?!24944=20screenlock=20fix=20compile=20error?= =?UTF-8?q?=20Merge=20pull=20request=20!24944=20from=20=E6=96=87=E6=B8=85?= =?UTF-8?q?=E5=8D=8E/OpenHarmony=5Ffeature=5F20250702?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.screenLock.d.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts index 7bb05595ec..bfc3481c9c 100644 --- a/api/@ohos.screenLock.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -226,10 +226,11 @@ declare namespace screenLock { /** * Indicates the strong authentication reason flags used to request. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ enum StrongAuthReasonFlags { /** @@ -237,7 +238,8 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ NONE = 0x00000000, @@ -246,7 +248,8 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ AFTER_BOOT = 0x00000001, @@ -255,7 +258,8 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ AFTER_TIMEOUT = 0x00000002, @@ -264,7 +268,8 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ ACTIVE_REQUEST = 0x00000004, @@ -273,7 +278,8 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ POLICY_RESTRICTION = 0x00000008 } @@ -281,10 +287,11 @@ declare namespace screenLock { /** * Indicates the screen lock authentication state. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ enum AuthState { /** -- Gitee From 38f776781758dc847a153e9a5ec41646479aaeb9 Mon Sep 17 00:00:00 2001 From: qinghuawen <1427556481@qq.com> Date: Sat, 30 Aug 2025 10:19:58 +0800 Subject: [PATCH 2/5] settings number to int 0728 Signed-off-by: qinghuawen <1427556481@qq.com> --- api/@ohos.settings.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/@ohos.settings.d.ts b/api/@ohos.settings.d.ts index 36cd56566a..af16bb2b17 100644 --- a/api/@ohos.settings.d.ts +++ b/api/@ohos.settings.d.ts @@ -79,7 +79,8 @@ declare namespace settings { * @constant * @syscap SystemCapability.Applications.Settings.Core * @systemapi - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ const USER_SECURITY: string; } @@ -188,7 +189,7 @@ declare namespace settings { * @syscap SystemCapability.Applications.Settings.Core * @since 7 */ - const AUTO_SCREEN_BRIGHTNESS_MODE: number + const AUTO_SCREEN_BRIGHTNESS_MODE: int /** * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when manual screen brightness adjustment is used. @@ -197,7 +198,7 @@ declare namespace settings { * @syscap SystemCapability.Applications.Settings.Core * @since 7 */ - const MANUAL_SCREEN_BRIGHTNESS_MODE: number + const MANUAL_SCREEN_BRIGHTNESS_MODE: int /** * Indicates the duration that the device waits before going to sleep after a period of inactivity, in -- Gitee From 3547d0ceb7870985a7fd05e7bbbf980f090a26ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=B8=85=E5=8D=8E?= <1427556481@qq.com> Date: Sat, 30 Aug 2025 06:29:13 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20api/?= =?UTF-8?q?@ohos.screenLock.d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.screenLock.d.ts | 582 -------------------------------------- 1 file changed, 582 deletions(-) delete mode 100644 api/@ohos.screenLock.d.ts diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts deleted file mode 100644 index bfc3481c9c..0000000000 --- a/api/@ohos.screenLock.d.ts +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * @kit BasicServicesKit - */ - -import { AsyncCallback } from './@ohos.base'; -import { Callback } from './@ohos.base'; - -/** - * systemScreenLock - * - * @namespace screenLock - * @syscap SystemCapability.MiscServices.ScreenLock - * @since arkts {'1.1':'7', '1.2':'20'} - * @arkts 1.1&1.2 - */ -declare namespace screenLock { - /** - * Checks whether the screen is currently locked. - * - * @param { AsyncCallback } callback - the callback of isScreenLocked. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function isScreenLocked(callback: AsyncCallback): void; - - /** - * Checks whether the screen is currently locked. - * - * @returns { Promise } the promise returned by the function. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function isScreenLocked(): Promise; - - /** - * Checks whether the screen is currently locked. - * - * @returns { boolean } returns true if the screen is currently locked, returns false otherwise. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function isLocked(): boolean; - - /** - * Checks whether the screen lock of the current device is secure. - * - * @param { AsyncCallback } callback - the callback of isSecureMode. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function isSecureMode(callback: AsyncCallback): void; - - /** - * Checks whether the screen lock of the current device is secure. - * - * @returns { Promise } the promise returned by the function. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function isSecureMode(): Promise; - - /** - * Unlock the screen. - * - * @param { AsyncCallback } callback - the callback of unlockScreen. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function unlockScreen(callback: AsyncCallback): void; - - /** - * Unlock the screen. - * - * @returns { Promise } the promise returned by the function. - * @syscap SystemCapability.MiscServices.ScreenLock - * @since 7 - * @deprecated since 9 - */ - function unlockScreen(): Promise; - - /** - * Unlock the screen. - * - * @param { AsyncCallback } callback - the callback of unlock. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since 9 - */ - /** - * Unlock the screen. - * - * @param { AsyncCallback } callback - the callback of unlock. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @throws { BusinessError } 13200003 - Invalid use. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function unlock(callback: AsyncCallback): void; - - /** - * Unlock the screen. - * - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since 9 - */ - /** - * Unlock the screen. - * - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @throws { BusinessError } 13200003 - Invalid use. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function unlock(): Promise; - - /** - * Lock the screen. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @param { AsyncCallback } callback - the callback of lock. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function lock(callback: AsyncCallback): void; - - /** - * Lock the screen. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function lock(): Promise; - - /** - * Indicates the system event type related to the screenlock management service. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - /** - * Indicates the system event type related to the screenlock management service. Adding strongAuthChanged and screenLockDisabledChanged. - * - * @typedef {('beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen' - * | 'lockScreen' | 'beginExitAnimation' | 'beginSleep' | 'endSleep' | 'changeUser' | 'screenlockEnabled' | 'serviceRestart' - * | 'strongAuthChanged' | 'screenLockDisabledChanged')} - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - type EventType = - 'beginWakeUp' - | 'endWakeUp' - | 'beginScreenOn' - | 'endScreenOn' - | 'beginScreenOff' - | 'endScreenOff' - | 'unlockScreen' - | 'lockScreen' - | 'beginExitAnimation' - | 'beginSleep' - | 'endSleep' - | 'changeUser' - | 'screenlockEnabled' - | 'serviceRestart' - | 'strongAuthChanged' - | 'screenLockDisabledChanged'; - - /** - * Indicates the strong authentication reason flags used to request. - * - * @enum { int } - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - enum StrongAuthReasonFlags { - /** - * Indicates that there are no strong authentication reason flags. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - NONE = 0x00000000, - - /** - * Indicates the strong authentication reason requested after boot. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - AFTER_BOOT = 0x00000001, - - /** - * Indicates the strong authentication reason requested after timeout. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - AFTER_TIMEOUT = 0x00000002, - - /** - * Indicates the strong authentication reason requested by active request. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - ACTIVE_REQUEST = 0x00000004, - - /** - * Indicates the strong authentication reason requested by policy restriction. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - POLICY_RESTRICTION = 0x00000008 - } - - /** - * Indicates the screen lock authentication state. - * - * @enum { int } - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - enum AuthState { - /** - * Indicates the screen lock is not authenticated. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - NOT_AUTHED = 0, - - /** - * Indicates the screen lock is pre authenticated by credential. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - PRE_AUTHED_BY_CREDENTIAL = 1, - - /** - * Indicates the screen lock is pre authenticated by fingerprint. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - PRE_AUTHED_BY_FINGERPRINT = 2, - - /** - * Indicates the screen lock is pre authenticated by face. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - PRE_AUTHED_BY_FACE = 3, - - /** - * Indicates the screen lock is authenticated by credential. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - AUTHED_BY_CREDENTIAL = 4, - - /** - * Indicates the screen lock is authenticated by fingerprint. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - AUTHED_BY_FINGERPRINT = 5, - - /** - * Indicates the screen lock is authenticated by face. - * - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - AUTHED_BY_FACE = 6, - } - - /** - * Indicates the system event type and parameter related to the screenlock management service. - * - * @typedef SystemEvent - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - interface SystemEvent { - /** - * Indicates the system event type related to the screenlock management service. - * - * @type { EventType } - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - eventType: EventType; - /** - * Identifies the customized extended parameter of an event. - * - * @type { string } - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - params: string; - } - - /** - * Register system event related to screen lock service. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @param { Callback } callback - the callback of onSystemEvent. - * @returns { boolean } returns true if register system event is success, returns false otherwise. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function onSystemEvent(callback: Callback): boolean; - - /** - * The screen lock app sends the event to the screen lock service. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @param { String } event - event type. - * @param { number } parameter - operation result of the event. - * @param { AsyncCallback } callback - the callback of sendScreenLockEvent. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void; - - /** - * The screen lock app sends the event to the screen lock service. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @param { String } event - event type. - * @param { number } parameter - operation result of the event. - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function sendScreenLockEvent(event: String, parameter: number): Promise; - - /** - * Request strong authentication for os account local userId. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK - * @param { StrongAuthReasonFlags } reasonFlag - The strong authentication reason flag. - * @param { number } userId - Os account local userId. - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since 12 - */ - function requestStrongAuth(reasonFlag: StrongAuthReasonFlags, userId: number): Promise; - - /** - * Obtain strong authentication reason flags for os account local userId. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK - * @param { number } userId - Os account local userId. - * @returns { number } the strong authentication reason flags. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function getStrongAuth(userId: number): number; - - /** - * Disable screen lock showing for os account local userId. This only becomes effective when there is no password. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK - * @param { boolean } disable - disable or enable screen lock showing. - * @param { number } userId - Os account local userId. - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function setScreenLockDisabled(disable: boolean, userId: number): Promise; - - /** - * Check whether screen lock is disabled for os account local userId. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK - * @param { number } userId - Os account local userId. - * @returns { boolean } whether screen lock is disabled. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function isScreenLockDisabled(userId: number): boolean; - - /** - * Set the screen lock authentication state for os account local userId. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER - * @param { AuthState } state - the screen lock authentication state. - * @param { number } userId - Os account local userId. - * @param { Uint8Array } authToken - the authentication token for this state - * @returns { Promise } the promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function setScreenLockAuthState(state: AuthState, userId: number, authToken: Uint8Array): Promise; - - /** - * Obtain the screen lock authentication state for os account local userId. - * - * @permission ohos.permission.ACCESS_SCREEN_LOCK - * @param { number } userId - Os account local userId. - * @returns { AuthState } the screen lock authentication state. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. - *
2. Incorrect parameter types. - * @throws { BusinessError } 201 - permission denied. - * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function getScreenLockAuthState(userId: number): AuthState; - - /** - * Check whether the device is currently locked and the screenlock requires an identity to authenticate and unlock. - * - * @param { number } userId - Os account local userId. - * @returns { boolean } Whether the device is currently locked. - * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. - * @throws { BusinessError } 13200002 - The screenlock management service is abnormal. - * @throws { BusinessError } 13200004 - The userId is not same as the caller, and is not allowed for the caller. - * @syscap SystemCapability.MiscServices.ScreenLock - * @systemapi Hide this for inner system use. - * @since 20 - */ - function isDeviceLocked(userId: number): boolean; -} - -export default screenLock; \ No newline at end of file -- Gitee From 21d74bd84305e6887286f6c5d5c22c59f5011963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=B8=85=E5=8D=8E?= <1427556481@qq.com> Date: Sat, 30 Aug 2025 06:41:16 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20api/@ohos.screenLock.d.ts"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3547d0ceb7870985a7fd05e7bbbf980f090a26ea. --- api/@ohos.screenLock.d.ts | 582 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 582 insertions(+) create mode 100644 api/@ohos.screenLock.d.ts diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts new file mode 100644 index 0000000000..bfc3481c9c --- /dev/null +++ b/api/@ohos.screenLock.d.ts @@ -0,0 +1,582 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +import { AsyncCallback } from './@ohos.base'; +import { Callback } from './@ohos.base'; + +/** + * systemScreenLock + * + * @namespace screenLock + * @syscap SystemCapability.MiscServices.ScreenLock + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace screenLock { + /** + * Checks whether the screen is currently locked. + * + * @param { AsyncCallback } callback - the callback of isScreenLocked. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function isScreenLocked(callback: AsyncCallback): void; + + /** + * Checks whether the screen is currently locked. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function isScreenLocked(): Promise; + + /** + * Checks whether the screen is currently locked. + * + * @returns { boolean } returns true if the screen is currently locked, returns false otherwise. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function isLocked(): boolean; + + /** + * Checks whether the screen lock of the current device is secure. + * + * @param { AsyncCallback } callback - the callback of isSecureMode. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function isSecureMode(callback: AsyncCallback): void; + + /** + * Checks whether the screen lock of the current device is secure. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function isSecureMode(): Promise; + + /** + * Unlock the screen. + * + * @param { AsyncCallback } callback - the callback of unlockScreen. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function unlockScreen(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 + * @deprecated since 9 + */ + function unlockScreen(): Promise; + + /** + * Unlock the screen. + * + * @param { AsyncCallback } callback - the callback of unlock. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + /** + * Unlock the screen. + * + * @param { AsyncCallback } callback - the callback of unlock. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @throws { BusinessError } 13200003 - Invalid use. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function unlock(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + /** + * Unlock the screen. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @throws { BusinessError } 13200003 - Invalid use. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function unlock(): Promise; + + /** + * Lock the screen. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { AsyncCallback } callback - the callback of lock. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function lock(callback: AsyncCallback): void; + + /** + * Lock the screen. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function lock(): Promise; + + /** + * Indicates the system event type related to the screenlock management service. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + /** + * Indicates the system event type related to the screenlock management service. Adding strongAuthChanged and screenLockDisabledChanged. + * + * @typedef {('beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen' + * | 'lockScreen' | 'beginExitAnimation' | 'beginSleep' | 'endSleep' | 'changeUser' | 'screenlockEnabled' | 'serviceRestart' + * | 'strongAuthChanged' | 'screenLockDisabledChanged')} + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + type EventType = + 'beginWakeUp' + | 'endWakeUp' + | 'beginScreenOn' + | 'endScreenOn' + | 'beginScreenOff' + | 'endScreenOff' + | 'unlockScreen' + | 'lockScreen' + | 'beginExitAnimation' + | 'beginSleep' + | 'endSleep' + | 'changeUser' + | 'screenlockEnabled' + | 'serviceRestart' + | 'strongAuthChanged' + | 'screenLockDisabledChanged'; + + /** + * Indicates the strong authentication reason flags used to request. + * + * @enum { int } + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + enum StrongAuthReasonFlags { + /** + * Indicates that there are no strong authentication reason flags. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + NONE = 0x00000000, + + /** + * Indicates the strong authentication reason requested after boot. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + AFTER_BOOT = 0x00000001, + + /** + * Indicates the strong authentication reason requested after timeout. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + AFTER_TIMEOUT = 0x00000002, + + /** + * Indicates the strong authentication reason requested by active request. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + ACTIVE_REQUEST = 0x00000004, + + /** + * Indicates the strong authentication reason requested by policy restriction. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + POLICY_RESTRICTION = 0x00000008 + } + + /** + * Indicates the screen lock authentication state. + * + * @enum { int } + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + enum AuthState { + /** + * Indicates the screen lock is not authenticated. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + NOT_AUTHED = 0, + + /** + * Indicates the screen lock is pre authenticated by credential. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + PRE_AUTHED_BY_CREDENTIAL = 1, + + /** + * Indicates the screen lock is pre authenticated by fingerprint. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + PRE_AUTHED_BY_FINGERPRINT = 2, + + /** + * Indicates the screen lock is pre authenticated by face. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + PRE_AUTHED_BY_FACE = 3, + + /** + * Indicates the screen lock is authenticated by credential. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + AUTHED_BY_CREDENTIAL = 4, + + /** + * Indicates the screen lock is authenticated by fingerprint. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + AUTHED_BY_FINGERPRINT = 5, + + /** + * Indicates the screen lock is authenticated by face. + * + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + AUTHED_BY_FACE = 6, + } + + /** + * Indicates the system event type and parameter related to the screenlock management service. + * + * @typedef SystemEvent + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + interface SystemEvent { + /** + * Indicates the system event type related to the screenlock management service. + * + * @type { EventType } + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + eventType: EventType; + /** + * Identifies the customized extended parameter of an event. + * + * @type { string } + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + params: string; + } + + /** + * Register system event related to screen lock service. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { Callback } callback - the callback of onSystemEvent. + * @returns { boolean } returns true if register system event is success, returns false otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function onSystemEvent(callback: Callback): boolean; + + /** + * The screen lock app sends the event to the screen lock service. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { String } event - event type. + * @param { number } parameter - operation result of the event. + * @param { AsyncCallback } callback - the callback of sendScreenLockEvent. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void; + + /** + * The screen lock app sends the event to the screen lock service. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { String } event - event type. + * @param { number } parameter - operation result of the event. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function sendScreenLockEvent(event: String, parameter: number): Promise; + + /** + * Request strong authentication for os account local userId. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK + * @param { StrongAuthReasonFlags } reasonFlag - The strong authentication reason flag. + * @param { number } userId - Os account local userId. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 12 + */ + function requestStrongAuth(reasonFlag: StrongAuthReasonFlags, userId: number): Promise; + + /** + * Obtain strong authentication reason flags for os account local userId. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK + * @param { number } userId - Os account local userId. + * @returns { number } the strong authentication reason flags. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getStrongAuth(userId: number): number; + + /** + * Disable screen lock showing for os account local userId. This only becomes effective when there is no password. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK + * @param { boolean } disable - disable or enable screen lock showing. + * @param { number } userId - Os account local userId. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function setScreenLockDisabled(disable: boolean, userId: number): Promise; + + /** + * Check whether screen lock is disabled for os account local userId. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK + * @param { number } userId - Os account local userId. + * @returns { boolean } whether screen lock is disabled. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function isScreenLockDisabled(userId: number): boolean; + + /** + * Set the screen lock authentication state for os account local userId. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { AuthState } state - the screen lock authentication state. + * @param { number } userId - Os account local userId. + * @param { Uint8Array } authToken - the authentication token for this state + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function setScreenLockAuthState(state: AuthState, userId: number, authToken: Uint8Array): Promise; + + /** + * Obtain the screen lock authentication state for os account local userId. + * + * @permission ohos.permission.ACCESS_SCREEN_LOCK + * @param { number } userId - Os account local userId. + * @returns { AuthState } the screen lock authentication state. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getScreenLockAuthState(userId: number): AuthState; + + /** + * Check whether the device is currently locked and the screenlock requires an identity to authenticate and unlock. + * + * @param { number } userId - Os account local userId. + * @returns { boolean } Whether the device is currently locked. + * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - The screenlock management service is abnormal. + * @throws { BusinessError } 13200004 - The userId is not same as the caller, and is not allowed for the caller. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 20 + */ + function isDeviceLocked(userId: number): boolean; +} + +export default screenLock; \ No newline at end of file -- Gitee From 0fab7ddcbf1882e98e868e016ba8f02816be0a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=B8=85=E5=8D=8E?= <1427556481@qq.com> Date: Sat, 30 Aug 2025 06:42:32 +0000 Subject: [PATCH 5/5] Revert "!24944 screenlock fix compile error" This reverts commit 25a9874d7591057c06f6e6b0c614a941fba4963a. --- api/@ohos.screenLock.d.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts index bfc3481c9c..7bb05595ec 100644 --- a/api/@ohos.screenLock.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -226,11 +226,10 @@ declare namespace screenLock { /** * Indicates the strong authentication reason flags used to request. * - * @enum { int } + * @enum { number } * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enum StrongAuthReasonFlags { /** @@ -238,8 +237,7 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ NONE = 0x00000000, @@ -248,8 +246,7 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ AFTER_BOOT = 0x00000001, @@ -258,8 +255,7 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ AFTER_TIMEOUT = 0x00000002, @@ -268,8 +264,7 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ACTIVE_REQUEST = 0x00000004, @@ -278,8 +273,7 @@ declare namespace screenLock { * * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ POLICY_RESTRICTION = 0x00000008 } @@ -287,11 +281,10 @@ declare namespace screenLock { /** * Indicates the screen lock authentication state. * - * @enum { int } + * @enum { number } * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enum AuthState { /** -- Gitee