• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import { AsyncCallback } from './basic';
16import { Callback } from './basic';
17
18/**
19 * systemScreenLock
20 * @devices phone, tablet, tv, wearable, car
21 * @since 7
22 */
23declare namespace screenLock {
24
25  /**
26   * Checks whether the screen is currently locked.
27   *
28   * @return Returns {@code true} if the screen is currently locked; returns {@code false}
29   * otherwise.
30   * @since 7
31   */
32  function isScreenLocked(callback: AsyncCallback<boolean>): void;
33  function isScreenLocked(): Promise<boolean>;
34
35  /**
36   * Checks whether the screen lock of the current device is secure.
37   *
38   * @return Returns {@code true} if the screen lock of the current device is secure; returns {@code false}
39   * otherwise.
40   * @since 7
41   */
42  function isSecureMode(callback: AsyncCallback<boolean>): void;
43  function isSecureMode(): Promise<boolean>;
44
45  /**
46   * Unlocks the screen.
47   *
48   * @since 7
49   */
50  function unlockScreen(callback: AsyncCallback<void>): void;
51  function unlockScreen(): Promise<void>;
52
53  /**
54   * screenlockAPP send event to screenlockSA
55   *
56   * @systemapi Hide this for inner system use.
57   * @since 8
58   */
59  function sendScreenLockEvent(event: string, parameter: number, callback: AsyncCallback<boolean>): void;
60  function sendScreenLockEvent(event: string, parameter: number): Promise<boolean>;
61}
62
63export default screenLock;
64
65
66
67