# 主题框架å系统-é”å±ç®¡ç†æœåŠ¡ChangeLog ## cl.screenlock.1 isLockedã€unlock接å£ä½¿ç”¨æƒé™å˜æ›´ 从API9å¼€å§‹ï¼Œå˜æ›´ä¸ºsystemapiï¼Œåœæ¢å¯¹ä¸‰æ–¹åº”用开放。 å¼€å‘è€…éœ€è¦æ ¹æ®ä»¥ä¸‹è¯´æ˜Žå¯¹åº”用进行适é…。 **å˜æ›´å½±å“** 基于æ¤å‰ç‰ˆæœ¬å¼€å‘的应用,需适é…å˜æ›´çš„js接å£ï¼Œå˜æ›´å‰çš„æŽ¥å£å·²ç»ä¸èƒ½æ£å¸¸ä½¿ç”¨äº†ï¼Œå¦åˆ™ä¼šå½±å“原有功能。 - æ¶‰åŠæŽ¥å£ ```js function isLocked(): boolean; function unlock(callback: AsyncCallback<boolean>): void; function unlock():Promise<boolean>; ``` - å˜æ›´å‰ï¼š ```js * Checks whether the screen is currently locked. * * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. * @syscap SystemCapability.MiscServices.ScreenLock * @since 9 */ function isLocked(): boolean; /** * Unlock the screen. * * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. * @throws {BusinessError} 401 - parameter error. * @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 */ function unlock(callback: AsyncCallback<boolean>): void; /** * Unlock the screen. * * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. * @throws {BusinessError} 401 - parameter error. * @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 */ function unlock():Promise<boolean>; ``` - å˜æ›´åŽï¼š ```js * Checks whether the screen is currently locked. * * @returns Returns {@code true} if the screen is currently locked; returns {@code 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 9 */ function isLocked(): boolean; /** * Unlock the screen. * * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @since 9 */ function unlock(callback: AsyncCallback<boolean>): void; /** * Unlock the screen. * * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @since 9 */ function unlock():Promise<boolean>; ``` **适酿Œ‡å¯¼** 该接å£å˜æ›´ä¸ºç³»ç»Ÿåº”用åŽï¼Œä¸‰æ–¹åº”ç”¨å·²æ— æ³•ä½¿ç”¨ã€‚ ç³»ç»Ÿåº”ç”¨å¯æ£å¸¸ä½¿ç”¨ã€‚ 示例代ç 如下: ```js try { let ret = screenLock.isLocked(); console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`); } catch (error) { console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`); } ``` ```js screenlock.unlock((err, data) => { if (err) { console.error(`Failed to unlock the screen, because: ${err.message}`); return; } console.info(`unlock the screen successfully. result: ${data}`); }); ``` ```js screenlock.unlock().then((data) => { console.info(`unlock the screen successfully. result: ${data}`); }).catch((err) => { console.error(`Failed to unlock the screen, because: ${err.message}`); }); ``` ## cl.screenlock.2 isSecure接å£åºŸå¼ƒå˜æ›´ 从API9å¼€å§‹ï¼ŒåºŸå¼ƒæ¤æŽ¥å£ã€‚ å¼€å‘è€…éœ€è¦æ ¹æ®ä»¥ä¸‹è¯´æ˜Žå¯¹åº”用进行适é…。 **å˜æ›´å½±å“** 该接å£åˆ é™¤æ— æ³•å†ä½¿ç”¨ï¼Œè¯·ä½¿ç”¨è¿›è¡Œæ›´æ–°ä½¿ç”¨ï¼Œå¦åˆ™ä¼šå½±å“原有功能。 - æ¶‰åŠæŽ¥å£ ```js function isSecure(): boolean; ``` - å˜æ›´å‰ï¼š ```js function isSecure(): boolean; ``` - å˜æ›´åŽï¼šåˆ 除接å£ï¼Œåœæ¢å¯¹å¤–开放。 **适酿Œ‡å¯¼** 该接å£åˆ é™¤åŽæ— 法å†ä½¿ç”¨ï¼Œè¯·é€‚é…æ›´æ–°ã€‚