diff --git a/application/AppScope/app.json b/application/AppScope/app.json index 0865a2a6ee6720c2eef74836c9f84aa4cedde888..e3c09a7ead3289c2f3d46f6244d4998c12671cec 100644 --- a/application/AppScope/app.json +++ b/application/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.dhardwareui", "vendor": "example", - "versionCode": 10000033, - "versionName": "1.0.33", + "versionCode": 10000034, + "versionName": "1.0.34", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/application/AppScope/app.json5 b/application/AppScope/app.json5 index a186be395dd7e5947d46f14c713ed4c93fe18495..e969d9a1ee21043eef79f3382d3ce841ae02ff85 100644 --- a/application/AppScope/app.json5 +++ b/application/AppScope/app.json5 @@ -16,8 +16,8 @@ "app": { "bundleName": "com.ohos.dhardwareui", "vendor": "example", - "versionCode": 10000033, - "versionName": "1.0.33", + "versionCode": 10000034, + "versionName": "1.0.34", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 12, diff --git a/application/entry/src/main/ets/pages/ContinueSwitch.ets b/application/entry/src/main/ets/pages/ContinueSwitch.ets index 9aea8b80fb20e1f505aa696374ecb012057fd032..c0bb88e521559632d5deb55dcc1431bf072e7bf8 100644 --- a/application/entry/src/main/ets/pages/ContinueSwitch.ets +++ b/application/entry/src/main/ets/pages/ContinueSwitch.ets @@ -24,7 +24,6 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; import CommonConstants, { FontSizeScale } from '../common/constants/CommonConstants'; import { logger } from '../utils/Logger'; import { TipsJumpUtils } from '../utils/TipsJumpUtils'; -import osAccount from '@ohos.account.osAccount'; import systemParameterEnhance from '@ohos.systemParameterEnhance'; import i18n from '@ohos.i18n'; import { LengthMetrics } from '@ohos.arkui.node'; @@ -85,7 +84,6 @@ struct ContinueSwitch { private scroller: Scroller = new Scroller(); private learnMore: ResourceStr = $r('app.string.learn_more'); private continueDesc: ResourceStr = $r('app.string.continue_desc_text', ''); - private accountManager: osAccount.AccountManager = osAccount.getAccountManager(); private startReason?: string = ''; onPortrait(mediaQueryResult: mediaQuery.MediaQueryResult): void { @@ -169,40 +167,6 @@ struct ContinueSwitch { logger.info(`${TAG} this.gapLength : ${this.gapLength}`); } - getForegroundOsAccountLocalId(): void { - logger.info(`${TAG} getForegroundOsAccountLocalId in`); - try { - this.accountManager.getForegroundOsAccountLocalId().then((localId: number) => { - logger.info(`${TAG} getForegroundOsAccountLocalId, localId: ${localId}`); - this.getAccountInfo(localId); - }).catch((err: BusinessError) => { - logger.error(`${TAG} getForegroundOsAccountLocalId errCode: ${err?.code}`); - }); - } catch (err) { - logger.error(`${TAG} getForegroundOsAccountLocalId exception: ${err?.message}`); - } - } - - getAccountInfo(localId: number): void { - logger.info(`${TAG} getAccountInfo in`); - try { - this.accountManager.queryOsAccountById(localId).then((accountInfo: osAccount.OsAccountInfo) => { - logger.info(`${TAG} queryOsAccountById, accountInfo.type: ${accountInfo.type}`); - if (accountInfo.type === osAccount.OsAccountType.PRIVATE) { - let status: boolean = settings.setValueSync(context, CommonConstants.CONTINUE_SWITCH_KEY, switchState.close, - settings.domainName.USER_SECURITY); - this.isSwitchOn = false; - this.isEnabled = false; - logger.info(`${TAG} set value isSuccess : status = ${status}; set:Continue_Switch_Status is 0`); - } - }).catch((err: BusinessError) => { - logger.error(`${TAG} queryOsAccountById errCode: ${err?.code}`); - }); - } catch (err) { - logger.error(`${TAG} queryOsAccountById exception: ${err?.message}`); - } - } - initSwitchStatus(): void { logger.info(`${TAG} initSwitchStatus in`); try { @@ -241,7 +205,6 @@ struct ContinueSwitch { this.initSwitchStatus(); this.getStringSync(); this.getImageArray(); - this.getForegroundOsAccountLocalId(); this.listener.on('change', (mediaQueryResult: mediaQuery.MediaQueryResult) => { this.onPortrait(mediaQueryResult); })