1# 主题框架子系统-锁屏管理服务ChangeLog
2
3## cl.screenlock.1  接口异常抛出变更
4
5从API11开始,unlock接口增加错误码返回13200002,此次属于兼容性变更,开发者无需适配。
6
7**访问级别**
8
9系统api
10
11**变更原因**
12
13unlock()接口在当当非焦点应用在服务段调用时会返回201权限异常,此返回有误,现增加错误码非法调用13200002,表示非焦点应用调用unlock()接口。
14
15**变更影响**
16
17此次变更为兼容性变更,仅涉及错误码修改,对开发者而言,无需做相应的适配。
18
19**变更发生版本**
20
21从OpenHarmony SDK 4.1.5.2 开始。
22
23**变更的接口**
24
25相较于之前,当非焦点应用调用unlock()时返回的错误码不同。
26
27- 涉及接口
28
29```js
30  function unlock(callback: AsyncCallback<boolean>): void;
31  function unlock():Promise<boolean>;
32```
33
34- 变更前:
35
36非焦点应用调用unlock()时返回201表示权限校验失败。
37
38```js
39  /**
40   * Unlock the screen.
41   *
42   * @param { AsyncCallback<boolean> } callback - the callback of unlock.
43   * @throws { BusinessError } 401 - parameter error.
44   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
45   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
46   * @syscap SystemCapability.MiscServices.ScreenLock
47   * @systemapi Hide this for inner system use.
48   * @since 9
49   */
50  function unlock(callback: AsyncCallback<boolean>): void;
51
52  /**
53   * Unlock the screen.
54   *
55   * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
56   * @throws {BusinessError} 401 - parameter error.
57   * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
58   * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
59   * @syscap SystemCapability.MiscServices.ScreenLock
60   * @systemapi Hide this for inner system use.
61   * @since 9
62   */
63  function unlock():Promise<boolean>;
64```
65
66- 变更后:
67
68非焦点应用调用unlock()时返回13200003表示非法调用。
69
70```js
71  /**
72   * Unlock the screen.
73   *
74   * @param { AsyncCallback<boolean> } callback - the callback of unlock.
75   * @throws { BusinessError } 401 - parameter error.
76   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
77   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
78   * @syscap SystemCapability.MiscServices.ScreenLock
79   * @systemapi Hide this for inner system use.
80   * @since 9
81   */
82  /**
83   * Unlock the screen.
84   *
85   * @param { AsyncCallback<boolean> } callback - the callback of unlock.
86   * @throws { BusinessError } 401 - parameter error.
87   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
88   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
89   * @throws { BusinessError } 13200003 - illegal use.
90   * @syscap SystemCapability.MiscServices.ScreenLock
91   * @systemapi Hide this for inner system use.
92   * @since 11
93   */
94  function unlock(callback: AsyncCallback<boolean>): void;
95
96  /**
97   * Unlock the screen.
98   *
99   * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
100   * @throws {BusinessError} 401 - parameter error.
101   * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
102   * @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
103   * @syscap SystemCapability.MiscServices.ScreenLock
104   * @systemapi Hide this for inner system use.
105   * @since 9
106   */
107  /**
108   * Unlock the screen.
109   *
110   * @returns { Promise<boolean> } the promise returned by the function.
111   * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API.
112   * @throws { BusinessError } 13200002 - the screenlock management service is abnormal.
113   * @throws { BusinessError } 13200003 - illegal use.
114   * @syscap SystemCapability.MiscServices.ScreenLock
115   * @systemapi Hide this for inner system use.
116   * @since 11
117   */
118  function unlock():Promise<boolean>;
119```
120
121
122**适配指导**
123
124本次修改仅涉及错误码修改,其余行为不变。
125