默认图标优化,账户子系统适配

Signed-off-by: weiyunxing <weiyunxing@huawei.com>
This commit is contained in:
weiyunxing 2022-08-02 15:09:18 +08:00
parent 319108f164
commit 216217b590
2 changed files with 35 additions and 24 deletions

View File

@ -24,7 +24,7 @@ const INDEX = 0;
const IS_INCLUDE_ABILITY_INFO = 0;
const URI_PAGE = 'pages/applicationInfo';
let icon_arrow = $r('app.media.ic_settings_arrow');
let icon_default = $r('app.media.icon_default');
let icon_default = "ohos_app_icon";
let icon_default_str = "";
const MODULE_TAG = ConfigData.TAG + 'application-> ';
@ -38,7 +38,7 @@ export class AppManagementModel extends BaseModel {
constructor() {
super();
try {
globalThis.settingsAbilityContext.resourceManager.getMediaBase64(icon_default)
globalThis.settingsAbilityContext.resourceManager.getMediaBase64ByName(icon_default)
.then((res) => {
icon_default_str = res;
LogUtil.info('settings AppManagementModel getResourceManager init defaultIcon res:' + icon_default_str);

View File

@ -308,9 +308,14 @@ export class PasswordModel extends BaseModel {
openSession(callback: (challenge: string) => void): void {
LogUtil.debug(`${this.TAG}openSession in.`);
try {
this.userIdentityManager.openSession((data) => {
callback(this.u8AToStr(data));
})
this.userIdentityManager.openSession()
.then((data) =>{
callback(this.u8AToStr(data));
LogUtil.info(`${this.TAG} openSession success`);
})
.catch((err) => {
LogUtil.error(`${this.TAG} openSession failed` + JSON.stringify(err));
})
} catch {
LogUtil.error(`${this.TAG}openSession failed`);
callback('0');
@ -466,25 +471,31 @@ export class PasswordModel extends BaseModel {
}>) => void): void {
LogUtil.debug(`${this.TAG}getPinAuthInfo in.`);
try {
this.userIdentityManager.getAuthInfo(AuthType.PIN, (data) => {
LogUtil.info(`${this.TAG} get pin auth info data.`);
let arrCredInfo = [];
try{
for(let i = 0; i < data.length; i++) {
let credInfo = {
'authType': data[i].authType,
'authSubType': data[i].authSubType
};
if (credInfo.authType == AuthType.PIN) {
this.pinSubType = credInfo.authSubType;
}
arrCredInfo.push(credInfo);
}
} catch(e) {
LogUtil.debug('faceDemo pin.getAuthInfo error = ' + e);
}
callback(arrCredInfo);
})
this.userIdentityManager.getAuthInfo(AuthType.PIN)
.then((data) => {
LogUtil.info(`${this.TAG} get pin auth info data.`);
let arrCredInfo = [];
try {
for(let i = 0; i < data.length; i++) {
let credInfo = {
'authType': data[i].authType,
'authSubType': data[i].authSubType
};
if (credInfo.authType == AuthType.PIN) {
this.pinSubType = credInfo.authSubType;
}
arrCredInfo.push(credInfo);
}
} catch(e) {
LogUtil.info('faceDemo pin.getAuthInfo error = ' + e);
}
callback(arrCredInfo);
LogUtil.info(`${this.TAG} getAuthInfo success.`);
})
.catch((err) => {
LogUtil.error(`${this.TAG} getAuthInfo failed.` + JSON.stringify(err));
})
} catch (e) {
LogUtil.error(`${this.TAG}getPinAuthInfo failed:` + e);
}