mirror of
https://github.com/openharmony/applications_auth_widget.git
synced 2026-07-21 01:05:22 -04:00
hap ut ArkXTest clean
Signed-off-by: liuhanxiong <liuhanxiong@huawei.com> Change-Id: Ia21e1fba63bf57d297539778b410d6034a82a602
This commit is contained in:
@@ -27,25 +27,26 @@ const MASK_THIN_COLOR = '#33182431';
|
||||
|
||||
export default class UserAuthAbility extends UserAuthExtensionAbility {
|
||||
onCreate() {
|
||||
LogUtils.info(TAG, 'onCreate');
|
||||
AppStorage.setOrCreate("context", this.context as common.ExtensionContext);
|
||||
|
||||
}
|
||||
|
||||
onForeground(): void {
|
||||
LogUtils.info(TAG, 'UserAuthExtensionAbility onForeground');
|
||||
LogUtils.info(TAG, 'onForeground');
|
||||
}
|
||||
|
||||
onBackground(): void {
|
||||
LogUtils.info(TAG, 'UserAuthExtensionAbility onBackground');
|
||||
LogUtils.info(TAG, 'onBackground');
|
||||
(AppStorage.get("session") as UIExtensionContentSession)?.terminateSelf();
|
||||
}
|
||||
|
||||
onDestroy(): void | Promise<void> {
|
||||
LogUtils.info(TAG, 'UserAuthExtensionAbility onDestroy');
|
||||
LogUtils.info(TAG, 'onDestroy');
|
||||
}
|
||||
|
||||
onSessionCreate(want, session): void {
|
||||
LogUtils.info(TAG, 'UserAuthExtensionAbility onSessionCreate');
|
||||
LogUtils.info(TAG, 'onSessionCreate');
|
||||
AppStorage.setOrCreate("wantParams", want?.parameters?.useriamCmdData);
|
||||
|
||||
session?.loadContent('pages/Index');
|
||||
@@ -56,14 +57,14 @@ export default class UserAuthAbility extends UserAuthExtensionAbility {
|
||||
session?.setWindowBackgroundColor(TRANSPARENT_COLOR);
|
||||
}
|
||||
} catch (error) {
|
||||
LogUtils.error(TAG, 'UserAuthExtensionAbility onSessionCreate error: ' + error?.code);
|
||||
LogUtils.error(TAG, 'onSessionCreate error: ' + error?.code);
|
||||
session?.terminateSelf();
|
||||
}
|
||||
WindowPrivacyUtils.setWindowPrivacyMode(session, true);
|
||||
}
|
||||
|
||||
onSessionDestroy(session): void {
|
||||
LogUtils.info(TAG, 'UserAuthExtensionAbility onSessionDestroy');
|
||||
LogUtils.info(TAG, 'onSessionDestroy');
|
||||
WindowPrivacyUtils.setWindowPrivacyMode(session, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user