mirror of
https://gitee.com/openharmony/security_privacy_center
synced 2024-11-22 23:29:58 +00:00
commit
593ae3fbf8
@ -40,11 +40,8 @@ export default class CertPickerUiExtAbility extends UIExtensionAbility {
|
||||
}
|
||||
let storage: LocalStorage = new LocalStorage(param);
|
||||
session.loadContent('pages/picker/CertManagerSheetFa', storage);
|
||||
GlobalContext.getContext().setAbilityWant(want);
|
||||
GlobalContext.getContext().setSession(session);
|
||||
let pwdStore = new PwdStore();
|
||||
GlobalContext.getContext().setPwdStore(pwdStore);
|
||||
GlobalContext.getContext().setFlag(true);
|
||||
try {
|
||||
session.setWindowBackgroundColor('#00000000');
|
||||
} catch (err) {
|
||||
|
@ -31,9 +31,8 @@ export default class PreventScreenshotsModel {
|
||||
return PreventScreenshotsModel.sInstance;
|
||||
}
|
||||
|
||||
PreventScreenshots(flag: boolean) {
|
||||
PreventScreenshots(flag: boolean, session: UIExtensionContentSession | undefined) {
|
||||
let isPrivacyMode: boolean = flag;
|
||||
let session: UIExtensionContentSession = GlobalContext.getContext().getSession();
|
||||
if (session !== undefined) {
|
||||
session.setWindowPrivacyMode(isPrivacyMode);
|
||||
return;
|
||||
|
@ -35,7 +35,7 @@ struct CertPwdInput {
|
||||
@State mPreventScreenshotsPresenter: PreventScreenshotsPresenter = PreventScreenshotsPresenter.getInstance();
|
||||
|
||||
onPageShow() {
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(true);
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(true, GlobalContext.getContext().getSession());
|
||||
let uri = GlobalContext.getContext().getAbilityWant().uri;
|
||||
GlobalContext.getContext().clearAbilityWantUri();
|
||||
|
||||
@ -51,7 +51,7 @@ struct CertPwdInput {
|
||||
}
|
||||
|
||||
onPageHide() {
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(false);
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(false, GlobalContext.getContext().getSession());
|
||||
}
|
||||
|
||||
build() {
|
||||
|
@ -82,7 +82,9 @@ export struct CertManagerSheetFa {
|
||||
} else if (name === NavEntryKey.AUTHORIZED_APP_ENTRY) {
|
||||
AuthorizedAppManagementPage()
|
||||
} else if (name === NavEntryKey.CRED_PWD_INPUT_ENTRY) {
|
||||
CredPwdInputPage()
|
||||
CredPwdInputPage({
|
||||
sheetSession: this.session
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +96,7 @@ export struct CertManagerSheetFa {
|
||||
.bindSheet(true, this.buildContent(), {
|
||||
height: SheetSize.FIT_CONTENT,
|
||||
preferType: ['2in1', 'tablet'].includes(deviceInfo.deviceType) ? SheetType.CENTER : null,
|
||||
showClose: this.stack.size() === 0,
|
||||
showClose: true,
|
||||
shouldDismiss: ((sheetDismiss: SheetDismiss) => {
|
||||
sheetDismiss.dismiss();
|
||||
this.session?.sendData({'action': 'exit'})
|
||||
|
@ -21,6 +21,9 @@ import { RouterFileVo } from '../../model/CertManagerVo/RouterInfoVo';
|
||||
import { GlobalContext } from '../../common/GlobalContext';
|
||||
import CmInstallPresenter from '../../presenter/CmInstallPresenter';
|
||||
|
||||
import PreventScreenshotsPresenter from '../../model/PreventScreenshotsModel';
|
||||
import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession';
|
||||
|
||||
const TAG: string = 'CredPwdInputPage: ';
|
||||
|
||||
export class CredPwdInputParam {
|
||||
@ -43,6 +46,18 @@ export struct CredPwdInputPage {
|
||||
@State isPasswordError: boolean = false;
|
||||
@State passWordWarn: number = 0;
|
||||
|
||||
@State mPreventScreenshotsPresenter: PreventScreenshotsPresenter = PreventScreenshotsPresenter.getInstance();
|
||||
|
||||
private sheetSession?: UIExtensionContentSession;
|
||||
|
||||
onPageShow(): void {
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(true, this.sheetSession);
|
||||
}
|
||||
|
||||
onPageHide(): void {
|
||||
this.mPreventScreenshotsPresenter.PreventScreenshots(false, this.sheetSession);
|
||||
}
|
||||
|
||||
build() {
|
||||
NavDestination() {
|
||||
Stack({ alignContent: Alignment.Bottom }) {
|
||||
|
Loading…
Reference in New Issue
Block a user