161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit BasicServicesKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base';
2261847f8eSopenharmony_ciimport { Callback } from './@ohos.base';
2361847f8eSopenharmony_ci
2461847f8eSopenharmony_ci/**
2561847f8eSopenharmony_ci * systemScreenLock
2661847f8eSopenharmony_ci *
2761847f8eSopenharmony_ci * @namespace screenLock
2861847f8eSopenharmony_ci * @syscap SystemCapability.MiscServices.ScreenLock
2961847f8eSopenharmony_ci * @since 7
3061847f8eSopenharmony_ci */
3161847f8eSopenharmony_cideclare namespace screenLock {
3261847f8eSopenharmony_ci  /**
3361847f8eSopenharmony_ci   * Checks whether the screen is currently locked.
3461847f8eSopenharmony_ci   *
3561847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of isScreenLocked.
3661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
3761847f8eSopenharmony_ci   * @since 7
3861847f8eSopenharmony_ci   * @deprecated since 9
3961847f8eSopenharmony_ci   */
4061847f8eSopenharmony_ci  function isScreenLocked(callback: AsyncCallback<boolean>): void;
4161847f8eSopenharmony_ci
4261847f8eSopenharmony_ci  /**
4361847f8eSopenharmony_ci   * Checks whether the screen is currently locked.
4461847f8eSopenharmony_ci   *
4561847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
4661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
4761847f8eSopenharmony_ci   * @since 7
4861847f8eSopenharmony_ci   * @deprecated since 9
4961847f8eSopenharmony_ci   */
5061847f8eSopenharmony_ci  function isScreenLocked(): Promise<boolean>;
5161847f8eSopenharmony_ci
5261847f8eSopenharmony_ci  /**
5361847f8eSopenharmony_ci   * Checks whether the screen is currently locked.
5461847f8eSopenharmony_ci   *
5561847f8eSopenharmony_ci   * @returns { boolean } returns true if the screen is currently locked, returns false otherwise.
5661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
5761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
5861847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
5961847f8eSopenharmony_ci   * @since 9
6061847f8eSopenharmony_ci   */
6161847f8eSopenharmony_ci  function isLocked(): boolean;
6261847f8eSopenharmony_ci
6361847f8eSopenharmony_ci  /**
6461847f8eSopenharmony_ci   * Checks whether the screen lock of the current device is secure.
6561847f8eSopenharmony_ci   *
6661847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of isSecureMode.
6761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
6861847f8eSopenharmony_ci   * @since 7
6961847f8eSopenharmony_ci   * @deprecated since 9
7061847f8eSopenharmony_ci   */
7161847f8eSopenharmony_ci  function isSecureMode(callback: AsyncCallback<boolean>): void;
7261847f8eSopenharmony_ci
7361847f8eSopenharmony_ci  /**
7461847f8eSopenharmony_ci   * Checks whether the screen lock of the current device is secure.
7561847f8eSopenharmony_ci   *
7661847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
7761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
7861847f8eSopenharmony_ci   * @since 7
7961847f8eSopenharmony_ci   * @deprecated since 9
8061847f8eSopenharmony_ci   */
8161847f8eSopenharmony_ci  function isSecureMode(): Promise<boolean>;
8261847f8eSopenharmony_ci
8361847f8eSopenharmony_ci  /**
8461847f8eSopenharmony_ci   * Unlock the screen.
8561847f8eSopenharmony_ci   *
8661847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - the callback of unlockScreen.
8761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
8861847f8eSopenharmony_ci   * @since 7
8961847f8eSopenharmony_ci   * @deprecated since 9
9061847f8eSopenharmony_ci   */
9161847f8eSopenharmony_ci  function unlockScreen(callback: AsyncCallback<void>): void;
9261847f8eSopenharmony_ci
9361847f8eSopenharmony_ci  /**
9461847f8eSopenharmony_ci   * Unlock the screen.
9561847f8eSopenharmony_ci   *
9661847f8eSopenharmony_ci   * @returns { Promise<void> } the promise returned by the function.
9761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
9861847f8eSopenharmony_ci   * @since 7
9961847f8eSopenharmony_ci   * @deprecated since 9
10061847f8eSopenharmony_ci   */
10161847f8eSopenharmony_ci  function unlockScreen(): Promise<void>;
10261847f8eSopenharmony_ci
10361847f8eSopenharmony_ci  /**
10461847f8eSopenharmony_ci   * Unlock the screen.
10561847f8eSopenharmony_ci   *
10661847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of unlock.
10761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
10861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
10961847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
11061847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
11161847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
11261847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
11361847f8eSopenharmony_ci   * @since 9
11461847f8eSopenharmony_ci   */
11561847f8eSopenharmony_ci  /**
11661847f8eSopenharmony_ci   * Unlock the screen.
11761847f8eSopenharmony_ci   *
11861847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of unlock.
11961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
12061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
12161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
12261847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 13200003 - Invalid use.
12461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
12561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
12661847f8eSopenharmony_ci   * @since 11
12761847f8eSopenharmony_ci   */
12861847f8eSopenharmony_ci  function unlock(callback: AsyncCallback<boolean>): void;
12961847f8eSopenharmony_ci
13061847f8eSopenharmony_ci  /**
13161847f8eSopenharmony_ci   * Unlock the screen.
13261847f8eSopenharmony_ci   *
13361847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
13461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
13561847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
13661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
13761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
13861847f8eSopenharmony_ci   * @since 9
13961847f8eSopenharmony_ci   */
14061847f8eSopenharmony_ci  /**
14161847f8eSopenharmony_ci   * Unlock the screen.
14261847f8eSopenharmony_ci   *
14361847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
14461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
14561847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
14661847f8eSopenharmony_ci   * @throws { BusinessError } 13200003 - Invalid use.
14761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
14861847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
14961847f8eSopenharmony_ci   * @since 11
15061847f8eSopenharmony_ci   */
15161847f8eSopenharmony_ci  function unlock(): Promise<boolean>;
15261847f8eSopenharmony_ci
15361847f8eSopenharmony_ci  /**
15461847f8eSopenharmony_ci   * Lock the screen.
15561847f8eSopenharmony_ci   *
15661847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
15761847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of lock.
15861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
15961847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
16161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
16261847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
16361847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
16461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
16561847f8eSopenharmony_ci   * @since 9
16661847f8eSopenharmony_ci   */
16761847f8eSopenharmony_ci  function lock(callback: AsyncCallback<boolean>): void;
16861847f8eSopenharmony_ci
16961847f8eSopenharmony_ci  /**
17061847f8eSopenharmony_ci   * Lock the screen.
17161847f8eSopenharmony_ci   *
17261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
17361847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
17461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
17561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
17661847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
17761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
17861847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
17961847f8eSopenharmony_ci   * @since 9
18061847f8eSopenharmony_ci   */
18161847f8eSopenharmony_ci  function lock(): Promise<boolean>;
18261847f8eSopenharmony_ci
18361847f8eSopenharmony_ci  /**
18461847f8eSopenharmony_ci   * Indicates the system event type related to the screenlock management service.
18561847f8eSopenharmony_ci   *
18661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
18761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
18861847f8eSopenharmony_ci   * @since 9
18961847f8eSopenharmony_ci   */
19061847f8eSopenharmony_ci  /**
19161847f8eSopenharmony_ci   * Indicates the system event type related to the screenlock management service. Adding strongAuthChanged and screenLockDisabledChanged.
19261847f8eSopenharmony_ci   *
19361847f8eSopenharmony_ci   * @typedef {('beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen'
19461847f8eSopenharmony_ci   * | 'lockScreen' | 'beginExitAnimation' | 'beginSleep' | 'endSleep' | 'changeUser' | 'screenlockEnabled' | 'serviceRestart'
19561847f8eSopenharmony_ci   * | 'strongAuthChanged' | 'screenLockDisabledChanged')}
19661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
19761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
19861847f8eSopenharmony_ci   * @since 12
19961847f8eSopenharmony_ci   */
20061847f8eSopenharmony_ci  type EventType =
20161847f8eSopenharmony_ci    'beginWakeUp'
20261847f8eSopenharmony_ci    | 'endWakeUp'
20361847f8eSopenharmony_ci    | 'beginScreenOn'
20461847f8eSopenharmony_ci    | 'endScreenOn'
20561847f8eSopenharmony_ci    | 'beginScreenOff'
20661847f8eSopenharmony_ci    | 'endScreenOff'
20761847f8eSopenharmony_ci    | 'unlockScreen'
20861847f8eSopenharmony_ci    | 'lockScreen'
20961847f8eSopenharmony_ci    | 'beginExitAnimation'
21061847f8eSopenharmony_ci    | 'beginSleep'
21161847f8eSopenharmony_ci    | 'endSleep'
21261847f8eSopenharmony_ci    | 'changeUser'
21361847f8eSopenharmony_ci    | 'screenlockEnabled'
21461847f8eSopenharmony_ci    | 'serviceRestart'
21561847f8eSopenharmony_ci    | 'strongAuthChanged'
21661847f8eSopenharmony_ci    | 'screenLockDisabledChanged';
21761847f8eSopenharmony_ci
21861847f8eSopenharmony_ci  /**
21961847f8eSopenharmony_ci   * Indicates the strong authentication reason flags used to request.
22061847f8eSopenharmony_ci   *
22161847f8eSopenharmony_ci   * @enum { number }
22261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
22361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
22461847f8eSopenharmony_ci   * @since 12
22561847f8eSopenharmony_ci   */
22661847f8eSopenharmony_ci  enum StrongAuthReasonFlags {
22761847f8eSopenharmony_ci    /**
22861847f8eSopenharmony_ci     * Indicates that there are no strong authentication reason flags.
22961847f8eSopenharmony_ci     */
23061847f8eSopenharmony_ci    NONE = 0x00000000,
23161847f8eSopenharmony_ci
23261847f8eSopenharmony_ci    /**
23361847f8eSopenharmony_ci     * Indicates the strong authentication reason requested after boot.
23461847f8eSopenharmony_ci     */
23561847f8eSopenharmony_ci    AFTER_BOOT = 0x00000001,
23661847f8eSopenharmony_ci
23761847f8eSopenharmony_ci    /**
23861847f8eSopenharmony_ci     * Indicates the strong authentication reason requested after timeout.
23961847f8eSopenharmony_ci     */
24061847f8eSopenharmony_ci    AFTER_TIMEOUT = 0x00000002,
24161847f8eSopenharmony_ci 
24261847f8eSopenharmony_ci    /**
24361847f8eSopenharmony_ci     * Indicates the strong authentication reason requested by active request.
24461847f8eSopenharmony_ci     */
24561847f8eSopenharmony_ci    ACTIVE_REQUEST = 0x00000004,
24661847f8eSopenharmony_ci
24761847f8eSopenharmony_ci    /**
24861847f8eSopenharmony_ci     * Indicates the strong authentication reason requested by policy restriction.
24961847f8eSopenharmony_ci     */
25061847f8eSopenharmony_ci    POLICY_RESTRICTION = 0x00000008
25161847f8eSopenharmony_ci  }
25261847f8eSopenharmony_ci
25361847f8eSopenharmony_ci  /**
25461847f8eSopenharmony_ci   * Indicates the screen lock authentication state.
25561847f8eSopenharmony_ci   *
25661847f8eSopenharmony_ci   * @enum { number }
25761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
25861847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
25961847f8eSopenharmony_ci   * @since 12
26061847f8eSopenharmony_ci   */
26161847f8eSopenharmony_ci  enum AuthState {
26261847f8eSopenharmony_ci    /**
26361847f8eSopenharmony_ci     * Indicates the screen lock is not authenticated.
26461847f8eSopenharmony_ci     */
26561847f8eSopenharmony_ci    NOT_AUTHED = 0,
26661847f8eSopenharmony_ci
26761847f8eSopenharmony_ci    /**
26861847f8eSopenharmony_ci     * Indicates the screen lock is pre authenticated by credential.
26961847f8eSopenharmony_ci     */
27061847f8eSopenharmony_ci    PRE_AUTHED_BY_CREDENTIAL = 1,
27161847f8eSopenharmony_ci
27261847f8eSopenharmony_ci    /**
27361847f8eSopenharmony_ci     * Indicates the screen lock is pre authenticated by fingerprint.
27461847f8eSopenharmony_ci     */
27561847f8eSopenharmony_ci    PRE_AUTHED_BY_FINGERPRINT = 2,
27661847f8eSopenharmony_ci
27761847f8eSopenharmony_ci    /**
27861847f8eSopenharmony_ci     * Indicates the screen lock is pre authenticated by face.
27961847f8eSopenharmony_ci     */
28061847f8eSopenharmony_ci    PRE_AUTHED_BY_FACE = 3,
28161847f8eSopenharmony_ci
28261847f8eSopenharmony_ci    /**
28361847f8eSopenharmony_ci     * Indicates the screen lock is authenticated by credential.
28461847f8eSopenharmony_ci     */
28561847f8eSopenharmony_ci    AUTHED_BY_CREDENTIAL = 4,
28661847f8eSopenharmony_ci
28761847f8eSopenharmony_ci    /**
28861847f8eSopenharmony_ci     * Indicates the screen lock is authenticated by fingerprint.
28961847f8eSopenharmony_ci     */
29061847f8eSopenharmony_ci    AUTHED_BY_FINGERPRINT = 5,
29161847f8eSopenharmony_ci
29261847f8eSopenharmony_ci    /**
29361847f8eSopenharmony_ci     * Indicates the screen lock is authenticated by face.
29461847f8eSopenharmony_ci     */
29561847f8eSopenharmony_ci    AUTHED_BY_FACE = 6,
29661847f8eSopenharmony_ci  }
29761847f8eSopenharmony_ci
29861847f8eSopenharmony_ci  /**
29961847f8eSopenharmony_ci   * Indicates the system event type and parameter related to the screenlock management service.
30061847f8eSopenharmony_ci   *
30161847f8eSopenharmony_ci   * @typedef SystemEvent
30261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
30361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
30461847f8eSopenharmony_ci   * @since 9
30561847f8eSopenharmony_ci   */
30661847f8eSopenharmony_ci  interface SystemEvent {
30761847f8eSopenharmony_ci    /**
30861847f8eSopenharmony_ci     * Indicates the system event type related to the screenlock management service.
30961847f8eSopenharmony_ci     *
31061847f8eSopenharmony_ci     * @type { EventType }
31161847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.ScreenLock
31261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
31361847f8eSopenharmony_ci     * @since 9
31461847f8eSopenharmony_ci     */
31561847f8eSopenharmony_ci    eventType: EventType;
31661847f8eSopenharmony_ci    /**
31761847f8eSopenharmony_ci     * Identifies the customized extended parameter of an event.
31861847f8eSopenharmony_ci     *
31961847f8eSopenharmony_ci     * @type { string }
32061847f8eSopenharmony_ci     * @syscap SystemCapability.MiscServices.ScreenLock
32161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use.
32261847f8eSopenharmony_ci     * @since 9
32361847f8eSopenharmony_ci     */
32461847f8eSopenharmony_ci    params: string;
32561847f8eSopenharmony_ci  }
32661847f8eSopenharmony_ci
32761847f8eSopenharmony_ci  /**
32861847f8eSopenharmony_ci   * Register system event related to screen lock service.
32961847f8eSopenharmony_ci   *
33061847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
33161847f8eSopenharmony_ci   * @param { Callback<SystemEvent> } callback - the callback of onSystemEvent.
33261847f8eSopenharmony_ci   * @returns { boolean } returns true if register system event is success, returns false otherwise.
33361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
33461847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
33561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
33661847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
33761847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
33861847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
33961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
34061847f8eSopenharmony_ci   * @since 9
34161847f8eSopenharmony_ci   */
34261847f8eSopenharmony_ci  function onSystemEvent(callback: Callback<SystemEvent>): boolean;
34361847f8eSopenharmony_ci
34461847f8eSopenharmony_ci  /**
34561847f8eSopenharmony_ci   * The screen lock app sends the event to the screen lock service.
34661847f8eSopenharmony_ci   *
34761847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
34861847f8eSopenharmony_ci   * @param { String } event - event type.
34961847f8eSopenharmony_ci   * @param { number } parameter - operation result of the event.
35061847f8eSopenharmony_ci   * @param { AsyncCallback<boolean> } callback - the callback of sendScreenLockEvent.
35161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
35261847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
35361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
35461847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
35561847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
35661847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
35761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
35861847f8eSopenharmony_ci   * @since 9
35961847f8eSopenharmony_ci   */
36061847f8eSopenharmony_ci  function sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback<boolean>): void;
36161847f8eSopenharmony_ci
36261847f8eSopenharmony_ci  /**
36361847f8eSopenharmony_ci   * The screen lock app sends the event to the screen lock service.
36461847f8eSopenharmony_ci   *
36561847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
36661847f8eSopenharmony_ci   * @param { String } event - event type.
36761847f8eSopenharmony_ci   * @param { number } parameter - operation result of the event.
36861847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
36961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
37061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
37161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
37261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
37361847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
37461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
37561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
37661847f8eSopenharmony_ci   * @since 9
37761847f8eSopenharmony_ci   */
37861847f8eSopenharmony_ci  function sendScreenLockEvent(event: String, parameter: number): Promise<boolean>;
37961847f8eSopenharmony_ci
38061847f8eSopenharmony_ci  /**
38161847f8eSopenharmony_ci   * Request strong authentication for os account local userId.
38261847f8eSopenharmony_ci   *
38361847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK
38461847f8eSopenharmony_ci   * @param { StrongAuthReasonFlags } reasonFlag - The strong authentication reason flag.
38561847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
38661847f8eSopenharmony_ci   * @returns { Promise<void> } the promise returned by the function.
38761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
38861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
38961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
39061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API.
39161847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
39261847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
39361847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
39461847f8eSopenharmony_ci   * @since 12
39561847f8eSopenharmony_ci   */
39661847f8eSopenharmony_ci  function requestStrongAuth(reasonFlag: StrongAuthReasonFlags, userId: number): Promise<void>;
39761847f8eSopenharmony_ci
39861847f8eSopenharmony_ci  /**
39961847f8eSopenharmony_ci   * Obtain strong authentication reason flags for os account local userId.
40061847f8eSopenharmony_ci   *
40161847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK
40261847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
40361847f8eSopenharmony_ci   * @returns { number } the strong authentication reason flags.
40461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
40561847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
40661847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
40761847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed. A non-system application calls a system API.
40861847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
40961847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
41061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
41161847f8eSopenharmony_ci   * @since 12
41261847f8eSopenharmony_ci   */
41361847f8eSopenharmony_ci  function getStrongAuth(userId: number): number;
41461847f8eSopenharmony_ci
41561847f8eSopenharmony_ci  /**
41661847f8eSopenharmony_ci   * Disable screen lock showing for os account local userId. This only becomes effective when there is no password.
41761847f8eSopenharmony_ci   *
41861847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK
41961847f8eSopenharmony_ci   * @param { boolean } disable - disable or enable screen lock showing.
42061847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
42161847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
42261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
42361847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
42461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
42561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
42661847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
42761847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
42861847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
42961847f8eSopenharmony_ci   * @since 12
43061847f8eSopenharmony_ci   */
43161847f8eSopenharmony_ci  function setScreenLockDisabled(disable: boolean, userId: number): Promise<boolean>;
43261847f8eSopenharmony_ci
43361847f8eSopenharmony_ci  /**
43461847f8eSopenharmony_ci   * Check whether screen lock is disabled for os account local userId.
43561847f8eSopenharmony_ci   *
43661847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK
43761847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
43861847f8eSopenharmony_ci   * @returns { boolean } whether screen lock is disabled.
43961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
44061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
44161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
44261847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
44361847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
44461847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
44561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
44661847f8eSopenharmony_ci   * @since 12
44761847f8eSopenharmony_ci   */
44861847f8eSopenharmony_ci  function isScreenLockDisabled(userId: number): boolean;
44961847f8eSopenharmony_ci
45061847f8eSopenharmony_ci  /**
45161847f8eSopenharmony_ci   * Set the screen lock authentication state for os account local userId.
45261847f8eSopenharmony_ci   *
45361847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER
45461847f8eSopenharmony_ci   * @param { AuthState } state - the screen lock authentication state.
45561847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
45661847f8eSopenharmony_ci   * @param { Uint8Array } authToken - the authentication token for this state
45761847f8eSopenharmony_ci   * @returns { Promise<boolean> } the promise returned by the function.
45861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
45961847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
46061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
46161847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
46261847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
46361847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
46461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
46561847f8eSopenharmony_ci   * @since 12
46661847f8eSopenharmony_ci   */
46761847f8eSopenharmony_ci  function setScreenLockAuthState(state: AuthState, userId: number, authToken: Uint8Array): Promise<boolean>;
46861847f8eSopenharmony_ci
46961847f8eSopenharmony_ci  /**
47061847f8eSopenharmony_ci   * Obtain the screen lock authentication state for os account local userId.
47161847f8eSopenharmony_ci   *
47261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_SCREEN_LOCK
47361847f8eSopenharmony_ci   * @param { number } userId - Os account local userId.
47461847f8eSopenharmony_ci   * @returns { AuthState } the screen lock authentication state.
47561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
47661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
47761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - permission denied.
47861847f8eSopenharmony_ci   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
47961847f8eSopenharmony_ci   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
48061847f8eSopenharmony_ci   * @syscap SystemCapability.MiscServices.ScreenLock
48161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use.
48261847f8eSopenharmony_ci   * @since 12
48361847f8eSopenharmony_ci   */
48461847f8eSopenharmony_ci  function getScreenLockAuthState(userId: number): AuthState;
48561847f8eSopenharmony_ci}
48661847f8eSopenharmony_ci
48761847f8eSopenharmony_ciexport default screenLock;