diff --git a/entry/src/main/ets/common/components/FullScreen.ets b/entry/src/main/ets/common/components/FullScreen.ets index 8bf07c1e14192fdfaa04ecfac7bddcbd603efb0e..0f802ecd88fb83a5302fbd4128e8eecd6ac1a947 100644 --- a/entry/src/main/ets/common/components/FullScreen.ets +++ b/entry/src/main/ets/common/components/FullScreen.ets @@ -76,9 +76,9 @@ export default struct FullScreen { @StorageLink('passwordArrayNumber') passwordArrayNumber: string[] = []; @State passwordObj: string = ''; numKeyboard: NumKeyBoardItem[] = Constants.numKeyBoard; - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); - @State fingerText: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State fingerText: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_inscreen_fp').id); @StorageLink('screenLockDirection') screenLockDirection: number = 1; @StorageLink('SYSTEM_STATUS_BAR_HEIGHT') SYSTEM_STATUS_BAR_HEIGHT: number = 0; @@ -104,18 +104,18 @@ export default struct FullScreen { if (payload.type === Constants.noticeTypePin) { this.clearPassword(); if (payload.remainAttempts) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); - if (num === 'first' && this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (num === 'first' && this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id)) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); } // 3: pin Residual number if (payload.remainAttempts < 3 && num !== 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -130,12 +130,12 @@ export default struct FullScreen { this.pinLock = 1; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else if (payload.type === Constants.noticeTypeFace) { if (payload.remainAttempts < 5 && payload.remainAttempts > 0) { if (this.pinLock !== 1) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceFingerLockArr[0] = false; } @@ -145,20 +145,20 @@ export default struct FullScreen { this.controlType.isShowFace = false; } else { if (this.pinLock !== 1) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); } } } if (payload.remainAttempts === 0) { if (num !== 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_face_forbidden').id); } this.faceFingerLockArr[0] = true; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else if (payload.type === Constants.noticeTypeFinger) { let sensor: FingerPosition = { sensorType: '' }; @@ -168,7 +168,7 @@ export default struct FullScreen { } if (payload.remainAttempts && payload.result !== 0) { if (this.controlType.jumpFinger) { - this.fingerText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.fingerText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); } if (sensor && this.fingerPosition.udSensorCenterYInThousandth !== undefined && @@ -180,14 +180,15 @@ export default struct FullScreen { setTimeout(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFinger]); }, NOTICE_DELAY); - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); } - this.fingerButtonPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]); + this.fingerButtonPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth / + THOUSANDTH * this.screen[1]); FuncUtils.judgmentOverflow(this.fingerButtonPositionY); - this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; this.fingerPositionLine = this.fingerPositionY / px2vp(this.screen[1]); FuncUtils.judgmentOverflow(this.fingerPositionLine); if (num === 'first' && this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && payload.result != 0) { @@ -200,9 +201,9 @@ export default struct FullScreen { if (num === 'first') { this.controlType.isShowFinger = false; } else { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); - this.fingerText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.fingerText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); } this.faceFingerLockArr[1] = true; @@ -210,11 +211,11 @@ export default struct FullScreen { this.cancelImage = false; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } else { LogUtils.error(TAG, 'type: ' + payload.type); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -235,16 +236,16 @@ export default struct FullScreen { FuncUtils.judgmentOverflow(tempPosition); this.fingerButtonPositionY = tempPosition / THOUSANDTH; FuncUtils.judgmentOverflow(this.fingerButtonPositionY); - this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerPositionY = this.fingerButtonPositionY - this.SYSTEM_STATUS_BAR_HEIGHT - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerPositionY); - this.fingerTipsPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_HIGH - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerTipsPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_HIGH - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerTipsPositionY); - this.fingerTextPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_TEXT_POSITION - - this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; + this.fingerTextPositionY = this.fingerButtonPositionY - px2vp(FINGER_Y_POSITION) - FINGER_TEXT_POSITION - + this.SYSTEM_STATUS_BAR_HEIGHT - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - PADDING_8; FuncUtils.judgmentOverflow(this.fingerTextPositionY); } @@ -254,7 +255,7 @@ export default struct FullScreen { } } catch (error) { LogUtils.error(TAG, 'aboutToAppear catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -264,7 +265,7 @@ export default struct FullScreen { this.passwordArray = ['', '', '', '', '', '']; this.passwordObj = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); this.updateStorage(() => { }) @@ -275,16 +276,16 @@ export default struct FullScreen { } countdown(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); - const PLEASE_TRY = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_pleaseretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const PLEASE_TRY = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_pleaseretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); promptText =PLEASE_TRY + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countdown(t), INTERVAL, freezingTime - INTERVAL); } else { - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_use_pwd').id); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_use_pwd').id); this.clearPassword(); // 0: pin unlock this.pinLock = 0; @@ -349,11 +350,11 @@ export default struct FullScreen { .margin({ bottom: $r('app.float.content_padding') }) .onClick(() => { if (!this.faceFingerLockArr[0]) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } else { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_face_forbidden').id); } }) @@ -376,9 +377,9 @@ export default struct FullScreen { .textOverflow({ overflow: TextOverflow.None }) .height($r('app.float.size_24')) .onClick(() => { - if (this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id)) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } @@ -538,10 +539,11 @@ export default struct FullScreen { // 0: pin unlock if (!this.IS_LANDSCAPE && this.pinLock === 0 && this.pinSubType === Constants.pinSix) { - if (this.controlType.isShowFinger && this.fingerPosition.sensorType !== 'OUT_OF_SCREEN_SENSOR' - && this.fingerPosition.sensorType !== 'NON_SENSOR') { - if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && this.fingerPosition.udSensorRadiusInPx !== undefined - && this.fingerPosition.udSensorCenterYInThousandth !== undefined) { + if (this.controlType.isShowFinger && this.fingerPosition.sensorType !== 'OUT_OF_SCREEN_SENSOR' && + this.fingerPosition.sensorType !== 'NON_SENSOR') { + if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && + this.fingerPosition.udSensorRadiusInPx !== undefined && + this.fingerPosition.udSensorCenterYInThousandth !== undefined) { Column() { NumKeyBoard({ onKeyPress: (index , callback) => { @@ -570,7 +572,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -580,9 +582,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -597,10 +599,10 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - - CANCEL_HIGH - MARGIN - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - - px2vp((THOUSANDTH - this.fingerPosition.udSensorCenterYInThousandth) / THOUSANDTH * this.screen[1]) - - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - + CANCEL_HIGH - MARGIN - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - + px2vp((THOUSANDTH - this.fingerPosition.udSensorCenterYInThousandth) / + THOUSANDTH * this.screen[1]) - this.SYSTEM_STATUS_BAR_HEIGHT }) } else { Column() { NumKeyBoard({ @@ -630,7 +632,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -640,9 +642,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -656,8 +658,8 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - CANCEL_HIGH - BOTTOM - - this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_BOTTOM) - CANCEL_HIGH - BOTTOM - + this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) } } else { Column() { @@ -688,7 +690,7 @@ export default struct FullScreen { } else if (index === 1) { this.passwordArray[index - 1] = ''; this.numKeyboard[11].value = GO_BACK; - this.numKeyboard[11].row1 = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.numKeyboard[11].row1 = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_back').id); } else { this.passwordArray[index - 1] = ''; @@ -698,9 +700,9 @@ export default struct FullScreen { // 0: pin unlock this.pinLock = 0; this.clearPassword(); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } else if (keyValue === CALL_PHONE) { if (this.passwordArray.join('').length < PASSWORD_ARRAY_LENGTH) { return; @@ -715,8 +717,8 @@ export default struct FullScreen { } .width(Constants.fullContainerWidth) .height('37%') - .position({ y: px2vp(this.screen[1] * NUM_KEY_POSITION) - CANCEL_HIGH - - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1] * NUM_KEY_POSITION) - CANCEL_HIGH - + this.SYSTEM_STATUS_BAR_HEIGHT }) } } @@ -727,8 +729,9 @@ export default struct FullScreen { if (this.fingerPosition.sensorType === 'UNDER_SCREEN_SENSOR' || this.fingerPosition.sensorType === 'BOTH_SENSOR' || this.fingerPosition.sensorType === 'SensorType1') { - if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && !this.IS_LANDSCAPE && this.fingerPosition.udSensorRadiusInPx !== undefined - && this.fingerPosition.udSensorCenterYInThousandth !== undefined) { + if (this.fingerPositionLine > FINGER_SENSOR_POSITION_LINE && !this.IS_LANDSCAPE && + this.fingerPosition.udSensorRadiusInPx !== undefined && + this.fingerPosition.udSensorCenterYInThousandth !== undefined) { Column() { Image($r('app.media.ic_unlock_fingerprint')) .draggable(false) @@ -741,9 +744,9 @@ export default struct FullScreen { } }) } - .position({ y: px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]) - - px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - - CANCEL_HIGH - this.SYSTEM_STATUS_BAR_HEIGHT }) + .position({ y: px2vp(this.fingerPosition.udSensorCenterYInThousandth / THOUSANDTH * this.screen[1]) - + px2vp(this.fingerPosition.udSensorRadiusInPx * RADIUS) - + CANCEL_HIGH - this.SYSTEM_STATUS_BAR_HEIGHT }) .width(Constants.fullContainerWidth) .height(this.controlType.isShowFinger ? $r('app.float.finger_high'): '9%') .justifyContent(FlexAlign.Start) @@ -770,8 +773,8 @@ export default struct FullScreen { .height(this.controlType.isShowFinger ? $r('app.float.finger_high'): '9%') .justifyContent(FlexAlign.Start) .alignItems(HorizontalAlign.Center) - .position({ y: px2vp(this.screen[1]) - CANCEL_HIGH - BOTTOM - - this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) + .position({ y: px2vp(this.screen[1]) - CANCEL_HIGH - BOTTOM - + this.SYSTEM_STATUS_BAR_HEIGHT - this.SYSTEM_NAVIGATION_BAR_HEIGHT }) } } } @@ -782,10 +785,10 @@ export default struct FullScreen { .width(Constants.fullContainerWidth) } else if (!this.controlType.isLandscape && this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) .fontSize($r('sys.float.ohos_id_text_size_sub_title2')) @@ -809,7 +812,7 @@ export default struct FullScreen { .scrollable(ScrollDirection.Vertical) .scrollBarColor('sys.color.ohos_id_color_foreground') } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .height($r('app.float.text_high')) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) @@ -861,7 +864,7 @@ export default struct FullScreen { this.controlType.jumpFinger = false; this.cancelImage = false; AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFinger]); - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_use_pwd').id); }) } diff --git a/entry/src/main/ets/common/components/NumkeyBoard.ets b/entry/src/main/ets/common/components/NumkeyBoard.ets index 880f7f6f399d0159d66f1b0a167466f921e392ee..b1e8fd80e9d623718faaea94f9bcef0bdb9c0646 100644 --- a/entry/src/main/ets/common/components/NumkeyBoard.ets +++ b/entry/src/main/ets/common/components/NumkeyBoard.ets @@ -108,7 +108,8 @@ export default struct NumKeyBoard { } } .onClick(() => { - setTimeout((index: number, callback: Function):void => this.onKeyPress?.(index, callback), 0, item.index, () => { + setTimeout((index: number, callback: Function):void => + this.onKeyPress?.(index, callback), 0, item.index, () => { }); }) .id('numKeyBordCustomPwd' + item.index) diff --git a/entry/src/main/ets/common/components/PassWord.ets b/entry/src/main/ets/common/components/PassWord.ets index a2f12c504b9c5926a47a51adea0a76b8fa55580c..875a6a39fe76d5cc6813655ddb5c8926c8e028c1 100644 --- a/entry/src/main/ets/common/components/PassWord.ets +++ b/entry/src/main/ets/common/components/PassWord.ets @@ -44,10 +44,10 @@ export default struct PassWord { build() { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -95,7 +95,7 @@ export default struct PassWord { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) diff --git a/entry/src/main/ets/common/components/SixPassword.ets b/entry/src/main/ets/common/components/SixPassword.ets index a13829c40700884de95f5ee3a82164ec0374ddad..b71787964e0baa1b34d4029b8d23ab72acd7ba5b 100644 --- a/entry/src/main/ets/common/components/SixPassword.ets +++ b/entry/src/main/ets/common/components/SixPassword.ets @@ -41,10 +41,10 @@ export default struct SixPassword { build() { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -115,7 +115,7 @@ export default struct SixPassword { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) diff --git a/entry/src/main/ets/extensionability/UserAuthAbility.ts b/entry/src/main/ets/extensionability/UserAuthAbility.ts index e274be4f90eaa9101f6d5cfd0daa2a6edda84a9a..d20ef5123a8dac5cb9fbcbfc6a0330228097a607 100644 --- a/entry/src/main/ets/extensionability/UserAuthAbility.ts +++ b/entry/src/main/ets/extensionability/UserAuthAbility.ts @@ -27,7 +27,7 @@ const MASK_THIN_COLOR = '#33182431'; export default class UserAuthAbility extends UserAuthExtensionAbility { onCreate() { LogUtils.info(TAG, 'UserAuthExtensionAbility onCreate'); - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onForeground(): void { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2af64d7a81ca15242df4139728847763d4383c48..f38c1bc75387f95bb831f83954c01525861f3994 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -52,28 +52,28 @@ struct Index { screen.getAllScreens((err, data) => { if (err.code) { LogUtils.error(TAG, 'Failed to get all screens. err: ' + err.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); return; } LogUtils.debug(TAG, ' get all screens. result:-- ' + JSON.stringify(data)); - this.isLandscape = data[0]?.orientation === LANDSCAPE - || data[0]?.supportedModeInfo[0]?.width > data[0]?.supportedModeInfo[0]?.height; + this.isLandscape = data[0]?.orientation === LANDSCAPE || + data[0]?.supportedModeInfo[0]?.width > data[0]?.supportedModeInfo[0]?.height; AppStorage.SetOrCreate('titleLength', (data[0]?.supportedModeInfo[0]?.width * 0.8 / fp2px(16))) LogUtils.debug(TAG, 'titleLength: ' + (data[0]?.supportedModeInfo[0]?.width * 0.8 / fp2px(16))); - LogUtils.debug(TAG, 'title: ' + (AppStorage.get("wantParams") as WantParams)?.title.length); + LogUtils.debug(TAG, 'title: ' + (AppStorage.get('wantParams') as WantParams)?.title.length); AppStorage.SetOrCreate('IS_LANDSCAPE', this.isLandscape); - LogUtils.debug(TAG, 'WantParams: ' + JSON.stringify(AppStorage.get("wantParams") as WantParams)); - if ((AppStorage.get("wantParams") as WantParams)) { - this.getParams((AppStorage.get("wantParams") as WantParams)); + LogUtils.debug(TAG, 'WantParams: ' + JSON.stringify(AppStorage.get('wantParams') as WantParams)); + if ((AppStorage.get('wantParams') as WantParams)) { + this.getParams((AppStorage.get('wantParams') as WantParams)); this.handleAuthStart(); - this.cmdData = (AppStorage.get("wantParams") as WantParams)?.cmd as CmdType[]; + this.cmdData = (AppStorage.get('wantParams') as WantParams)?.cmd as CmdType[]; } else { LogUtils.error(TAG, 'aboutToAppear wantParams null'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } if (this.isLandscape && this.underFingerPrint) { setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, FIVE_SECOND) } else { this.loadFlag = true; @@ -81,7 +81,7 @@ struct Index { }); } catch (error) { LogUtils.error(TAG, 'getAllScreens catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -102,7 +102,7 @@ struct Index { }); } catch (error) { LogUtils.error(TAG, 'getUserAuthWidgetMgr catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -159,7 +159,7 @@ struct Index { return userAuth.UserAuthType.PIN; } }) - AppStorage.setOrCreate("widgetContextId", resultInfo?.widgetContextId); + AppStorage.setOrCreate('widgetContextId', resultInfo?.widgetContextId); this.authType = newType; this.type = resultInfo?.type; this.windowModeType = resultInfo?.windowModeType; @@ -173,7 +173,7 @@ struct Index { if (this.isLandscape && this.underFingerPrint) { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { Column() { - Text((AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Text((AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_tip_verify_in_portrait_mode').id)) .draggable(false) .fontColor($r('sys.color.ohos_id_color_text_primary_contrary')) diff --git a/entry/src/main/ets/pages/components/CustomPassword.ets b/entry/src/main/ets/pages/components/CustomPassword.ets index 0e85b00703cc862c56e3e8004c2eb9b41122e680..5accf6b72b207bcaee631ac01e6cd823b43900c2 100644 --- a/entry/src/main/ets/pages/components/CustomPassword.ets +++ b/entry/src/main/ets/pages/components/CustomPassword.ets @@ -61,7 +61,7 @@ export default struct CustomPassword { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -93,9 +93,9 @@ export default struct CustomPassword { .backgroundColor(this.isBackTouched ? $r('sys.color.ohos_id_color_hover'): Color.Transparent) .onClick(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); }) .onTouch((event?: TouchEvent) => { if (event == undefined) { diff --git a/entry/src/main/ets/pages/components/FaceAuth.ets b/entry/src/main/ets/pages/components/FaceAuth.ets index 67fe2003e3c00e9561f78892f9434dd72bf9eeda..5cfce390936a9475806e92d8884a47fdde70b518 100644 --- a/entry/src/main/ets/pages/components/FaceAuth.ets +++ b/entry/src/main/ets/pages/components/FaceAuth.ets @@ -47,7 +47,7 @@ let pinData = ''; @Component export default struct FaceAuth { - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); @State @Watch('onTextValueChange') textValue: string = ''; @Link @Watch('onCmdDataChange') cmdData: Array; @@ -73,12 +73,12 @@ export default struct FaceAuth { @StorageLink('SYSTEM_NAVIGATION_BAR_HEIGHT') SYSTEM_NAVIGATION_BAR_HEIGHT: number = 0; countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -102,17 +102,17 @@ export default struct FaceAuth { let tempFingerPositionY = px2vp(this.screen[1]) * this.fingerPosition.udSensorCenterYInThousandth; FuncUtils.judgmentOverflow(tempFingerPositionY); if (tempPosition < FINGER_SENSOR_POSITION_LINE) { - this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) - + this.SYSTEM_NAVIGATION_BAR_HEIGHT - MARGIN_TOP - px2vp(this.fingerPosition.udSensorRadiusInPx); + this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) + + this.SYSTEM_NAVIGATION_BAR_HEIGHT - MARGIN_TOP - px2vp(this.fingerPosition.udSensorRadiusInPx); } else { - this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) - + this.SYSTEM_NAVIGATION_BAR_HEIGHT - PADDING_24 - px2vp(this.fingerPosition.udSensorRadiusInPx); + this.fingerPositionY = (tempFingerPositionY / THOUSANDTH) - px2vp(this.screen[1]) + + this.SYSTEM_NAVIGATION_BAR_HEIGHT - PADDING_24 - px2vp(this.fingerPosition.udSensorRadiusInPx); } FuncUtils.judgmentOverflow(this.fingerPositionY); } LogUtils.info(TAG, 'aboutToAppear this.fingerPositionY: ' + this.fingerPositionY); if (this.dialogType === DialogType.PIN_FACE || this.dialogType === DialogType.FACE) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } else if (this.dialogType === DialogType.ALL) { @@ -120,7 +120,7 @@ export default struct FaceAuth { .sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFinger, Constants.noticeTypeFace]); } else { LogUtils.error(TAG, 'aboutToAppear not support type'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } pinAuthManager = new account_osAccount.PINAuth(); pinAuthManager.registerInputer({ @@ -132,7 +132,7 @@ export default struct FaceAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -144,7 +144,8 @@ export default struct FaceAuth { if ([DialogType.PIN_FACE, DialogType.ALL].includes(this.dialogType)) { LogUtils.debug(TAG, 'toPin this.dialogType: ' + this.dialogType); if (this.dialogType === DialogType.ALL) { - AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFace, Constants.noticeTypeFinger]); + AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, + [Constants.noticeTypeFace, Constants.noticeTypeFinger]); } else if (this.dialogType === DialogType.PIN_FACE) { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypeFace]); } else { @@ -160,7 +161,7 @@ export default struct FaceAuth { sendFaceEvent(): void { if (!this.faceLock) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); AuthUtils.getInstance().sendNotice('EVENT_AUTH_TYPE_READY', [Constants.noticeTypeFace]); } @@ -196,24 +197,24 @@ export default struct FaceAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } else if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } else { if (payload.remainAttempts) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; if (num === 'first') { this.inputValue = ''; } if (payload.remainAttempts < HINT_TIMES_BY_FAIL_LESS) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -229,22 +230,22 @@ export default struct FaceAuth { return; } if (payload.result && payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceLock = false; return; } if (payload.remainAttempts && payload.result !== 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id); this.faceLock = false; } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognition').id); } if (payload.remainAttempts === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_face_forbidden').id); this.faceLock = true; if (this.dialogType === DialogType.ALL) { @@ -256,10 +257,10 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else if (payload.type === Constants.noticeTypeFinger) { @@ -293,7 +294,7 @@ export default struct FaceAuth { } } if ((payload.remainAttempts && payload.result !== 0) || payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); this.fingerLock = false; if (num !== 'first' && payload.remainAttempts > 0 && payload.result !== 0) { @@ -303,11 +304,11 @@ export default struct FaceAuth { } } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_normal_fp_only').id); } if (payload.remainAttempts === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); this.fingerLock = true; if (this.dialogType === DialogType.ALL) { @@ -319,15 +320,15 @@ export default struct FaceAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -337,9 +338,9 @@ export default struct FaceAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } build() { @@ -481,7 +482,7 @@ export default struct FaceAuth { }) } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { Image($r('app.media.error_faceID')) @@ -494,7 +495,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -505,7 +506,7 @@ export default struct FaceAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -524,7 +525,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -536,7 +537,7 @@ export default struct FaceAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } Image($r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -561,10 +562,10 @@ export default struct FaceAuth { right: ($r('sys.float.ohos_id_dialog_margin_end')), bottom: ($r('sys.float.ohos_id_dialog_margin_bottom')) }) - } else if (this.dialogTypeFlag === PIN_FACE_FINGER && this.screenType === SCREEN_LAND - && this.fingerPosition.udSensorRadiusInPx !== undefined) { + } else if (this.dialogTypeFlag === PIN_FACE_FINGER && this.screenType === SCREEN_LAND && + this.fingerPosition.udSensorRadiusInPx !== undefined) { Column() { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { // Facial fingerprint password, second form @@ -578,7 +579,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -602,7 +603,7 @@ export default struct FaceAuth { .onClick(() => { this.sendFaceEvent(); }) - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -625,9 +626,9 @@ export default struct FaceAuth { .margin({ top: $r('app.float.content_padding') }) .fontSize($r('sys.float.ohos_id_text_size_body2')) .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { - if (this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + if (this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager ?.getStringSync($r('app.string.unified_authwidget_hint_face_verify_fail_click_retry_s1').id)) { this.sendFaceEvent(); } @@ -689,15 +690,15 @@ export default struct FaceAuth { Column() { if (this.dialogTypeFlag === PIN_FACE) { // Pin FACE - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -713,7 +714,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -726,14 +727,14 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -749,7 +750,7 @@ export default struct FaceAuth { }) Text(this.prompt).fontSize($r('sys.float.ohos_id_text_size_body2')) .draggable(false) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .height($r('app.float.size_24')) .onClick(() => { this.sendFaceEvent(); @@ -872,16 +873,16 @@ export default struct FaceAuth { } if (this.dialogTypeFlag === SINGLE_FACE) { // Single FACE - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontWeight(FontWeight.Medium) .id('titleFaceAuth') - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -901,7 +902,7 @@ export default struct FaceAuth { .fontSize($r('sys.float.ohos_id_text_size_body2')) .id('textFaceAuth') .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) @@ -913,7 +914,7 @@ export default struct FaceAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -921,7 +922,7 @@ export default struct FaceAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) .id('titleFaceAuth') - Image(this.prompt !== (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt !== (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_recognize_success').id) ? $r('app.media.error_faceID') : $r('app.media.right_faceID')) .draggable(false) @@ -941,12 +942,12 @@ export default struct FaceAuth { .fontSize($r('sys.float.ohos_id_text_size_body2')) .id('textFaceAuth') .height($r('app.float.size_24')) - .fontColor(this.onFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .onClick(() => { this.sendFaceEvent(); }) } - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -987,10 +988,10 @@ export default struct FaceAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance().sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFace]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) diff --git a/entry/src/main/ets/pages/components/FingerprintAuth.ets b/entry/src/main/ets/pages/components/FingerprintAuth.ets index fa5327e710b88e39c8cf0a78fa08f7d516f02629..ee4fb2f6778d46e837ef574f0b4c3ae4a2d95488 100644 --- a/entry/src/main/ets/pages/components/FingerprintAuth.ets +++ b/entry/src/main/ets/pages/components/FingerprintAuth.ets @@ -53,7 +53,7 @@ export default struct FingerprintAuth { @Link type: string; @Link pinSubType: string; @Link dialogType: DialogType; - @State prompt: string = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + @State prompt: string = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_inscreen_fp').id); @State @Watch('onTextValueChange') textValue: string = ''; @Link @Watch('onCmdDataChange') cmdData: Array; @@ -78,12 +78,13 @@ export default struct FingerprintAuth { if (this.cmdData && this.cmdData.length > 0) { this.onCmdDataChange('first'); } - if (this.fingerPosition.udSensorCenterYInThousandth !== undefined && (this.screenType === ON_SCREEN || this.screenType === UNDER_SCREEN)) { + if (this.fingerPosition.udSensorCenterYInThousandth !== undefined && (this.screenType === ON_SCREEN || + this.screenType === UNDER_SCREEN)) { let tempPositionY = px2vp(this.fingerPosition.udSensorCenterYInThousandth * this.screen[1]); FuncUtils.judgmentOverflow(tempPositionY); if (this.screenType === ON_SCREEN) { - this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + BOTTOM_BUTTON - + PADDING_8 + BOTTOM_TEXT + PADDING_24; + this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + BOTTOM_BUTTON + + PADDING_8 + BOTTOM_TEXT + PADDING_24; } else if (this.screenType === UNDER_SCREEN) { this.fingerPositionY = px2vp(this.screen[1]) - tempPositionY / THOUSANDTH + PADDING_24; } @@ -100,7 +101,7 @@ export default struct FingerprintAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -118,24 +119,24 @@ export default struct FingerprintAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } else if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } else { if (payload.remainAttempts) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; if (num === 'first') { this.inputValue = ''; } if (payload.remainAttempts < PIN_FAIL_TIP) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + - payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } } @@ -171,7 +172,7 @@ export default struct FingerprintAuth { } } if ((payload.remainAttempts && payload.result !== 0) || payload.result === Constants.authResultPinExpired) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_retry_s2').id); this.fingerLock = false; if (payload.remainAttempts > AUTH_LOCK && num !== 'first' && payload.result != 0) { @@ -181,13 +182,13 @@ export default struct FingerprintAuth { } } if (num === 'first') { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync(this.isOffFinger ? $r('app.string.unified_authwidget_hint_normal_fp_only').id : $r('app.string.unified_authwidget_hint_inscreen_fp').id); } if (payload.remainAttempts === AUTH_LOCK) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_title_number_failed_fp_forbidden').id); this.fingerLock = true; if (this.dialogType === DialogType.PIN_FINGER) { @@ -200,15 +201,15 @@ export default struct FingerprintAuth { } } if (payload.result === 0) { - this.prompt = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.prompt = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) setTimeout(() => { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }, SECOND); } } else { LogUtils.error(TAG, 'onCmdDataChange default'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } }) } @@ -220,14 +221,14 @@ export default struct FingerprintAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; // O: freezing FINISH if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -268,9 +269,9 @@ export default struct FingerprintAuth { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [Constants.noticeTypePin]); } else { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); } - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } toPin(): void { @@ -299,10 +300,10 @@ export default struct FingerprintAuth { if (this.isOffFinger) { Column() { if ([PIN_FINGER, SINGLE_FINGER].includes(this.state) && this.fingerPosition !== undefined) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -315,7 +316,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } @@ -325,7 +326,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -340,7 +341,7 @@ export default struct FingerprintAuth { .id('outFingerImage') Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) } } @@ -387,7 +388,7 @@ export default struct FingerprintAuth { .height($r('app.float.btn_height')) .margin({ top: $r('app.float.element_margin'), bottom: $r('app.float.content_padding') }) } else if (this.state === SINGLE_FINGER) { - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -429,11 +430,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .margin({ right: $r('app.float.content_padding') }) .width(Constants.ninetyPercentWidth) @@ -619,9 +620,9 @@ export default struct FingerprintAuth { } else if (this.state === PIN_FINGER && this.fingerPosition.udSensorRadiusInPx !== undefined ) { Column() { if (this.screenType === ON_SCREEN) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -634,7 +635,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -642,7 +643,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -659,7 +660,7 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) Row() { Column() { @@ -733,10 +734,10 @@ export default struct FingerprintAuth { }) } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -746,7 +747,7 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -754,7 +755,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -765,9 +766,9 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -794,9 +795,9 @@ export default struct FingerprintAuth { } else if (this.state === SINGLE_FINGER) { Column() { if (this.screenType === ON_SCREEN && this.fingerPosition.udSensorRadiusInPx !== undefined) { - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -809,7 +810,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .margin({ top: $r('app.float.title_padding_top') }) .fontSize($r('sys.float.ohos_id_text_size_body1')) @@ -817,7 +818,7 @@ export default struct FingerprintAuth { .height($r('app.float.size_24')) .fontWeight(FontWeight.Medium) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) @@ -834,9 +835,9 @@ export default struct FingerprintAuth { }) Text(this.prompt) .draggable(false) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) .fontSize($r('sys.float.ohos_id_text_size_body2')) - if (!((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) { + if (!((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) { Row() { Column() { Button($r('app.string.unified_authwidget_cancel'), { stateEffect: true }) @@ -878,11 +879,11 @@ export default struct FingerprintAuth { .color($r('sys.color.ohos_id_color_list_separator')) .width($r('app.float.divider_width')) Column() { - Button(((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string)) + Button(((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string)) .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) .id('navigationButtonTextFingerprintAuth') .margin({ right: $r('app.float.content_padding') }) @@ -912,8 +913,8 @@ export default struct FingerprintAuth { this.handleCancel(); this.textValue = ''; }) - if ((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) { - Button((AppStorage.get("wantParams") as WantParams)?.navigationButtonText as string) + if ((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) { + Button((AppStorage.get('wantParams') as WantParams)?.navigationButtonText as string) .id('fingerUnderButton') .backgroundColor(Color.White) .height($r('app.float.digital_password_mask_height')) @@ -928,15 +929,15 @@ export default struct FingerprintAuth { .onClick(() => { AuthUtils.getInstance() .sendNotice('EVENT_AUTH_USER_NAVIGATION', [Constants.noticeTypeFinger]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); }) } } - if (AppStorage.Get('titleLength') as number < (AppStorage.get("wantParams") as WantParams)?.title.length) { + if (AppStorage.Get('titleLength') as number < (AppStorage.get('wantParams') as WantParams)?.title.length) { Scroll() { Column() { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -946,7 +947,7 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) }.margin({left: $r('app.float.size_24'), right: $r('app.float.size_24')}) } .width('100%') @@ -954,7 +955,7 @@ export default struct FingerprintAuth { .scrollable(ScrollDirection.Vertical) .scrollBarColor(Color.Gray) } else { - Text((AppStorage.get("wantParams") as WantParams)?.title) + Text((AppStorage.get('wantParams') as WantParams)?.title) .draggable(false) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.ohos_id_color_text_primary')) @@ -965,9 +966,9 @@ export default struct FingerprintAuth { .margin({ top: $r('app.float.element_margin') }) .height($r('app.float.size_24')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get("context") as common.ExtensionContext))) + .fontColor(this.onFingerPrintFontColor(this.prompt, (AppStorage.get('context') as common.ExtensionContext))) } - Image(this.prompt === (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + Image(this.prompt === (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_fp_verify_success').id) ? $r('app.media.right_faceID') : $r('app.media.ic_blue_fingerprint')) .draggable(false) diff --git a/entry/src/main/ets/pages/components/PasswordAuth.ets b/entry/src/main/ets/pages/components/PasswordAuth.ets index 63eb6441600904b7d0b5f8b6dcc46354060e2532..7caa8a14fbd1efff6f66ed680ab318248e39c995 100644 --- a/entry/src/main/ets/pages/components/PasswordAuth.ets +++ b/entry/src/main/ets/pages/components/PasswordAuth.ets @@ -54,21 +54,21 @@ export default struct PasswordAuth { const payload: CmdData = item.payload; if (payload.type === Constants.noticeTypePin) { if (payload.result && payload.result === Constants.authResultPinExpired) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; return; } if (payload.remainAttempts && payload.remainAttempts < MAX_FAIL_TIMES) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_hint_pwd_error').id); this.textValue = ''; // pin auth Remaining number if (payload.remainAttempts < HINT_TIMES_BY_FAIL_LESS) { - this.inputValue = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager - .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) - + payload.remainAttempts + (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + this.inputValue = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager + .getStringSync($r('app.string.unified_authwidget_pwd_error_can_try').id) + + payload.remainAttempts + (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_frequency').id); } if (num === 'first') { @@ -84,7 +84,7 @@ export default struct PasswordAuth { return; } if (payload.result === 0) { - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } this.inputValue = ' '; this.textValue = ''; @@ -109,7 +109,7 @@ export default struct PasswordAuth { }); } catch (error) { LogUtils.error(TAG, 'aboutToAppear PINAuth catch error: ' + error?.code); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } } @@ -119,12 +119,12 @@ export default struct PasswordAuth { } countTime(freezingTime: number): void { - const TRY_AGAIN = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); + const TRY_AGAIN = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager.getStringSync($r('app.string.unified_authwidget_postretry').id); let promptText: string = ''; let freezingMillisecond = freezingTime; if (freezingMillisecond > 0) { - promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get("context") as common.ExtensionContext)); - promptText = (AppStorage.get("context") as common.ExtensionContext)?.resourceManager + promptText = TimeUtils.getFreezingTimeNm(freezingMillisecond, (AppStorage.get('context') as common.ExtensionContext)); + promptText = (AppStorage.get('context') as common.ExtensionContext)?.resourceManager .getStringSync($r('app.string.unified_authwidget_many_failures').id) + promptText + TRY_AGAIN; setTimeout((t: number):void => this.countTime(t), INTERVAL, freezingTime - INTERVAL); } else { @@ -136,8 +136,8 @@ export default struct PasswordAuth { handleCancel(): void { AuthUtils.getInstance().sendNotice(Constants.noticeEventCancel, [] || - (AppStorage.get("wantParams") as WantParams)?.type as string[]); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('wantParams') as WantParams)?.type as string[]); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } build() { diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets index cbbbb66a9634dd7becd20f7e3daea896902e4e66..f116ca0ac7997337ae28f07dc95fb3e667077f5c 100644 --- a/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomMixFailAbility.ets @@ -22,12 +22,12 @@ import common from '@ohos.app.ability.common'; export default class CustomMixFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets index 5223147e6c6498fb218e34670e04e4c9cc16202e..7ad8271cb89e3fe6be66c9a3ee501edefed79668 100644 --- a/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomMixFailTimesAbility.ets @@ -21,12 +21,12 @@ import UserAuthExtensionAbility from '@ohos.app.ability.UserAuthExtensionAbility export default class CustomMixFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets index 26da7bf2fe2e8df923f0f60a252b1b87a72a75bc..8576a510964d38200ed6fd8effff2371640227a6 100644 --- a/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomPwdAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class CustomPwdAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets b/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets index c89758cac0df371dcbdaf03a8181ca6f8a551749..f74b9f6f0ab5400789c0102e2447158eec18ccd3 100644 --- a/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets +++ b/entry/src/ohosTest/ets/testability/CustomPwdNumberAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class CustomPwdNumberAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceAbility.ets b/entry/src/ohosTest/ets/testability/FaceAbility.ets index 173deead798be2f67df6cb3978af8f8b380d81c8..39cd01cb495a679ceb64f0fd63494e456b33860c 100644 --- a/entry/src/ohosTest/ets/testability/FaceAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets index e9088828b468eb1849379f7543852d60467e7aa8..1e3fff43467fbedcf9e0bacfab39b144df848b69 100644 --- a/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets b/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets index a0cfd53decc4ea45f97ccf8b73bd779695188567..be64bea48d47fe293b566827f6e9ed009f7d9246 100644 --- a/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceFingerFailNonAbility.ets @@ -20,12 +20,12 @@ import common from '@ohos.app.ability.common'; export default class FaceFingerFailNonAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixAbility.ets index 0f4bc3ad54d73b50ab7cff1f47c24b35895718c0..5a2a1d2d04121ae0bd6f2ddc5ac1bebbb635be25 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets index 73691a641ce5de7b628e1404415ac0b85f1fd96a..72a1d3e5295313b98f061235e5239ba363af517d 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccess3Ability.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccess3Ability extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("session", session); - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets index 8c7246b52527ec7adf0c409c17e4ac730c606127..fa1409aa12f9aee2e67a5136a403775435b7efc3 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets index 5a2a0371090ff38a825b660e624ab4470cbefd33..9a4e3996f02ef1709b4e90da7b9565a2a3ff9ca3 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessAllAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessAllAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets index 2491459153cd2c82787b2699508be473bdd71188..8a26a7c2bdb461839ef1f61ca9f5e021b48abfe8 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixSuccessLandscapeAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixSuccessLandscapeAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets b/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets index 04764503f03a35b80846528db4fa00be23f81310..01d24b01c60b88aff2900ccbf52b44cb8d032b2c 100644 --- a/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceMixTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceMixTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets index 025f5b3ad3f805d4f3b392c92cd89da03eb45563..2be2f858430bb07a3dcb6e6c7a012ec54c6a74a1 100644 --- a/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FacePinFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FacePinFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets b/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets index 5f61cc74ecd69cb17a6eb17d56a838b77a4fefb3..5f597c770727c4763159bfaf68ca60d8f18b9211 100644 --- a/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets +++ b/entry/src/ohosTest/ets/testability/FaceSingleAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FaceSingleAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailAbility.ets index 61ce5bb5498154c5c0921ccf400598ef7406d9cf..852172843a3deac13d344f4dbb9ca99e4a6d51bb 100644 --- a/entry/src/ohosTest/ets/testability/FingerFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets index 17ed831fa4234cb49613c936da596951b31f927b..bf6e9ebb1933631c667ad47dad0e8979b3c82572 100644 --- a/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnAbility.ets index 0e6f498dec249ce38eaaee0064017d74e9048422..26963d35ee99bd6d5677eca6ca10d5b89d8365d1 100644 --- a/entry/src/ohosTest/ets/testability/FingerOnAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOnAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOnAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets index 0a96e31196ccf78efd751ef2ecd0c3f15e2cc815..a102a8e1b50f750626fabf8fa8fa69588c5e2fb7 100644 --- a/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOnNullAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOnNullAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets index e33287fdeedb3c07b1785adea669705e6162bd98..2155be16c65a106650dac096b0028c3027cda2e7 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutBackAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutBackAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets index 8edc35ad637d925a2d9703f622e29915888e276b..237a422e3661864859688c4794f55c29705c2fd8 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutFrontAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutFrontAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets index 72a0330712882a655dbc9f1cce15ee488e090fd2..e30fa74857df5cdaee0679d1d3cf3db8f8d07f02 100644 --- a/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerOutSideAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerOutSideAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets index 0a892c977382234f0e1ff56db8db4f1021b675cd..7a37c44cf0278ffea922eb5c6587dc55ee9b3e42 100644 --- a/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerUnderAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerUnderAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets b/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets index 4c7f62b34010135d72b8fc0801909179858f6db5..5a119eda8a3020fd15191034f96d7ddb29babf4a 100644 --- a/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerUnderNullAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerUnderNullAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintAbility.ets index b68a134c0dd9d88c610ca7eb18bde00954d86700..b879783ca51398de0b7d87153dd9f3ce1632a3e9 100644 --- a/entry/src/ohosTest/ets/testability/FingerprintAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerprintAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerprintAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets b/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets index c2b36109e08320a6cec604209614caf0b73a8f1d..3a736e2c2f6eb4dc311532cb8f3b452c924aba52 100644 --- a/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets +++ b/entry/src/ohosTest/ets/testability/FingerprintLockAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class FingerprintLockAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordAbility.ets b/entry/src/ohosTest/ets/testability/PasswordAbility.ets index 77f681f4f89740161b40a2a9b1a1af9eb39f463a..acdaf93be13256b4e485eeb8167fe4f9b4236dde 100644 --- a/entry/src/ohosTest/ets/testability/PasswordAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets b/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets index bc6056c7bf0ee117892f238d5c852af01c0f5095..16a125691b56fc5799f2728c826c4d54e8f67db3 100644 --- a/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordFailTimesAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordFailTimesAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets b/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets index 8b06a5894a42fe82e9c7d97131f3304ec6b66869..dbb029b5fdefda92df00387c904d0fcc76b00d28 100644 --- a/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets +++ b/entry/src/ohosTest/ets/testability/PasswordSixAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PasswordSixAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets index 9ef58401f76744cf3a5e89ba40ed83fcb34d29b6..dfaf7b585bcea1029330339c4bf10b8c737be87d 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOnAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOnAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets index 83b0adc3c0b41cc8031baf5cca87832786f0b63e..6deddc0a7fcfc6f8fdb8c050aa636807ba0085c2 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOnFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOnFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets index 0b0705134280d930ebe1a385150cf9239751b36f..917ec167245718994fae2a11a308e0a5130e2ce6 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutBackAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutBackAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets index ba2626094ffe9813db971ce901c025c6715e1338..1f0fe2d326742ea525db245935a5b424a2244ff5 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutFrontAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutFrontAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets index 54d739730c9a1d9b2e6c7efbf75011cf0e23e420..66509b72393e4cf685c80dc595b35a1c247c89cb 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerOutSideAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerOutSideAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets index ab1dcb2731ade4d7e80948bad5ade308587a4bad..942a0ad5c7b1846f6602547a347a74d4f937e12e 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerUnderAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerUnderAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets b/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets index eb420cf370210f6cde6a13ab76efe26c7247f742..81ec056714331f4264ca35e48669c77d95e56541 100644 --- a/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets +++ b/entry/src/ohosTest/ets/testability/PinFingerUnderFailAbility.ets @@ -21,12 +21,12 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi export default class PinFingerUnderFailAbility extends UserAuthExtensionAbility { onCreate() { - AppStorage.setOrCreate("context", this.context as Context); + AppStorage.setOrCreate('context', this.context as Context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/TestAbility.ets b/entry/src/ohosTest/ets/testability/TestAbility.ets index f32e6dfa57d585df457edd37e2e63de24fb48048..9febd3f51b5a1506d59532b52fd420b0c80d3c40 100644 --- a/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -30,12 +30,12 @@ export default class TestAbility extends UserAuthExtensionAbility { let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - AppStorage.setOrCreate("context", this.context); + AppStorage.setOrCreate('context', this.context); } onSessionCreate(want, session): void { - AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData); - AppStorage.setOrCreate("session", session); + AppStorage.setOrCreate('wantParams', want?.parameters?.useriamCmdData); + AppStorage.setOrCreate('session', session); } onWindowStageCreate(windowStage: window.WindowStage) { diff --git a/entry/src/ohosTest/ets/testability/pages/Index.ets b/entry/src/ohosTest/ets/testability/pages/Index.ets index dfd6163406e0db1b446b7dc14c45b3856a94a388..026007a303703cc722e9b031452ab94a881cb8ed 100644 --- a/entry/src/ohosTest/ets/testability/pages/Index.ets +++ b/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -46,7 +46,7 @@ struct Index { onCancel(): void { LogUtils.debug(TAG, 'Callback when the first button is clicked'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } onAccept(): void { @@ -55,7 +55,7 @@ struct Index { existApp(): void { LogUtils.debug(TAG, 'Click the callback in the blank area'); - (AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf(); + (AppStorage.get('session') as UIExtensionContentSession)?.terminateSelf(); } handleAuthStart(): void { @@ -82,9 +82,9 @@ struct Index { aboutToAppear(): void { LogUtils.debug(TAG, 'aboutToAppear test'); - if (AppStorage.get("wantParams") as WantParams) { - LogUtils.debug(TAG, 'wantParams: ' + JSON.stringify(AppStorage.get("wantParams") as WantParams)); - this.getParams(AppStorage.get("wantParams") as WantParams); + if (AppStorage.get('wantParams') as WantParams) { + LogUtils.debug(TAG, 'wantParams: ' + JSON.stringify(AppStorage.get('wantParams') as WantParams)); + this.getParams(AppStorage.get('wantParams') as WantParams); } else { LogUtils.error(TAG, 'aboutToAppear wantParams null'); } @@ -129,7 +129,7 @@ struct Index { return userAuth.UserAuthType.PIN; } }) - AppStorage.setOrCreate("widgetContextId", resultInfo.widgetContextId as number); + AppStorage.setOrCreate('widgetContextId', resultInfo.widgetContextId as number); this.authType = newType; this.type = resultInfo.type; this.windowModeType = resultInfo.windowModeType;